本文整理汇总了PHP中SJB_System::getTemplateprocessor方法的典型用法代码示例。如果您正苦于以下问题:PHP SJB_System::getTemplateprocessor方法的具体用法?PHP SJB_System::getTemplateprocessor怎么用?PHP SJB_System::getTemplateprocessor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SJB_System
的用法示例。
在下文中一共展示了SJB_System::getTemplateprocessor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($template)
{
if ($this->templateProcessor === null) {
$template_processor = SJB_System::getTemplateprocessor();
} else {
$template_processor = $this->templateProcessor;
}
$template_processor->assign("field_sid", $this->field_sid);
$template_processor->assign("list_items", $this->list_items);
$template_processor->assign("field_info", $this->field_info);
$template_processor->assign("type_sid", $this->_getTypeSID());
$template_processor->assign("type_info", $this->_getTypeInfo());
$template_processor->display($template);
}
示例2: execute
public function execute()
{
$template_processor = SJB_System::getTemplateprocessor();
$template_name = isset($_REQUEST['template_name']) ? $_REQUEST['template_name'] : "";
$template_editor = new SJB_TemplateEditor();
$template_processor->assign('ERROR', '');
$theme = SJB_Settings::getValue('TEMPLATE_USER_THEME', 'default');
if (isset($_REQUEST['action'])) {
if ($_REQUEST['action'] == 'create_page_template') {
if (!isset($_REQUEST['new_template_name'])) {
$_REQUEST['new_template_name'] = '';
}
$_REQUEST['new_template_name'] = preg_replace("~.tpl\$~iu", "", $_REQUEST['new_template_name']);
if (empty($_REQUEST['new_template_name'])) {
$template_processor->assign('ERROR', 'EMPTY_TEMPLATE_NAME');
} else {
if (preg_match("~\\W~", $_REQUEST['new_template_name'])) {
$template_processor->assign('ERROR', 'WRONG_FILENAME');
} else {
if (true !== ($result = $template_editor->saveTemplate($_REQUEST['new_template_name'] . ".tpl", SJB_System::getSystemSettings('STARTUP_MODULE'), $theme, "<html>\n<head>\n<title>{\$TITLE}</title>\n</head>\n<body>\n{\$MAIN_CONTENT}\n</body>\n</html>"))) {
$template_processor->assign('ERROR', 'CANNOT_SAVE_FILE');
} else {
SJB_HelperFunctions::redirect("?");
}
}
}
}
if ($_REQUEST['action'] == 'delete_template') {
$template_editor->deleteTemplate($_REQUEST['del_template_name'], SJB_System::getSystemSettings('STARTUP_MODULE'), $theme);
SJB_HelperFunctions::redirect("?");
}
}
$template_processor->assign('new_template_name', isset($_REQUEST['new_template_name']) ? $_REQUEST['new_template_name'] : "");
$template_processor->assign('template_name', $template_editor->doesModuleTemplateExists(SJB_System::getSystemSettings('STARTUP_MODULE'), $template_name) ? $template_name : "");
$template_processor->assign('STARTUP_MODULE', SJB_System::getSystemSettings('STARTUP_MODULE'));
$template_processor->assign('template_list', $template_editor->getTemplateList(SJB_System::getSystemSettings('STARTUP_MODULE'), $theme));
$template_processor->display('page_template_list.tpl');
}