[영카트5] 상품 상세 설명에 이미지맵 걸기, 적용하기 > php

본문 바로가기

php

[영카트5] 상품 상세 설명에 이미지맵 걸기, 적용하기

작성일 15-10-16 14:29

페이지 정보

작성자서방님 조회 646회 댓글 0건

본문

HTML 필터 image map 허용하기



/lib/common.lib.php (569 Line)


$config->set('Attr.AllowedFrameTargets', array('_blank'));


구문 아래쪽에


    $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);


    $purifier = new HTMLPurifier($config);

    return $purifier->purify($html);     

댓글목록

등록된 댓글이 없습니다.

게시물 검색
Copyright © 서방님.kr All rights reserved.
PC 버전으로 보기