Changeset 1829
- Timestamp:
- 10/24/2004 11:48:51 PM (20 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-functions.php
r1818 r1829 573 573 } 574 574 575 function get_broken_themes() { 576 global $wp_broken_themes; 577 578 get_themes(); 579 return $wp_broken_themes; 580 } 581 575 582 function get_page_templates() { 576 583 $themes = get_themes(); -
trunk/wp-admin/themes.php
r1818 r1829 100 100 } 101 101 ?> 102 103 <?php 104 // List broken themes, if any. 105 $broken_themes = get_broken_themes(); 106 if (count($broken_themes)) { 107 ?> 108 109 <h2><?php _e('Broken Themes'); ?></h2> 110 <p><?php _e('The following themes are installed but incomplete. Themes must have a stylesheet and a template.'); ?></p> 111 112 <table width="100%" cellpadding="3" cellspacing="3"> 113 <tr> 114 <th><?php _e('Name'); ?></th> 115 <th><?php _e('Description'); ?></th> 116 </tr> 117 <?php 118 $theme = ''; 119 120 $theme_names = array_keys($broken_themes); 121 natcasesort($theme_names); 122 123 foreach ($theme_names as $theme_name) { 124 $title = $broken_themes[$theme_name]['Title']; 125 $description = $broken_themes[$theme_name]['Description']; 126 127 $theme = ('class="alternate"' == $theme) ? '' : 'class="alternate"'; 128 echo " 129 <tr $theme> 130 <td>$title</td> 131 <td>$description</td> 132 </tr>"; 133 } 134 ?> 135 </table> 136 <?php 137 } 138 ?> 139 102 140 </div> 103 141 -
trunk/wp-includes/functions.php
r1823 r1829 1994 1994 function get_themes() { 1995 1995 global $wp_themes; 1996 global $wp_broken_themes; 1996 1997 1997 1998 if (isset($wp_themes)) { … … 2000 2001 2001 2002 $themes = array(); 2003 $wp_broken_themes = array(); 2002 2004 $theme_loc = 'wp-content/themes'; 2003 2005 $theme_root = ABSPATH . $theme_loc; … … 2008 2010 while(($theme_dir = $themes_dir->read()) !== false) { 2009 2011 if (is_dir($theme_root . '/' . $theme_dir)) { 2012 if ($theme_dir == '.' || $theme_dir == '..') { 2013 continue; 2014 } 2010 2015 $stylish_dir = @ dir($theme_root . '/' . $theme_dir); 2016 $found_stylesheet = false; 2011 2017 while(($theme_file = $stylish_dir->read()) !== false) { 2012 2018 if ( $theme_file == 'style.css' ) { 2013 2019 $theme_files[] = $theme_dir . '/' . $theme_file; 2020 $found_stylesheet = true; 2021 break; 2014 2022 } 2023 } 2024 if (!$found_stylesheet) { 2025 $wp_broken_themes[$theme_dir] = array('Name' => $theme_dir, 'Title' => $theme_dir, 'Description' => __('Stylesheet is missing.')); 2015 2026 } 2016 2027 } … … 2063 2074 $stylesheet = dirname($theme_file); 2064 2075 2076 if (empty($name)) { 2077 $name = dirname($theme_file); 2078 $title = $name; 2079 } 2080 2065 2081 if (empty($template)) { 2066 2082 if (file_exists(dirname("$theme_root/$theme_file/index.php"))) { … … 2074 2090 2075 2091 if (($template != 'default') && (! file_exists("$theme_root/$template/index.php"))) { 2092 $wp_broken_themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => __('Template is missing.')); 2076 2093 continue; 2077 }2078 2079 if (empty($name)) {2080 $name = dirname($theme_file);2081 $title = $name;2082 2094 } 2083 2095
Note: See TracChangeset
for help on using the changeset viewer.