Changeset 843 in ExiteCMS for trunk/includes/theme_functions.php
- Timestamp:
- 09/27/07 19:34:07 (5 years ago)
- File:
-
- 1 edited
-
trunk/includes/theme_functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/theme_functions.php
r841 r843 27 27 $template->compile_check = true; 28 28 29 // set the compile ID for this website 30 $template->compile_id = $_SERVER['SERVER_NAME']; 31 29 32 // caching required? 30 33 $template->caching = 0; … … 44 47 // and finaly, use the default Smarty plugins 45 48 $plugins_dir[] = 'smarty-plugins'; 49 46 50 $template->plugins_dir = $plugins_dir; 51 52 // templates, where to find them? 53 $template_dir = array(); 54 // first check if there's one defined in the current theme 55 if (is_dir(PATH_THEME."templates/source")) $template_dir[] = PATH_THEME."templates/source"; 56 // next, check the CMS template directory 57 $template_dir[] = PATH_INCLUDES.'templates'; 58 59 $template->template_dir = $template_dir; 47 60 48 61 // PHP in Templates? Don't think so! … … 158 171 } 159 172 160 // if this is a module template...173 //if this is a module template... 161 174 $tpl_parts = explode(".", $panel['template']); 162 175 if ($tpl_parts[0] == "modules") { 163 // check if there is a customized version for the current theme 164 if (!file_exists($template->template_dir."/".$panel['template'])) { 165 // if not, add the module template to smarty's source list, so the default template can be found 166 $template->template_dir = array(PATH_MODULES.$tpl_parts[1].'/templates', $template->template_dir); 167 } 168 } 176 // store the current template directories, we need to restore them later 177 $td = $template->template_dir; 178 $template->template_dir = array_merge(array(PATH_MODULES.$tpl_parts[1].'/templates'), $template->template_dir); 179 } else { 180 // we shouldn't get here 181 } 182 169 183 // if a template is defined, load the template, 170 184 if (isset($panel['template'])) $template->display($panel['template']); 171 172 // restore the template direc tory if needed173 $template->template_dir = PATH_THEME.'templates/source';185 186 // restore the template direcory if needed 187 if (isset($td) && is_array($td)) $template->template_dir = $td; 174 188 } 175 189 }
Note: See TracChangeset
for help on using the changeset viewer.
