不同模块选择不同的主题风格,在themes/modules/mod name 下创建canvas的模板,themes会自动筛选模块下的canvas如果不存在,在去找自身的canvas文件.
<{php}>
// Get language files
require_once(XOOPS_ROOT_PATH.'/language/'.$GLOBALS['xoopsConfig']['language'].'/user.php');
//If a module defines its own canvas template (located themes/theme/modules/dirname/canvas.html), take it; otherwise the default canvas (themes/theme/canvas.html) is used.
if(file_exists(XOOPS_ROOT_PATH."/themes/".$this->_tpl_vars["xoops_theme"]."/modules/".$this->_tpl_vars["xoops_dirname"]."/canvas.html")) {
$this->assign("canvas_template", $this->_tpl_vars["xoops_theme"]."/modules/".$this->_tpl_vars["xoops_dirname"]."/canvas.html");
}else{
$this->assign("canvas_template", $this->_tpl_vars["xoops_theme"]."/canvas.html");
}
//Defined an extra SMARTY variable $xoops_themeurl, which is identical to $xoops_imageurl, for literal consistence only.
$this->assign("xoops_themeurl", $this->_tpl_vars["xoops_url"]."/themes/".$this->_tpl_vars["xoops_theme"]);
//Defined an extra SMARTY variable $xoops_module_theme.
$this->assign("xoops_module_theme", $this->_tpl_vars["xoops_theme"]."/modules/".$this->_tpl_vars["xoops_dirname"]);
//If a module has its own css (located themes/theme/modules/dirname/style.css), append it to $xoops_module_header.
if(file_exists(XOOPS_ROOT_PATH."/themes/".$this->_tpl_vars["xoops_theme"]."/modules/".$this->_tpl_vars["xoops_dirname"]."/style.css")) {
$this->assign("xoops_module_header",
$this->_tpl_vars["xoops_module_header"]."/n".
"<link rel=/"stylesheet/" type=/"text/css/" href=/"".$this->_tpl_vars["xoops_themeurl"]."/modules/".$this->_tpl_vars["xoops_dirname"]."/style.css/"/>/n"
);
}
<{/php}>