Make WordPress Core

Ticket #15184: 15184.diff

File 15184.diff, 8.5 KB (added by PeteMall, 15 years ago)
  • wp-admin/includes/default-list-tables.php

     
    41844184                $display_tabs = array();
    41854185                foreach ( (array) $tabs as $action => $text ) {
    41864186                        $class = ( $action == $tab ) ? ' class="current"' : '';
    4187                         $href = admin_url('theme-install.php?tab=' . $action);
     4187                        $href = self_admin_url('theme-install.php?tab=' . $action);
    41884188                        $display_tabs[$action] = "<a href='$href'$class>$text</a>";
    41894189                }
    41904190
  • wp-admin/includes/class-wp-upgrader.php

     
    13581358                                                        );
    13591359
    13601360                if ( $this->type == 'web' )
    1361                         $install_actions['themes_page'] = '<a href="' . admin_url('theme-install.php') . '" title="' . esc_attr__('Return to Theme Installer') . '" target="_parent">' . __('Return to Theme Installer') . '</a>';
     1361                        $install_actions['themes_page'] = '<a href="' . self_admin_url('theme-install.php') . '" title="' . esc_attr__('Return to Theme Installer') . '" target="_parent">' . __('Return to Theme Installer') . '</a>';
    13621362                else
    1363                         $install_actions['themes_page'] = '<a href="' . admin_url('themes.php') . '" title="' . esc_attr__('Themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>';
     1363                        $install_actions['themes_page'] = '<a href="' . self_admin_url('themes.php') . '" title="' . esc_attr__('Themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>';
    13641364
    1365                 if ( ! $this->result || is_wp_error($this->result) )
     1365                if ( ! $this->result || is_wp_error($this->result) || is_network_admin() )
    13661366                        unset( $install_actions['activate'], $install_actions['preview'] );
    13671367
    13681368                $install_actions = apply_filters('install_theme_complete_actions', $install_actions, $this->api, $stylesheet, $theme_info);
  • wp-admin/includes/theme-install.php

     
    7777        install_theme_search_form();
    7878?>
    7979<h4><?php _e('Feature Filter') ?></h4>
    80 <form method="post" action="<?php echo admin_url( 'theme-install.php?tab=search' ); ?>">
     80<form method="post" action="<?php echo self_admin_url( 'theme-install.php?tab=search' ); ?>">
    8181<p class="install-help"><?php _e('Find a theme based on specific features') ?></p>
    8282        <?php
    8383        $feature_list = get_theme_feature_list( );
     
    116116?>
    117117<h4><?php _e('Install a theme in .zip format') ?></h4>
    118118<p class="install-help"><?php _e('If you have a theme in a .zip format, you may install it by uploading it here.') ?></p>
    119 <form method="post" enctype="multipart/form-data" action="<?php echo admin_url('update.php?action=upload-theme') ?>">
     119<form method="post" enctype="multipart/form-data" action="<?php echo self_admin_url('update.php?action=upload-theme') ?>">
    120120        <?php wp_nonce_field( 'theme-upload') ?>
    121121        <input type="file" name="themezip" />
    122122        <input type="submit"
     
    140140        $preview_link = $theme->preview_url . '?TB_iframe=true&amp;width=600&amp;height=400';
    141141        if ( !is_array($actions) ) {
    142142                $actions = array();
    143                 $actions[] = '<a href="' . admin_url('theme-install.php?tab=theme-information&amp;theme=' . $theme->slug .
     143                $actions[] = '<a href="' . self_admin_url('theme-install.php?tab=theme-information&amp;theme=' . $theme->slug .
    144144                                                                                '&amp;TB_iframe=true&amp;tbWidth=500&amp;tbHeight=385') . '" class="thickbox thickbox-preview onclick" title="' . esc_attr(sprintf(__('Install &#8220;%s&#8221;'), $name)) . '">' . __('Install') . '</a>';
    145                 $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview onclick previewlink" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $name)) . '">' . __('Preview') . '</a>';
     145                if ( !is_network_admin() )
     146                        $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview onclick previewlink" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $name)) . '">' . __('Preview') . '</a>';
    146147                $actions = apply_filters('theme_install_action_links', $actions, $theme);
    147148        }
    148149
     
    288289default:
    289290case 'install':
    290291        if ( current_user_can('install_themes') ) :
    291         $buttons .= '<a class="button-primary" id="install" href="' . wp_nonce_url(admin_url('update.php?action=install-theme&theme=' . $api->slug), 'install-theme_' . $api->slug) . '" target="_parent">' . __('Install Now') . '</a>';
     292        $buttons .= '<a class="button-primary" id="install" href="' . wp_nonce_url(self_admin_url('update.php?action=install-theme&theme=' . $api->slug), 'install-theme_' . $api->slug) . '" target="_parent">' . __('Install Now') . '</a>';
    292293        endif;
    293294        break;
    294295case 'update_available':
    295296        if ( current_user_can('update_themes') ) :
    296         $buttons .= '<a class="button-primary" id="install"     href="' . wp_nonce_url(admin_url('update.php?action=upgrade-theme&theme=' . $update_file), 'upgrade-theme_' . $update_file) . '" target="_parent">' . __('Install Update Now') . '</a>';
     297        $buttons .= '<a class="button-primary" id="install"     href="' . wp_nonce_url(self_admin_url('update.php?action=upgrade-theme&theme=' . $update_file), 'upgrade-theme_' . $update_file) . '" target="_parent">' . __('Install Update Now') . '</a>';
    297298        endif;
    298299        break;
    299300case 'newer_installed':
  • wp-admin/network/menu.php

     
    1919$submenu['sites.php'][10]  = array( __('Add New'), 'manage_sites', 'site-new.php' );
    2020
    2121$menu[10] = array(__('Users'), 'manage_network_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'div');
     22
    2223$menu[15] = array(__('Themes'), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div');
     24$submenu['themes.php'][5]  = array( __('Themes'), 'manage_network_themes', 'themes.php' );
     25$submenu['themes.php'][10] = array( _x('Add New', 'theme'), 'manage_network_themes', 'theme-install.php' );
     26$submenu['themes.php'][15] = array( _x('Editor', 'theme editor'), 'edit_themes', 'theme-editor.php' );
    2327
    2428$plugin_update_count = $theme_update_count = $wordpress_update_count = 0;
    2529$update_plugins = get_site_transient( 'update_plugins' );
     
    5963
    6064$menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator-last' );
    6165
    62 $submenu['themes.php'][5]  = array( __('Themes'), 'manage_network_themes', 'themes.php' );
    63 $submenu['themes.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_themes', 'theme-editor.php' );
    64 
    6566require_once(ABSPATH . 'wp-admin/includes/menu.php');
    6667
    6768?>
    68  No newline at end of file
  • wp-admin/network/theme-install.php

     
     1<?php
     2/**
     3 * Install theme network administration panel.
     4 *
     5 * @package WordPress
     6 * @subpackage Administration
     7 * @since 3.1.0
     8 */
     9
     10require_once( './admin.php' );
     11
     12require( '../theme-install.php' );
     13 No newline at end of file
  • wp-admin/theme-install.php

     
    1515
    1616$title = __('Install Themes');
    1717$parent_file = 'themes.php';
    18 $submenu_file = 'themes.php';
     18if ( !is_network_admin() )
     19        $submenu_file = 'themes.php';
    1920
    2021wp_enqueue_style( 'theme-install' );
    2122wp_enqueue_script( 'theme-install' );
     
    3536$help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>';
    3637add_contextual_help($current_screen, $help);
    3738
    38 include('./admin-header.php');
     39include(ABSPATH . 'wp-admin/admin-header.php');
    3940?>
    4041<div class="wrap">
    41 <?php screen_icon(); ?>
     42<?php
     43screen_icon();
     44
     45if ( is_network_admin() ) : ?>
     46<h2><?php echo esc_html( $title ); ?></h2>
     47<?php else : ?>
    4248<h2><a href="themes.php" class="nav-tab"><?php echo esc_html_x('Manage Themes', 'theme'); ?></a><a href="theme-install.php" class="nav-tab nav-tab-active"><?php echo esc_html( $title ); ?></a></h2>
    4349
    44 <?php $wp_list_table->views(); ?>
     50<?php
     51endif;
    4552
     53$wp_list_table->views(); ?>
     54
    4655<br class="clear" />
    4756<?php do_action('install_themes_' . $tab, $paged); ?>
    4857</div>
    4958<?php
    50 include('./admin-footer.php');
     59include(ABSPATH . 'wp-admin/admin-footer.php');
    5160