本文整理汇总了PHP中UTIL_HtmlTag::jevix方法的典型用法代码示例。如果您正苦于以下问题:PHP UTIL_HtmlTag::jevix方法的具体用法?PHP UTIL_HtmlTag::jevix怎么用?PHP UTIL_HtmlTag::jevix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UTIL_HtmlTag
的用法示例。
在下文中一共展示了UTIL_HtmlTag::jevix方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getJevix
/**
* @return Jevix
*/
private static function getJevix($tagList = null, $attrList = null, $blackListMode = false, $mediaSrcValidate = true)
{
if (self::$jevix === null) {
require_once OW_DIR_LIB . 'jevix' . DS . 'jevix.class.php';
self::$jevix = new Jevix();
}
$tagRules = array();
$commonAttrs = array();
if (!empty($tagList)) {
foreach ($tagList as $tag) {
$tagRules[$tag] = array(Jevix::TR_TAG_LIST => true);
}
}
if ($attrList !== null) {
foreach ($attrList as $attr) {
if (strstr($attr, '.')) {
$parts = explode('.', $attr);
$tag = trim($parts[0]);
$param = trim($parts[1]);
if (!strlen($tag) || !strlen($attr)) {
continue;
}
if ($tag === '*') {
$commonAttrs[] = $param;
continue;
}
if (!isset($tagRules[$tag])) {
$tagRules[$tag] = array(Jevix::TR_TAG_LIST => true);
}
if (!isset($tagRules[$tag][Jevix::TR_PARAM_ALLOWED])) {
$tagRules[$tag][Jevix::TR_PARAM_ALLOWED] = array();
}
$tagRules[$tag][Jevix::TR_PARAM_ALLOWED][$param] = true;
} else {
$commonAttrs[] = trim($attr);
}
}
}
$shortTags = array('img', 'br', 'input', 'embed', 'param', 'hr', 'link', 'meta', 'base', 'col');
foreach ($shortTags as $shortTag) {
if (!isset($tagRules[$shortTag])) {
$tagRules[$shortTag] = array();
}
$tagRules[$shortTag][Jevix::TR_TAG_SHORT] = true;
}
$cutWithContent = array('script', 'embed', 'object', 'style');
foreach ($cutWithContent as $cutTag) {
if (!isset($tagRules[$cutTag])) {
$tagRules[$cutTag] = array();
}
$tagRules[$cutTag][Jevix::TR_TAG_CUT] = true;
}
self::$jevix->blackListMode = $blackListMode;
self::$jevix->commonTagParamRules = $commonAttrs;
self::$jevix->tagsRules = $tagRules;
self::$jevix->mediaSrcValidate = $mediaSrcValidate;
self::$jevix->mediaValidSrc = BOL_TextFormatService::getInstance()->getMediaResourceList();
return self::$jevix;
}