List broken themes and suggest corrective action.

git-svn-id: https://develop.svn.wordpress.org/trunk@1829 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2004-10-24 23:48:51 +00:00
parent 4b81c51c9b
commit d3f7d9e4c8
3 changed files with 62 additions and 5 deletions

View File

@@ -572,6 +572,13 @@ function validate_current_theme() {
return true;
}
function get_broken_themes() {
global $wp_broken_themes;
get_themes();
return $wp_broken_themes;
}
function get_page_templates() {
$themes = get_themes();
$theme = get_current_theme();

View File

@@ -99,6 +99,44 @@ $current_stylesheet = $themes[$current_theme]['Stylesheet'];
<?php
}
?>
<?php
// List broken themes, if any.
$broken_themes = get_broken_themes();
if (count($broken_themes)) {
?>
<h2><?php _e('Broken Themes'); ?></h2>
<p><?php _e('The following themes are installed but incomplete. Themes must have a stylesheet and a template.'); ?></p>
<table width="100%" cellpadding="3" cellspacing="3">
<tr>
<th><?php _e('Name'); ?></th>
<th><?php _e('Description'); ?></th>
</tr>
<?php
$theme = '';
$theme_names = array_keys($broken_themes);
natcasesort($theme_names);
foreach ($theme_names as $theme_name) {
$title = $broken_themes[$theme_name]['Title'];
$description = $broken_themes[$theme_name]['Description'];
$theme = ('class="alternate"' == $theme) ? '' : 'class="alternate"';
echo "
<tr $theme>
<td>$title</td>
<td>$description</td>
</tr>";
}
?>
</table>
<?php
}
?>
</div>
<?php