<!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>[12107] trunk/wp-admin: Add subtitles and opening/
closing DIVs on GUU results screen, see #10973</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12107">12107</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2009-10-26 07:04:30 +0000 (Mon, 26 Oct 2009)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add subtitles and opening/closing DIVs on GUU results screen, see <a href="http://trac.wordpress.org/ticket/10973">#10973</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesclasswpupgraderphp">trunk/wp-admin/includes/class-wp-upgrader.php</a></li>
<li><a href="#trunkwpadminupdatecorephp">trunk/wp-admin/update-core.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 (12106 => 12107)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-upgrader.php        2009-10-25 20:54:13 UTC (rev 12106)
+++ trunk/wp-admin/includes/class-wp-upgrader.php        2009-10-26 07:04:30 UTC (rev 12107)
</span><span class="lines">@@ -271,6 +271,7 @@
</span><span class="cx">                                                         'destination' => '', //And this
</span><span class="cx">                                                         'clear_destination' => false,
</span><span class="cx">                                                         'clear_working' => true,
</span><ins>+                                                        'is_multi' => false,
</ins><span class="cx">                                                         'hook_extra' => array() //Pass any extra $hook_extra args here, this will be passed to any hooked filters.
</span><span class="cx">                                                 );
</span><span class="cx">
</span><span class="lines">@@ -287,7 +288,9 @@
</span><span class="cx">                         return $res;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                $this->skin->header();
</del><ins>+                if ( !$is_multi ) // call $this->header separately if running multiple times
+                        $this->skin->header();
+
</ins><span class="cx">                 $this->skin->before();
</span><span class="cx">
</span><span class="cx">                 //Download the package (Note, This just returns the filename of the file if the package is a local file)
</span><span class="lines">@@ -321,7 +324,10 @@
</span><span class="cx">                         $this->skin->feedback('process_success');
</span><span class="cx">                 }
</span><span class="cx">                 $this->skin->after();
</span><del>-                $this->skin->footer();
</del><ins>+
+                if ( !$is_multi )
+                        $this->skin->footer();
+
</ins><span class="cx">                 return $result;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -355,6 +361,7 @@
</span><span class="cx">
</span><span class="cx">         var $result;
</span><span class="cx">         var $bulk = true;
</span><ins>+        var $show_before = '';
</ins><span class="cx">
</span><span class="cx">         function upgrade_strings() {
</span><span class="cx">                 $this->strings['up_to_date'] = __('The plugin is at the latest version.');
</span><span class="lines">@@ -447,7 +454,14 @@
</span><span class="cx">                 add_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade'), 10, 2);
</span><span class="cx">                 add_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'), 10, 4);
</span><span class="cx">
</span><ins>+                $this->skin->header();
+                $all = count($plugins);
+                $i = 1;
</ins><span class="cx">                 foreach ( $plugins as $plugin ) {
</span><ins>+
+                        $this->show_before = sprintf( '<h4>' . __('Updating plugin %d of %d...') . '</h4>', $i, $all );
+                        $i++;
+
</ins><span class="cx">                         if ( !isset( $current->response[ $plugin ] ) ) {
</span><span class="cx">                                 $this->skin->set_result(false);
</span><span class="cx">                                 $this->skin->error('up_to_date');
</span><span class="lines">@@ -466,17 +480,19 @@
</span><span class="cx">                                                 'destination' => WP_PLUGIN_DIR,
</span><span class="cx">                                                 'clear_destination' => true,
</span><span class="cx">                                                 'clear_working' => true,
</span><ins>+                                                'is_multi' => true,
</ins><span class="cx">                                                 'hook_extra' => array(
</span><span class="cx">                                                                         'plugin' => $plugin
</span><span class="cx">                                                 )
</span><span class="cx">                                         ));
</span><del>-                                
</del><ins>+
</ins><span class="cx">                         $results[$plugin] = $this->result;
</span><span class="cx">
</span><span class="cx">                         // Prevent credentials auth screen from displaying multiple times
</span><span class="cx">                         if ( false === $result )
</span><span class="cx">                                 break;
</span><span class="cx">                 }
</span><ins>+                $this->skin->footer();
</ins><span class="cx">
</span><span class="cx">                 //Cleanup our hooks, incase something else does a upgrade on this connection.
</span><span class="cx">                 remove_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade'));
</span><span class="lines">@@ -902,11 +918,11 @@
</span><span class="cx">                         $this->feedback('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array)$update_actions));
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        function footer() {
-                if ( $this->upgrader->bulk )
-                        return;
-
-                echo '</div>';
</del><ins>+        function before() {
+                if ( $this->upgrader->show_before ) {
+                        echo $this->upgrader->show_before;
+                        $this->upgrader->show_before = '';
+                }
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminupdatecorephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/update-core.php (12106 => 12107)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/update-core.php        2009-10-25 20:54:13 UTC (rev 12106)
+++ trunk/wp-admin/update-core.php        2009-10-26 07:04:30 UTC (rev 12107)
</span><span class="lines">@@ -126,10 +126,10 @@
</span><span class="cx">         }
</span><span class="cx">         echo '</ul>';
</span><span class="cx">         dismissed_updates();
</span><del>-        echo '</div>';
</del><span class="cx">
</span><span class="cx">         list_plugin_updates();
</span><span class="cx">         //list_theme_updates();
</span><ins>+        echo '</div>';
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function list_plugin_updates() {
</span></span></pre>
</div>
</div>
</body>
</html>