/** * 设置cdn */ public static function setCdn($cdn) { $cdn = trim($cdn); self::$cdn = $cdn; }
function _init() { //是否需要fis模块的初始化 $fisWidget = $this->urlParam['pagelets']; //主站模块需初始化fis widget if ($fisWidget && $this->handlerFileType === 'tpl') { //根据参数pagelets判断是否是fis模块 $this->isFis = true; require_once FIS_SMARTY_PLUGINS_DIR . "lib/FISPagelet.class.php"; FISPagelet::init(); $this->smarty->assign('openApi', array('widgetPathRoot' => $this->fisWidgetRootPath, 'widgetId' => $fisWidget)); $this->smarty->registerFilter('output', array('FISPagelet', 'renderResponse')); } }
/** * WIDGET END * 收集html,收集静态资源 */ public static function end() { $ret = true; if (self::$widget_mode !== self::MODE_NOSCRIPT) { $html = ob_get_clean(); $pagelet = self::$_context; //end if (isset($pagelet['parent_id'])) { $parent = self::$_contextMap[$pagelet['parent_id']]; if (!$parent['hit'] && $pagelet['hit']) { self::$inner_widget[self::$widget_mode][] = FISResource::widgetEnd(); } } else { if ($pagelet['hit']) { self::$inner_widget[self::$widget_mode][] = FISResource::widgetEnd(); } } if ($pagelet['hit'] && !$pagelet['async']) { unset($pagelet['hit']); unset($pagelet['async']); $pagelet['html'] = $html; self::$_pagelets[] =& $pagelet; unset($pagelet); } else { $ret = false; } $parent_id = self::$_context['parent_id']; if (isset($parent_id)) { self::$_context = self::$_contextMap[$parent_id]; unset(self::$_contextMap[$parent_id]); } else { self::$_context = null; } self::$widget_mode = self::$mode; //指定渲染的位置 if (!empty(self::$rend_div)) { echo '</div>'; } else { self::$rend_div = true; } } return $ret; }