진서기

HTML 필터 image map 허용하기

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 파일에서 검색해보면 될 겁니다.
이미지맵적용하기
5.3 버젼에서 안되내요
댓글을 작성하시려면 로그인이 필요합니다.

그누보드5 팁자료실

+
제목 글쓴이 날짜 조회
10년 전 조회 7,442
10년 전 조회 7.3만
10년 전 조회 4,994
10년 전 조회 1만
10년 전 조회 9,569
10년 전 조회 9,172
10년 전 조회 7,150
10년 전 조회 1.7만
10년 전 조회 9,118
10년 전 조회 7,094
10년 전 조회 9,596
10년 전 조회 9,065
10년 전 조회 1만
10년 전 조회 8,943
10년 전 조회 1만
10년 전 조회 9,716
10년 전 조회 1만
10년 전 조회 6,380
10년 전 조회 1.4만
10년 전 조회 8,344
10년 전 조회 7,037
10년 전 조회 2.1만
10년 전 조회 1.1만
10년 전 조회 4,593
10년 전 조회 1.1만
10년 전 조회 9,761
10년 전 조회 1만
10년 전 조회 2만
10년 전 조회 1.1만
10년 전 조회 6,644