Changeset 18628 for trunk/admin/include/themes.class.php
- Timestamp:
- Oct 12, 2012, 9:56:12 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/themes.class.php
r16179 r18628 79 79 { 80 80 array_push( 81 $errors, 81 $errors, 82 82 sprintf( 83 83 l10n('Impossible to activate this theme, the parent theme is missing: %s'), … … 85 85 ) 86 86 ); 87 87 88 88 break; 89 89 } … … 212 212 break; 213 213 } 214 214 215 215 if (!$this->deltree(PHPWG_THEMES_PATH.$theme_id)) 216 216 { … … 221 221 case 'set_default': 222 222 // first we need to know which users are using the current default theme 223 $this->set_default_theme($theme_id); 223 $this->set_default_theme($theme_id); 224 224 break; 225 225 } … … 233 233 return null; 234 234 } 235 235 236 236 $parent = $this->fs_themes[$theme_id]['parent']; 237 237 238 238 if ('default' == $parent) 239 239 { 240 240 return null; 241 241 } 242 242 243 243 if (!isset($this->fs_themes[$parent])) 244 244 { … … 252 252 { 253 253 $children = array(); 254 254 255 255 foreach ($this->fs_themes as $test_child) 256 256 { … … 262 262 263 263 return $children; 264 } 264 } 265 265 266 266 function set_default_theme($theme_id) 267 267 { 268 268 global $conf; 269 269 270 270 // first we need to know which users are using the current default theme 271 271 $default_theme = get_default_theme(); 272 272 273 273 $query = ' 274 274 SELECT … … 301 301 * 302 302 FROM '.THEMES_TABLE; 303 303 304 304 $clauses = array(); 305 305 if (!empty($id)) … … 322 322 } 323 323 324 324 325 325 /** 326 326 * Get themes defined in the theme directory 327 */ 327 */ 328 328 function get_fs_themes() 329 329 { 330 330 $dir = opendir(PHPWG_THEMES_PATH); 331 331 332 332 while ($file = readdir($dir)) 333 333 { … … 532 532 return false; 533 533 } 534 534 535 535 /** 536 536 * Sort $server_themes … … 654 654 return $status; 655 655 } 656 656 657 657 /** 658 658 * delete $path directory … … 775 775 } 776 776 777 // themes specific methods778 function get_fs_themes_with_ini()779 {780 $themes_dir = PHPWG_ROOT_PATH.'themes';781 782 $fs_themes = array();783 784 foreach (get_dirs($themes_dir) as $theme)785 {786 $conf_file = $themes_dir.'/'.$theme.'/themeconf.inc.php';787 if (file_exists($conf_file))788 {789 $theme_data = array(790 'name' => $theme,791 );792 793 $ini_file = $themes_dir.'/'.$theme.'/theme.ini';794 if (file_exists($ini_file))795 {796 $theme_ini = parse_ini_file($ini_file);797 if (isset($theme_ini['extension_id']))798 {799 $theme_data['extension_id'] = $theme_ini['extension_id'];800 }801 }802 803 array_push($fs_themes, $theme_data);804 }805 }806 807 echo '<pre>'; print_r($fs_themes); echo '</pre>';808 }809 810 811 777 } 812 778 ?>
Note: See TracChangeset
for help on using the changeset viewer.