HTML 필터 image map 허용하기 정보
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);
$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);
추천
2
2
댓글 6개
안녕하세요. 진서기님.
onfocus='blur()' 로 점선제거도 가능하게 하려면 어떻게 하면 될까요?
도움 부탁 드려요~~
onfocus='blur()' 로 점선제거도 가능하게 하려면 어떻게 하면 될까요?
도움 부탁 드려요~~
그런건 모릅니다.
html_purifier 함수는 /lib/common.lib.php 파일에서 검색해보면 될 겁니다.
이미지맵적용하기
5.3 버젼에서 안되내요
감사합니다.