From: <on...@us...> - 2002-09-23 21:13:47
|
Update of /cvsroot/xoops/xoops-current/html In directory usw-pr-cvs1:/tmp/cvs-serv7354 Modified Files: header.php footer.php Log Message: no message Index: header.php =================================================================== RCS file: /cvsroot/xoops/xoops-current/html/header.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** header.php 21 Sep 2002 17:08:38 -0000 1.12 --- header.php 23 Sep 2002 21:13:44 -0000 1.13 *************** *** 31,34 **** --- 31,35 ---- if (!file_exists(XOOPS_ROOT_PATH.'/themes/'.$xoopsConfig['default_theme'].'/layout.html')) { // the old way.. + $xoopsOption['theme_use_smarty'] = 0; xoops_header(false); include(XOOPS_ROOT_PATH.'/themes/'.$xoopsConfig['default_theme'].'/theme.php'); *************** *** 37,45 **** // exit if this page uses smarty if (!empty($xoopsOption['use_smarty'])) { ! echo "This page requires Smarty enabled theme"; ! include('footer.php'); ! exit(); } } else { // include Smarty template engine and initialize it require_once(XOOPS_ROOT_PATH.'/class/xoopstpl.php'); --- 38,54 ---- // exit if this page uses smarty if (!empty($xoopsOption['use_smarty'])) { ! // include Smarty template engine and initialize it ! require_once(XOOPS_ROOT_PATH.'/class/xoopstpl.php'); ! $xoopsTpl = new XoopsTpl(); ! $xoopsTpl->setCaching(2); ! if ($xoopsConfig['debug_mode'] == 1) { ! $xoopsTpl->setDebugging(true); ! } ! $xoopsTpl->setCacheDir(XOOPS_ROOT_PATH.'/cache'); ! $xoopsTpl->setCompileDir(XOOPS_ROOT_PATH.'/templates_c'); ! $xoopsTpl->setTemplateDir(XOOPS_ROOT_PATH.'/themes/'.$xoopsConfig['default_theme']); } } else { + $xoopsOption['theme_use_smarty'] = 1; // include Smarty template engine and initialize it require_once(XOOPS_ROOT_PATH.'/class/xoopstpl.php'); Index: footer.php =================================================================== RCS file: /cvsroot/xoops/xoops-current/html/footer.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** footer.php 19 Sep 2002 16:58:46 -0000 1.9 --- footer.php 23 Sep 2002 21:13:44 -0000 1.10 *************** *** 3,8 **** define("XOOPS_FOOTER_INCLUDED",1); $footer = "<br />Powered by XOOPS © 2002 <a href='http://www.xoops.org/' target='_blank'>The XOOPS Project</a>"; ! if ( !isset($xoopsTpl) ) { // the old way if ( !isset($xoopsOption['show_rblock']) ) { $xoopsOption['show_rblock'] = 0; --- 3,31 ---- define("XOOPS_FOOTER_INCLUDED",1); $footer = "<br />Powered by XOOPS © 2002 <a href='http://www.xoops.org/' target='_blank'>The XOOPS Project</a>"; ! if ($xoopsConfig['debug_mode'] == 1) { ! $xoopsLogger =& XoopsLogger::getInstance(); ! $xoopsLogger->stopTime(); ! $footer .= $xoopsLogger->dumpAll(); ! } ! if ($xoopsOption['theme_use_smarty'] == 0) { // the old way + if (!empty($xoopsOption['use_smarty'])) { + if (isset($xoopsContentsTpl) && $xoopsContentsTpl != '') { + // check if the current page is a module page + if ( isset($xoopsModule) && get_class($xoopsModule) == 'xoopsmodule' ) { + // set module specific template directory + if ( !is_dir(XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->dirname().'/templates/'.$xoopsConfig['default_theme'].'/') ) { + $xoopsTpl->assign('xoops_contents_tpldir', XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->dirname().'/templates/xoops'); + $xoopsContentsTpl = 'file:'.XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->dirname().'/templates/xoops/'.$xoopsContentsTpl; + } else { + $xoopsTpl->assign('xoops_contents_tpldir', XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->dirname().'/templates/'.$xoopsConfig['default_theme']); + $xoopsContentsTpl = 'file:'.XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->dirname().'/templates/'.$xoopsConfig['default_theme'].'/'.$xoopsContentsTpl; + } + } + $cache = !empty($xoopsContentsTplCache) ? intval($xoopsContentsTplCache) : 0; + $xoopsTpl->cache_lifetime = $cache; + $xoopsTpl->display($xoopsContentsTpl); + } + } if ( !isset($xoopsOption['show_rblock']) ) { $xoopsOption['show_rblock'] = 0; *************** *** 32,40 **** $xoopsTpl->assign('xoops_contents', $xoopsTpl->fetch($xoopsContentsTpl)); } - } - if ($xoopsConfig['debug_mode']) { - $xoopsLogger =& XoopsLogger::getInstance(); - $xoopsLogger->stopTime(); - $footer .= $xoopsLogger->dumpAll(); } $xoopsTpl->assign('xoops_footer', $footer); --- 55,58 ---- |