테스트 사이트 - 개발 중인 베타 버전입니다

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 팁자료실

글쓰기
🐛 버그신고