模板复写 modulename_canvas.html ( xoops themes )

不同模块选择不同的主题风格,在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}>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值