]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/themes.php
WordPress 3.7.1
[autoinstalls/wordpress.git] / wp-admin / themes.php
index 14ed887da02a8dade8cae4d6de153df928fb70af..edb0cad96f3b17929cae100760db6e9a9559d6ca 100644 (file)
@@ -7,13 +7,15 @@
  */
 
 /** WordPress Administration Bootstrap */
-require_once('./admin.php');
+require_once( dirname( __FILE__ ) . '/admin.php' );
 
 if ( !current_user_can('switch_themes') && !current_user_can('edit_theme_options') )
        wp_die( __( 'Cheatin’ uh?' ) );
 
 $wp_list_table = _get_list_table('WP_Themes_List_Table');
 
+$_SERVER['REQUEST_URI'] = remove_query_arg( array( 's', 'features', '_ajax_fetch_list_nonce', '_wp_http_referer', 'paged' ), $_SERVER['REQUEST_URI'] );
+
 if ( current_user_can( 'switch_themes' ) && isset($_GET['action'] ) ) {
        if ( 'activate' == $_GET['action'] ) {
                check_admin_referer('switch-theme_' . $_GET['stylesheet']);
@@ -91,7 +93,7 @@ get_current_screen()->set_help_sidebar(
 wp_enqueue_script( 'theme' );
 wp_enqueue_script( 'customize-loader' );
 
-require_once('./admin-header.php');
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
 ?>
 
 <div class="wrap"><?php
@@ -139,6 +141,15 @@ $customize_title = sprintf( __( 'Customize &#8220;%s&#8221;' ), $ct->display('Na
                <?php echo $ct->display('Name'); ?>
        </h4>
 
+<?php
+if ( $ct->errors() && ( ! is_multisite() || current_user_can( 'manage_network_themes' ) ) ) {
+       echo '<p class="error-message">' . sprintf( __( 'ERROR: %s' ), $ct->errors()->get_error_message() ) . '</p>';
+}
+
+// Certain error codes are less fatal than others. We can still display theme information in most cases.
+if ( ! $ct->errors() || ( 1 == count( $ct->errors()->get_error_codes() )
+       && in_array( $ct->errors()->get_error_code(), array( 'theme_no_parent', 'theme_parent_invalid', 'theme_no_index' ) ) ) ) : ?>
+
        <div>
                <ul class="theme-info">
                        <li><?php printf( __('By %s'), $ct->display('Author') ); ?></li>
@@ -207,13 +218,15 @@ $customize_title = sprintf( __( 'Customize &#8220;%s&#8221;' ), $ct->display('Na
        endif; // options || edit_theme_options
        ?>
 
+<?php endif; // theme errors ?>
+
 </div>
 
 <br class="clear" />
 <?php
 if ( ! current_user_can( 'switch_themes' ) ) {
        echo '</div>';
-       require( './admin-footer.php' );
+       require( ABSPATH . 'wp-admin/admin-footer.php' );
        exit;
 }
 ?>
@@ -292,11 +305,9 @@ if ( ! is_multisite() && current_user_can('edit_themes') && $broken_themes = wp_
                <th><?php _e('Description'); ?></th>
        </tr>
 <?php
-       $alt = '';
        foreach ( $broken_themes as $broken_theme ) {
-               $alt = ('class="alternate"' == $alt) ? '' : 'class="alternate"';
                echo "
-               <tr $alt>
+               <tr>
                         <td>" . $broken_theme->get('Name') ."</td>
                         <td>" . $broken_theme->errors()->get_error_message() . "</td>
                </tr>";
@@ -308,4 +319,4 @@ if ( ! is_multisite() && current_user_can('edit_themes') && $broken_themes = wp_
 ?>
 </div>
 
-<?php require('./admin-footer.php'); ?>
+<?php require( ABSPATH . 'wp-admin/admin-footer.php' ); ?>