Changeset 2476 for trunk/include/template.class.php
- Timestamp:
- Aug 16, 2008, 3:32:37 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/template.class.php
r2464 r2476 146 146 function set_filenames($filename_array) 147 147 { 148 global $conf; 148 global $conf; 149 149 if (!is_array($filename_array)) 150 150 { … … 160 160 else 161 161 { 162 if (!isset($this->files[$handle]))$this->files[$handle] = $filename;162 $this->files[$handle] = $filename; 163 163 foreach ($tpl_extension as $file => $conditions) 164 164 { 165 165 $localtpl = './template-extension/' . $file; 166 if ($handle == $conditions[0] and 167 (stripos(implode('/',array_flip($_GET)),$conditions[1])>0 166 if ($handle == $conditions[0] and 167 (stripos(implode('/',array_flip($_GET)),$conditions[1])>0 168 168 or $conditions[1] == 'N/A') 169 169 and file_exists($localtpl)) 170 170 { /* examples: Are best_rated, created-monthly-calendar, list, ... set? */ 171 $this->files[$handle] = '../.' . $localtpl; 171 $this->files[$handle] = '../.' . $localtpl; 172 172 /* assign their tpl-extension */ 173 173 } … … 177 177 return true; 178 178 } 179 function on_extension($key, $tlpname) 180 { 181 return $tplname; 182 } 179 183 180 /** see smarty assign http://www.smarty.net/manual/en/api.assign.php */ 184 181 function assign($tpl_var, $value = null) … … 257 254 $this->smarty->compile_id .= '.'.$lang_info['code']; 258 255 } 259 256 260 257 $v = $this->smarty->fetch($this->files[$handle], null, null, false); 261 258 262 259 if (isset ($save_compile_id) ) 263 260 { 264 261 $this->smarty->compile_id = $save_compile_id; 265 262 } 266 263 267 264 if ($return) 268 265 { … … 336 333 return explode($delimiter, $text); 337 334 } 338 335 339 336 /** 340 337 * This smarty "html_head" block allows to add content just before 341 338 * </head> element in the output after the head has been parsed. This is 342 339 * handy in order to respect strict standards when <style> and <link> 343 * html elements must appear in the <head> element 340 * html elements must appear in the <head> element 344 341 */ 345 342 function block_html_head($params, $content, &$smarty, &$repeat) … … 358 355 } 359 356 } 360 361 /** 362 * Smarty prefilter to allow caching (whenever possible) language strings 357 358 /** 359 * Smarty prefilter to allow caching (whenever possible) language strings 363 360 * from templates. 364 361 */ … … 368 365 $ldq = preg_quote($this->smarty->left_delimiter, '~'); 369 366 $rdq = preg_quote($this->smarty->right_delimiter, '~'); 370 367 371 368 $regex = "~$ldq *\'([^'$]+)\'\|@translate *$rdq~"; 372 369 $source = preg_replace( $regex.'e', 'isset($lang[\'$1\']) ? $lang[\'$1\'] : \'$0\'', $source);
Note: See TracChangeset
for help on using the changeset viewer.