summaryrefslogtreecommitdiffstats
path: root/wp-admin/themes.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-03-26 15:46:27 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-03-26 15:46:27 +0000
commitb7fe2aee15c1f3ad0673d105624ea81f16f14288 (patch)
tree7b88927675de4b121e104a958647f10cfe438c10 /wp-admin/themes.php
parent244e8f75fcb7110a9ded532d76e5bcba50bc45f6 (diff)
downloadwordpress-mu-b7fe2aee15c1f3ad0673d105624ea81f16f14288.tar.gz
wordpress-mu-b7fe2aee15c1f3ad0673d105624ea81f16f14288.tar.xz
wordpress-mu-b7fe2aee15c1f3ad0673d105624ea81f16f14288.zip
Index allowed_themes by stylesheet path instead of name. (fixes #284)
Important! Make sure you visit and save wp-admin/wpmu-themes.php to update the list! git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@936 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/themes.php')
-rw-r--r--wp-admin/themes.php28
1 files changed, 14 insertions, 14 deletions
diff --git a/wp-admin/themes.php b/wp-admin/themes.php
index af7791f..ee84375 100644
--- a/wp-admin/themes.php
+++ b/wp-admin/themes.php
@@ -3,24 +3,23 @@ require_once('admin.php');
$themes = get_themes();
$ct = current_theme_info();
-$allowed_themes = get_site_option( "allowed_themes" );
-if( $allowed_themes == false ) {
- $allowed_themes = array();
- if( $blog_id != 1 )
- unset( $allowed_themes[ "WordPress MU Home Default" ] );
-}
-$blog_allowed_themes = get_option( "allowed_themes" );
+$allowed_themes = get_site_option( "allowedthemes" );
+if( $allowed_themes == false )
+ $allowed_themes = array();
+$blog_allowed_themes = wpmu_get_blog_allowedthemes();
if( is_array( $blog_allowed_themes ) )
$allowed_themes = array_merge( $allowed_themes, $blog_allowed_themes );
+if( $blog_id != 1 )
+ unset( $allowed_themes[ "h3" ] );
+
+if( isset( $allowed_themes[ wp_specialchars( $ct->stylesheet ) ] ) == false )
+ $allowed_themes[ wp_specialchars( $ct->stylesheet ) ] = true;
-if( isset( $allowed_themes[ $ct->title ] ) == false ) {
- $allowed_themes[ $ct->title ] = true;
-}
reset( $themes );
-while( list( $key, $val ) = each( $themes ) ) {
- if( isset( $allowed_themes[ $key ] ) == false ) {
- unset( $themes[ $key ] );
+foreach( $themes as $key => $theme ) {
+ if( isset( $allowed_themes[ wp_specialchars( $theme[ 'Stylesheet' ] ) ] ) == false ) {
+ unset( $themes[ $key ] );
}
}
reset( $themes );
@@ -75,6 +74,7 @@ require_once('admin-header.php');
<p><?php echo $ct->description; ?></p>
</div>
+<br style="clear: both" />
<h2><?php _e('Available Themes'); ?></h2>
<?php if ( 1 < count($themes) ) { ?>
@@ -118,7 +118,7 @@ $broken_themes = get_broken_themes();
if ( is_site_admin() && count($broken_themes) ) {
?>
-<h2><?php _e('Broken Themes'); ?></h2>
+<h2><?php _e('Broken Themes'); ?> (Site admin only)</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">