<!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-&gt;type == 'web' )
</span><del>-                        $install_actions['themes_page'] = '&lt;a href=&quot;' . admin_url('theme-install.php') . '&quot; title=&quot;' . esc_attr__('Return to Theme Installer') . '&quot; target=&quot;_parent&quot;&gt;' . __('Return to Theme Installer') . '&lt;/a&gt;';
</del><ins>+                        $install_actions['themes_page'] = '&lt;a href=&quot;' . self_admin_url('theme-install.php') . '&quot; title=&quot;' . esc_attr__('Return to Theme Installer') . '&quot; target=&quot;_parent&quot;&gt;' . __('Return to Theme Installer') . '&lt;/a&gt;';
</ins><span class="cx">                 else
</span><del>-                        $install_actions['themes_page'] = '&lt;a href=&quot;' . admin_url('themes.php') . '&quot; title=&quot;' . esc_attr__('Themes page') . '&quot; target=&quot;_parent&quot;&gt;' . __('Return to Themes page') . '&lt;/a&gt;';
</del><ins>+                        $install_actions['themes_page'] = '&lt;a href=&quot;' . self_admin_url('themes.php') . '&quot; title=&quot;' . esc_attr__('Themes page') . '&quot; target=&quot;_parent&quot;&gt;' . __('Return to Themes page') . '&lt;/a&gt;';
</ins><span class="cx"> 
</span><del>-                if ( ! $this-&gt;result || is_wp_error($this-&gt;result) )
</del><ins>+                if ( ! $this-&gt;result || is_wp_error($this-&gt;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-&gt;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 =&gt; $text ) {
</span><span class="cx">                         $class = ( $action == $tab ) ? ' class=&quot;current&quot;' : '';
</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] = &quot;&lt;a href='$href'$class&gt;$text&lt;/a&gt;&quot;;
</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"> ?&gt;
</span><span class="cx"> &lt;h4&gt;&lt;?php _e('Feature Filter') ?&gt;&lt;/h4&gt;
</span><del>-&lt;form method=&quot;post&quot; action=&quot;&lt;?php echo admin_url( 'theme-install.php?tab=search' ); ?&gt;&quot;&gt;
</del><ins>+&lt;form method=&quot;post&quot; action=&quot;&lt;?php echo self_admin_url( 'theme-install.php?tab=search' ); ?&gt;&quot;&gt;
</ins><span class="cx"> &lt;p class=&quot;install-help&quot;&gt;&lt;?php _e('Find a theme based on specific features') ?&gt;&lt;/p&gt;
</span><span class="cx">         &lt;?php
</span><span class="cx">         $feature_list = get_theme_feature_list( );
</span><span class="lines">@@ -116,7 +116,7 @@
</span><span class="cx"> ?&gt;
</span><span class="cx"> &lt;h4&gt;&lt;?php _e('Install a theme in .zip format') ?&gt;&lt;/h4&gt;
</span><span class="cx"> &lt;p class=&quot;install-help&quot;&gt;&lt;?php _e('If you have a theme in a .zip format, you may install it by uploading it here.') ?&gt;&lt;/p&gt;
</span><del>-&lt;form method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; action=&quot;&lt;?php echo admin_url('update.php?action=upload-theme') ?&gt;&quot;&gt;
</del><ins>+&lt;form method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; action=&quot;&lt;?php echo self_admin_url('update.php?action=upload-theme') ?&gt;&quot;&gt;
</ins><span class="cx">         &lt;?php wp_nonce_field( 'theme-upload') ?&gt;
</span><span class="cx">         &lt;input type=&quot;file&quot; name=&quot;themezip&quot; /&gt;
</span><span class="cx">         &lt;input type=&quot;submit&quot;
</span><span class="lines">@@ -140,9 +140,10 @@
</span><span class="cx">         $preview_link = $theme-&gt;preview_url . '?TB_iframe=true&amp;amp;width=600&amp;amp;height=400';
</span><span class="cx">         if ( !is_array($actions) ) {
</span><span class="cx">                 $actions = array();
</span><del>-                $actions[] = '&lt;a href=&quot;' . admin_url('theme-install.php?tab=theme-information&amp;amp;theme=' . $theme-&gt;slug .
</del><ins>+                $actions[] = '&lt;a href=&quot;' . self_admin_url('theme-install.php?tab=theme-information&amp;amp;theme=' . $theme-&gt;slug .
</ins><span class="cx">                                                                                 '&amp;amp;TB_iframe=true&amp;amp;tbWidth=500&amp;amp;tbHeight=385') . '&quot; class=&quot;thickbox thickbox-preview onclick&quot; title=&quot;' . esc_attr(sprintf(__('Install &amp;#8220;%s&amp;#8221;'), $name)) . '&quot;&gt;' . __('Install') . '&lt;/a&gt;';
</span><del>-                $actions[] = '&lt;a href=&quot;' . $preview_link . '&quot; class=&quot;thickbox thickbox-preview onclick previewlink&quot; title=&quot;' . esc_attr(sprintf(__('Preview &amp;#8220;%s&amp;#8221;'), $name)) . '&quot;&gt;' . __('Preview') . '&lt;/a&gt;';
</del><ins>+                if ( !is_network_admin() )
+                        $actions[] = '&lt;a href=&quot;' . $preview_link . '&quot; class=&quot;thickbox thickbox-preview onclick previewlink&quot; title=&quot;' . esc_attr(sprintf(__('Preview &amp;#8220;%s&amp;#8221;'), $name)) . '&quot;&gt;' . __('Preview') . '&lt;/a&gt;';
</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 .= '&lt;a class=&quot;button-primary&quot; id=&quot;install&quot; href=&quot;' . wp_nonce_url(admin_url('update.php?action=install-theme&amp;theme=' . $api-&gt;slug), 'install-theme_' . $api-&gt;slug) . '&quot; target=&quot;_parent&quot;&gt;' . __('Install Now') . '&lt;/a&gt;';
</del><ins>+        $buttons .= '&lt;a class=&quot;button-primary&quot; id=&quot;install&quot; href=&quot;' . wp_nonce_url(self_admin_url('update.php?action=install-theme&amp;theme=' . $api-&gt;slug), 'install-theme_' . $api-&gt;slug) . '&quot; target=&quot;_parent&quot;&gt;' . __('Install Now') . '&lt;/a&gt;';
</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 .= '&lt;a class=&quot;button-primary&quot; id=&quot;install&quot;        href=&quot;' . wp_nonce_url(admin_url('update.php?action=upgrade-theme&amp;theme=' . $update_file), 'upgrade-theme_' . $update_file) . '&quot; target=&quot;_parent&quot;&gt;' . __('Install Update Now') . '&lt;/a&gt;';
</del><ins>+        $buttons .= '&lt;a class=&quot;button-primary&quot; id=&quot;install&quot;        href=&quot;' . wp_nonce_url(self_admin_url('update.php?action=upgrade-theme&amp;theme=' . $update_file), 'upgrade-theme_' . $update_file) . '&quot; target=&quot;_parent&quot;&gt;' . __('Install Update Now') . '&lt;/a&gt;';
</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"> ?&gt;
</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>+&lt;?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 .= '&lt;p&gt;' . __('&lt;a href=&quot;http://wordpress.org/support/&quot; target=&quot;_blank&quot;&gt;Support Forums&lt;/a&gt;') . '&lt;/p&gt;';
</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"> ?&gt;
</span><span class="cx"> &lt;div class=&quot;wrap&quot;&gt;
</span><del>-&lt;?php screen_icon(); ?&gt;
</del><ins>+&lt;?php
+screen_icon(); 
+
+if ( is_network_admin() ) : ?&gt;
+&lt;h2&gt;&lt;?php echo esc_html( $title ); ?&gt;&lt;/h2&gt;
+&lt;?php else : ?&gt;
</ins><span class="cx"> &lt;h2&gt;&lt;a href=&quot;themes.php&quot; class=&quot;nav-tab&quot;&gt;&lt;?php echo esc_html_x('Manage Themes', 'theme'); ?&gt;&lt;/a&gt;&lt;a href=&quot;theme-install.php&quot; class=&quot;nav-tab nav-tab-active&quot;&gt;&lt;?php echo esc_html( $title ); ?&gt;&lt;/a&gt;&lt;/h2&gt;
</span><span class="cx"> 
</span><del>-&lt;?php $wp_list_table-&gt;views(); ?&gt;
</del><ins>+&lt;?php 
+endif;
</ins><span class="cx"> 
</span><ins>+$wp_list_table-&gt;views(); ?&gt;
+
</ins><span class="cx"> &lt;br class=&quot;clear&quot; /&gt;
</span><span class="cx"> &lt;?php do_action('install_themes_' . $tab, $paged); ?&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> &lt;?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>