<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[15898] trunk/wp-admin: Network admin theme install.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/15898">15898</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-10-21 17:06:52 +0000 (Thu, 21 Oct 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Network admin theme install. props PeteMall, fixes <a href="http://trac.wordpress.org/ticket/15184">#15184</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesclasswpupgraderphp">trunk/wp-admin/includes/class-wp-upgrader.php</a></li>
<li><a href="#trunkwpadminincludesdefaultlisttablesphp">trunk/wp-admin/includes/default-list-tables.php</a></li>
<li><a href="#trunkwpadminincludesthemeinstallphp">trunk/wp-admin/includes/theme-install.php</a></li>
<li><a href="#trunkwpadminnetworkmenuphp">trunk/wp-admin/network/menu.php</a></li>
<li><a href="#trunkwpadminthemeinstallphp">trunk/wp-admin/theme-install.php</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkwpadminnetworkthemeinstallphp">trunk/wp-admin/network/theme-install.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesclasswpupgraderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-upgrader.php (15897 => 15898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-upgrader.php        2010-10-21 16:28:35 UTC (rev 15897)
+++ trunk/wp-admin/includes/class-wp-upgrader.php        2010-10-21 17:06:52 UTC (rev 15898)
</span><span class="lines">@@ -1358,11 +1358,11 @@
</span><span class="cx">                                                         );
</span><span class="cx">
</span><span class="cx">                 if ( $this->type == 'web' )
</span><del>-                        $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>';
</del><ins>+                        $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>';
</ins><span class="cx">                 else
</span><del>-                        $install_actions['themes_page'] = '<a href="' . admin_url('themes.php') . '" title="' . esc_attr__('Themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>';
</del><ins>+                        $install_actions['themes_page'] = '<a href="' . self_admin_url('themes.php') . '" title="' . esc_attr__('Themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>';
</ins><span class="cx">
</span><del>-                if ( ! $this->result || is_wp_error($this->result) )
</del><ins>+                if ( ! $this->result || is_wp_error($this->result) || is_network_admin() )
</ins><span class="cx">                         unset( $install_actions['activate'], $install_actions['preview'] );
</span><span class="cx">
</span><span class="cx">                 $install_actions = apply_filters('install_theme_complete_actions', $install_actions, $this->api, $stylesheet, $theme_info);
</span></span></pre></div>
<a id="trunkwpadminincludesdefaultlisttablesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/default-list-tables.php (15897 => 15898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/default-list-tables.php        2010-10-21 16:28:35 UTC (rev 15897)
+++ trunk/wp-admin/includes/default-list-tables.php        2010-10-21 17:06:52 UTC (rev 15898)
</span><span class="lines">@@ -4184,7 +4184,7 @@
</span><span class="cx">                 $display_tabs = array();
</span><span class="cx">                 foreach ( (array) $tabs as $action => $text ) {
</span><span class="cx">                         $class = ( $action == $tab ) ? ' class="current"' : '';
</span><del>-                        $href = admin_url('theme-install.php?tab=' . $action);
</del><ins>+                        $href = self_admin_url('theme-install.php?tab=' . $action);
</ins><span class="cx">                         $display_tabs[$action] = "<a href='$href'$class>$text</a>";
</span><span class="cx">                 }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminincludesthemeinstallphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/theme-install.php (15897 => 15898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/theme-install.php        2010-10-21 16:28:35 UTC (rev 15897)
+++ trunk/wp-admin/includes/theme-install.php        2010-10-21 17:06:52 UTC (rev 15898)
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx">         install_theme_search_form();
</span><span class="cx"> ?>
</span><span class="cx"> <h4><?php _e('Feature Filter') ?></h4>
</span><del>-<form method="post" action="<?php echo admin_url( 'theme-install.php?tab=search' ); ?>">
</del><ins>+<form method="post" action="<?php echo self_admin_url( 'theme-install.php?tab=search' ); ?>">
</ins><span class="cx"> <p class="install-help"><?php _e('Find a theme based on specific features') ?></p>
</span><span class="cx">         <?php
</span><span class="cx">         $feature_list = get_theme_feature_list( );
</span><span class="lines">@@ -116,7 +116,7 @@
</span><span class="cx"> ?>
</span><span class="cx"> <h4><?php _e('Install a theme in .zip format') ?></h4>
</span><span class="cx"> <p class="install-help"><?php _e('If you have a theme in a .zip format, you may install it by uploading it here.') ?></p>
</span><del>-<form method="post" enctype="multipart/form-data" action="<?php echo admin_url('update.php?action=upload-theme') ?>">
</del><ins>+<form method="post" enctype="multipart/form-data" action="<?php echo self_admin_url('update.php?action=upload-theme') ?>">
</ins><span class="cx">         <?php wp_nonce_field( 'theme-upload') ?>
</span><span class="cx">         <input type="file" name="themezip" />
</span><span class="cx">         <input type="submit"
</span><span class="lines">@@ -140,9 +140,10 @@
</span><span class="cx">         $preview_link = $theme->preview_url . '?TB_iframe=true&amp;width=600&amp;height=400';
</span><span class="cx">         if ( !is_array($actions) ) {
</span><span class="cx">                 $actions = array();
</span><del>-                $actions[] = '<a href="' . admin_url('theme-install.php?tab=theme-information&amp;theme=' . $theme->slug .
</del><ins>+                $actions[] = '<a href="' . self_admin_url('theme-install.php?tab=theme-information&amp;theme=' . $theme->slug .
</ins><span class="cx">                                                                                 '&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>';
</span><del>-                $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview onclick previewlink" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $name)) . '">' . __('Preview') . '</a>';
</del><ins>+                if ( !is_network_admin() )
+                        $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview onclick previewlink" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $name)) . '">' . __('Preview') . '</a>';
</ins><span class="cx">                 $actions = apply_filters('theme_install_action_links', $actions, $theme);
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -288,12 +289,12 @@
</span><span class="cx"> default:
</span><span class="cx"> case 'install':
</span><span class="cx">         if ( current_user_can('install_themes') ) :
</span><del>-        $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>';
</del><ins>+        $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>';
</ins><span class="cx">         endif;
</span><span class="cx">         break;
</span><span class="cx"> case 'update_available':
</span><span class="cx">         if ( current_user_can('update_themes') ) :
</span><del>-        $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>';
</del><ins>+        $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>';
</ins><span class="cx">         endif;
</span><span class="cx">         break;
</span><span class="cx"> case 'newer_installed':
</span></span></pre></div>
<a id="trunkwpadminnetworkmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/network/menu.php (15897 => 15898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/menu.php        2010-10-21 16:28:35 UTC (rev 15897)
+++ trunk/wp-admin/network/menu.php        2010-10-21 17:06:52 UTC (rev 15898)
</span><span class="lines">@@ -19,7 +19,11 @@
</span><span class="cx"> $submenu['sites.php'][10] = array( __('Add New'), 'manage_sites', 'site-new.php' );
</span><span class="cx">
</span><span class="cx"> $menu[10] = array(__('Users'), 'manage_network_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'div');
</span><ins>+
</ins><span class="cx"> $menu[15] = array(__('Themes'), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div');
</span><ins>+$submenu['themes.php'][5] = array( __('Themes'), 'manage_network_themes', 'themes.php' );
+$submenu['themes.php'][10] = array( _x('Add New', 'theme'), 'manage_network_themes', 'theme-install.php' );
+$submenu['themes.php'][15] = array( _x('Editor', 'theme editor'), 'edit_themes', 'theme-editor.php' );
</ins><span class="cx">
</span><span class="cx"> $plugin_update_count = $theme_update_count = $wordpress_update_count = 0;
</span><span class="cx"> $update_plugins = get_site_transient( 'update_plugins' );
</span><span class="lines">@@ -59,9 +63,6 @@
</span><span class="cx">
</span><span class="cx"> $menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator-last' );
</span><span class="cx">
</span><del>-$submenu['themes.php'][5] = array( __('Themes'), 'manage_network_themes', 'themes.php' );
-$submenu['themes.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_themes', 'theme-editor.php' );
-
</del><span class="cx"> require_once(ABSPATH . 'wp-admin/includes/menu.php');
</span><span class="cx">
</span><span class="cx"> ?>
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminnetworkthemeinstallphp"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/network/theme-install.php (0 => 15898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/theme-install.php         (rev 0)
+++ trunk/wp-admin/network/theme-install.php        2010-10-21 17:06:52 UTC (rev 15898)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+<?php
+/**
+ * Install theme network administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+require_once( './admin.php' );
+
+require( '../theme-install.php' );
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminthemeinstallphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/theme-install.php (15897 => 15898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/theme-install.php        2010-10-21 16:28:35 UTC (rev 15897)
+++ trunk/wp-admin/theme-install.php        2010-10-21 17:06:52 UTC (rev 15898)
</span><span class="lines">@@ -15,7 +15,8 @@
</span><span class="cx">
</span><span class="cx"> $title = __('Install Themes');
</span><span class="cx"> $parent_file = 'themes.php';
</span><del>-$submenu_file = 'themes.php';
</del><ins>+if ( !is_network_admin() )
+        $submenu_file = 'themes.php';
</ins><span class="cx">
</span><span class="cx"> wp_enqueue_style( 'theme-install' );
</span><span class="cx"> wp_enqueue_script( 'theme-install' );
</span><span class="lines">@@ -35,17 +36,25 @@
</span><span class="cx"> $help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>';
</span><span class="cx"> add_contextual_help($current_screen, $help);
</span><span class="cx">
</span><del>-include('./admin-header.php');
</del><ins>+include(ABSPATH . 'wp-admin/admin-header.php');
</ins><span class="cx"> ?>
</span><span class="cx"> <div class="wrap">
</span><del>-<?php screen_icon(); ?>
</del><ins>+<?php
+screen_icon();
+
+if ( is_network_admin() ) : ?>
+<h2><?php echo esc_html( $title ); ?></h2>
+<?php else : ?>
</ins><span class="cx"> <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>
</span><span class="cx">
</span><del>-<?php $wp_list_table->views(); ?>
</del><ins>+<?php
+endif;
</ins><span class="cx">
</span><ins>+$wp_list_table->views(); ?>
+
</ins><span class="cx"> <br class="clear" />
</span><span class="cx"> <?php do_action('install_themes_' . $tab, $paged); ?>
</span><span class="cx"> </div>
</span><span class="cx"> <?php
</span><del>-include('./admin-footer.php');
</del><ins>+include(ABSPATH . 'wp-admin/admin-footer.php');
</ins><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>