진서기

HTML 필터 image map 허용하기

· 2015-08-27 (목) 11:31:36 · 12372 · 6
html_purifier 함수에 추가해주세요.

$config->set('Attr.AllowedFrameTargets', array('_blank')); 부분 아래에 추가해주시면 됩니다.


$def = $config->getHTMLDefinition(true);

// Add usemap attribute to img tag
$def->addAttribute('img', 'usemap', 'CDATA');

// Add map tag
$map = $def->addElement(
'map', // name
'Block', // content set
'Flow', // allowed children
'Common', // attribute collection
array(// attributes
'name' => 'CDATA',
'id' => 'ID',
'title' => 'CDATA',
)
);
$map->excludes = array('map' => true);

// Add area tag
$area = $def->addElement(
'area', // name
'Block', // content set
'Empty', // don't allow children
'Common', // attribute collection
array(// attributes
'name' => 'CDATA',
'id' => 'ID',
'alt' => 'Text',
'coords' => 'CDATA',
'accesskey' => 'Character',
'nohref' => new HTMLPurifier_AttrDef_Enum(array('nohref')),
'href' => 'URI',
'shape' => new HTMLPurifier_AttrDef_Enum(array('rect', 'circle', 'poly', 'default')),
'tabindex' => 'Number',
'target' => new HTMLPurifier_AttrDef_Enum(array('_blank', '_self', '_target', '_top'))
)
);
$area->excludes = array('area' => true);
|

댓글 6개

안녕하세요. 진서기님.
onfocus='blur()' 로 점선제거도 가능하게 하려면 어떻게 하면 될까요?
도움 부탁 드려요~~
그런건 모릅니다.
html_purifier 함수는 /lib/common.lib.php 파일에서 검색해보면 될 겁니다.
이미지맵적용하기
2019-08-30 (금) 01:07:29
5.3 버젼에서 안되내요
감사합니다.
댓글을 작성하시려면 로그인이 필요합니다.

그누보드5 팁자료실

2,788건
+
제목 글쓴이 날짜 조회
15-09-09 조회 9,578
15-09-08 조회 2만
15-09-03 조회 1.1만
15-08-31 조회 9,245
15-08-31 조회 1.2만
15-08-30 조회 1.1만
15-08-30 조회 1.2만
15-08-30 조회 1.1만
15-08-27 조회 1.2만
15-08-26 조회 1.2만
15-08-22 조회 1.2만
15-08-21 조회 8,486
15-08-20 조회 1.6만
15-08-18 조회 1만
15-08-18 조회 9,103
15-08-18 조회 2.3만
15-08-18 조회 1.4만
15-08-16 조회 6,676
15-08-13 조회 1.3만
15-08-13 조회 1.2만
15-08-12 조회 1.2만
15-08-10 조회 2.2만
15-08-10 조회 1.3만
15-08-07 조회 8,781
15-08-04 조회 1.4만
15-08-03 조회 2.6만
15-07-27 조회 1.8만
15-07-19 조회 1.7만
15-07-17 조회 1.4만
15-07-17 조회 1.3만