diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-06-27 11:03:10 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-06-27 11:03:10 +0000 |
commit | 8db1e81228b0e295199f6e3ee8a99d223c48f8c2 (patch) | |
tree | 131d8b23b9e939a9c23f24ec650b343efa918c5c /wp-admin/themes.php | |
parent | 13aff523358403d08dc7fcb0d844a2e6c12df41a (diff) | |
download | wordpress-mu-8db1e81228b0e295199f6e3ee8a99d223c48f8c2.tar.gz wordpress-mu-8db1e81228b0e295199f6e3ee8a99d223c48f8c2.tar.xz wordpress-mu-8db1e81228b0e295199f6e3ee8a99d223c48f8c2.zip |
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@599 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/themes.php')
-rw-r--r-- | wp-admin/themes.php | 68 |
1 files changed, 39 insertions, 29 deletions
diff --git a/wp-admin/themes.php b/wp-admin/themes.php index f57bd1b..bc8ecbe 100644 --- a/wp-admin/themes.php +++ b/wp-admin/themes.php @@ -1,35 +1,6 @@ <?php require_once('admin.php'); -if ( isset($_GET['action']) ) { - check_admin_referer('switch-theme_' . $_GET['template']); - - if ('activate' == $_GET['action']) { - if ( isset($_GET['template']) ) - update_option('template', $_GET['template']); - - if ( isset($_GET['stylesheet']) ) - update_option('stylesheet', $_GET['stylesheet']); - - do_action('switch_theme', get_current_theme()); - - header('Location: themes.php?activated=true'); - exit; - } -} - -$title = __('Manage Themes'); -$parent_file = 'themes.php'; -require_once('admin-header.php'); -?> - -<?php if ( ! validate_current_theme() ) : ?> -<div id="message1" class="updated fade"><p><?php _e('The active theme is broken. Reverting to the default theme.'); ?></p></div> -<?php elseif ( isset($_GET['activated']) ) : ?> -<div id="message2" class="updated fade"><p><?php printf(__('New theme activated. <a href="%s">View site »</a>'), get_bloginfo('home') . '/'); ?></p></div> -<?php endif; ?> - -<?php $themes = get_themes(); $ct = current_theme_info(); $allowed_themes = get_site_option( "allowed_themes" ); @@ -51,8 +22,47 @@ while( list( $key, $val ) = each( $themes ) ) { } } reset( $themes ); + +if ( isset($_GET['action']) ) { + check_admin_referer('switch-theme_' . $_GET['template']); + + if ('activate' == $_GET['action']) { + $found = false; + while( list( $key, $details ) = each( $themes ) ) { + if( $details[ 'Template' ] == $_GET['template'] && $details[ 'Stylesheet' ] == $_GET['stylesheet'] ) { + $found = true; + break; + } + } + if( $found == true ) { + if ( isset($_GET['template']) ) + update_option('template', $_GET['template']); + + if ( isset($_GET['stylesheet']) ) + update_option('stylesheet', $_GET['stylesheet']); + + do_action('switch_theme', get_current_theme()); + + wp_redirect('themes.php?activated=true'); + } else { + wp_redirect('themes.php'); + } + exit; + } +} + +$title = __('Manage Themes'); +$parent_file = 'themes.php'; +require_once('admin-header.php'); ?> +<?php if ( ! validate_current_theme() ) : ?> +<div id="message1" class="updated fade"><p><?php _e('The active theme is broken. Reverting to the default theme.'); ?></p></div> +<?php elseif ( isset($_GET['activated']) ) : ?> +<div id="message2" class="updated fade"><p><?php printf(__('New theme activated. <a href="%s">View site »</a>'), get_bloginfo('home') . '/'); ?></p></div> +<?php endif; ?> + + <div class="wrap"> <h2><?php _e('Current Theme'); ?></h2> <div id="currenttheme"> |