Changeset 12722 for trunk/wp-admin/themes.php
- Timestamp:
- 01/14/2010 02:02:19 AM (16 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
themes.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin
-
Property
svn:ignore
set to
.themes.php.swp
.user-edit.php.swp
.user-new.php.swp
.users.php.swp
-
Property
svn:ignore
set to
-
trunk/wp-admin/themes.php
r12673 r12722 13 13 wp_die( __( 'Cheatin’ uh?' ) ); 14 14 15 if ( is_multisite() ) { 16 $themes = get_themes(); 17 $ct = current_theme_info(); 18 $allowed_themes = apply_filters("allowed_themes", get_site_allowed_themes() ); 19 if( $allowed_themes == false ) 20 $allowed_themes = array(); 21 22 $blog_allowed_themes = wpmu_get_blog_allowedthemes(); 23 if( is_array( $blog_allowed_themes ) ) 24 $allowed_themes = array_merge( $allowed_themes, $blog_allowed_themes ); 25 if( $blog_id != 1 ) 26 unset( $allowed_themes[ "h3" ] ); 27 28 if( isset( $allowed_themes[ wp_specialchars( $ct->stylesheet ) ] ) == false ) 29 $allowed_themes[ wp_specialchars( $ct->stylesheet ) ] = true; 30 31 reset( $themes ); 32 foreach( $themes as $key => $theme ) { 33 if( isset( $allowed_themes[ wp_specialchars( $theme[ 'Stylesheet' ] ) ] ) == false ) { 34 unset( $themes[ $key ] ); 35 } 36 } 37 reset( $themes ); 38 } 15 39 if ( isset($_GET['action']) ) { 16 40 if ( 'activate' == $_GET['action'] ) { … … 33 57 34 58 $help = '<p>' . __('Themes give your WordPress style. Once a theme is installed, you may preview it, activate it or deactivate it here.') . '</p>'; 35 if ( current_user_can('install_themes') ) {59 if ( ( !is_multisite() && current_user_can('install_themes') ) || is_super_admin() ) { 36 60 $help .= '<p>' . sprintf(__('You can find additional themes for your site by using the new <a href="%1$s">Theme Browser/Installer</a> functionality or by browsing the <a href="http://wordpress.org/extend/themes/">WordPress Theme Directory</a> directly and installing manually. To install a theme <em>manually</em>, <a href="%2$s">upload its ZIP archive with the new uploader</a> or copy its folder via FTP into your <code>wp-content/themes</code> directory.'), 'theme-install.php', 'theme-install.php?tab=upload' ) . '</p>'; 37 61 $help .= '<p>' . __('Once a theme is uploaded, you should see it on this page.') . '</p>' ; … … 44 68 45 69 require_once('admin-header.php'); 70 if( is_multisite() && is_super_admin() ) { 71 ?><div id="message0" class="updated fade"><p><?php _e('Administrator: new themes must be activated in the <a href="wpmu-themes.php">Themes Admin</a> page before they appear here.'); ?></p></div><?php 72 } 46 73 ?> 47 74 … … 59 86 60 87 <?php 61 $themes = get_themes(); 88 if ( !is_multisite() ) 89 $themes = get_themes(); 62 90 $ct = current_theme_info(); 63 91 unset($themes[$ct->name]); … … 98 126 function theme_update_available( $theme ) { 99 127 static $themes_update; 128 129 if ( is_multisite() && !is_super_admin() ) 130 return; 131 100 132 if ( !isset($themes_update) ) 101 133 $themes_update = get_site_transient('update_themes'); … … 128 160 <div class="wrap"> 129 161 <?php screen_icon(); ?> 130 <h2><?php echo esc_html( $title ); ?> <a href="theme-install.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'theme'); ?></a></h2>162 <h2><?php echo esc_html( $title ); if ( !is_multisite() || is_super_admin() ) { ?> <a href="theme-install.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'theme'); ?></a><?php } ?></h2> 131 163 132 164 <h3><?php _e('Current Theme'); ?></h3> … … 139 171 printf(__('%1$s %2$s by %3$s'), $ct->title, $ct->version, $ct->author) ; ?></h4> 140 172 <p class="theme-description"><?php echo $ct->description; ?></p> 141 <?php if ( $ct->parent_theme) { ?>173 <?php if ( ( !is_multisite() || is_super_admin() ) && $ct->parent_theme ) { ?> 142 174 <p><?php printf(__('The template files are located in <code>%2$s</code>. The stylesheet files are located in <code>%3$s</code>. <strong>%4$s</strong> uses templates from <strong>%5$s</strong>. Changes made to the templates will affect both themes.'), $ct->title, str_replace( WP_CONTENT_DIR, '', $ct->template_dir ), str_replace( WP_CONTENT_DIR, '', $ct->stylesheet_dir ), $ct->title, $ct->parent_theme); ?></p> 143 175 <?php } else { ?> … … 218 250 $actions[] = '<a href="' . $activate_link . '" class="activatelink" title="' . $activate_text . '">' . __('Activate') . '</a>'; 219 251 $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview “%s”'), $theme_name)) . '">' . __('Preview') . '</a>'; 220 if ( current_user_can('update_themes') )252 if ( ( !is_multisite() && current_user_can('update_themes') ) || is_super_admin() ) 221 253 $actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url("themes.php?action=delete&template=$stylesheet", 'delete-theme_' . $stylesheet) . '" onclick="' . "if ( confirm('" . esc_js(sprintf( __("You are about to delete this theme '%s'\n 'Cancel' to stop, 'OK' to delete."), $theme_name )) . "') ) {return true;}return false;" . '">' . __('Delete') . '</a>'; 222 254 $actions = apply_filters('theme_action_links', $actions, $themes[$theme_name]); … … 234 266 <p class="description"><?php echo $description; ?></p> 235 267 <span class='action-links'><?php echo $actions ?></span> 236 <?php if ( $parent_theme) {268 <?php if ( ( !is_multisite() || is_super_admin() ) && $parent_theme ) { 237 269 /* translators: 1: theme title, 2: template dir, 3: stylesheet_dir, 4: theme title, 5: parent_theme */ ?> 238 270 <p><?php printf(__('The template files are located in <code>%2$s</code>. The stylesheet files are located in <code>%3$s</code>. <strong>%4$s</strong> uses templates from <strong>%5$s</strong>. Changes made to the templates will affect both themes.'), $title, str_replace( WP_CONTENT_DIR, '', $template_dir ), str_replace( WP_CONTENT_DIR, '', $stylesheet_dir ), $title, $parent_theme); ?></p> … … 267 299 // List broken themes, if any. 268 300 $broken_themes = get_broken_themes(); 269 if ( count($broken_themes) ) {270 ?> 271 272 <h2><?php _e('Broken Themes'); ?> </h2>301 if ( ( !is_multisite() || is_super_admin() ) && count( $broken_themes ) ) { 302 ?> 303 304 <h2><?php _e('Broken Themes'); ?> <?php if ( is_multisite() ) _e( '(Site admin only)' ); ?></h2> 273 305 <p><?php _e('The following themes are installed but incomplete. Themes must have a stylesheet and a template.'); ?></p> 274 306
Note: See TracChangeset
for help on using the changeset viewer.