Changeset 2434 for trunk/include/template.class.php
- Timestamp:
- Jul 14, 2008, 11:42:40 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/template.class.php
r2334 r2434 146 146 function set_filenames($filename_array) 147 147 { 148 global $conf; 148 149 if (!is_array($filename_array)) 149 150 { 150 151 return false; 151 152 } 152 153 153 reset($filename_array); 154 $tpl_extension = isset($conf['extents_for_templates']) ? 155 unserialize($conf['extents_for_templates']) : array(); 154 156 while(list($handle, $filename) = each($filename_array)) 155 157 { … … 157 159 unset( $this->files[$handle] ); 158 160 else 159 $this->files[$handle] = $filename; 161 { 162 if (!isset($this->files[$handle])) $this->files[$handle] = $filename; 163 foreach ($tpl_extension as $file => $conditions) 164 { 165 $localtpl = './template-extension/' . $file; 166 if ($handle == $conditions[0] and 167 (stripos(implode('/',array_flip($_GET)),$conditions[1])>0 168 or $conditions[1] == 'N/A') 169 and file_exists($localtpl)) 170 { /* examples: Are best_rated, created-monthly-calendar, list, ... set? */ 171 $this->files[$handle] = '../.' . $localtpl; 172 /* assign their tpl-extension */ 173 /* For test purpose: Do advanced users need a php access? */ 174 // $localphp = '../.' . substr($localtpl,0,-3).'php'; 175 // if (file_exists($localphp)) @include_once($localphp); 176 } 177 } 178 } 160 179 } 161 180 return true; 162 181 } 163 182 function on_extension($key, $tlpname) 183 { 184 return $tplname; 185 } 164 186 /** see smarty assign http://www.smarty.net/manual/en/api.assign.php */ 165 187 function assign($tpl_var, $value = null)
Note: See TracChangeset
for help on using the changeset viewer.