<!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>[12904] trunk/wp-admin: Move 'My Blogs' into its own file.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12904">12904</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-01-29 23:21:01 +0000 (Fri, 29 Jan 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move 'My Blogs' into its own file. see <a href="http://trac.wordpress.org/ticket/11644">#11644</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesmsphp">trunk/wp-admin/includes/ms.php</a></li>
<li><a href="#trunkwpadminmenuphp">trunk/wp-admin/menu.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesmsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/ms.php (12903 => 12904)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/ms.php        2010-01-29 21:45:32 UTC (rev 12903)
+++ trunk/wp-admin/includes/ms.php        2010-01-29 23:21:01 UTC (rev 12904)
</span><span class="lines">@@ -660,20 +660,6 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'admin_notices', 'secret_salt_warning' );
</span><span class="cx"> 
</span><del>-function profile_update_primary_blog() {
-        global $current_user;
-
-        $blogs = get_blogs_of_user( $current_user-&gt;id );
-        if ( isset( $blogs[ $_POST[ 'primary_blog' ] ] ) == false ) {
-                return false;
-        }
-
-        if ( isset( $_POST['primary_blog'] ) ) {
-                update_user_option( $current_user-&gt;id, 'primary_blog', (int) $_POST['primary_blog'], true );
-        }
-}
-add_action ( 'myblogs_update', 'profile_update_primary_blog' );
-
</del><span class="cx"> function admin_notice_feed() {
</span><span class="cx">         global $current_user;
</span><span class="cx">         if ( substr( $_SERVER[ 'PHP_SELF' ], -19 ) != '/wp-admin/index.php' )
</span><span class="lines">@@ -815,101 +801,11 @@
</span><span class="cx">         &lt;/table&gt;
</span><span class="cx">         &lt;?php
</span><span class="cx"> }
</span><del>-add_action ( 'myblogs_allblogs_options', 'choose_primary_blog' );
</del><span class="cx"> 
</span><span class="cx"> if ( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) ) {
</span><span class="cx">         add_action( 'admin_init', 'update_profile_email' );
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function blogs_listing_post() {
-        if ( !isset( $_POST[ 'action' ] ) ) {
-                return false;
-        }
-        switch( $_POST[ 'action' ] ) {
-                case &quot;updateblogsettings&quot;:
-                        do_action( 'myblogs_update' );
-                wp_redirect( admin_url( 'index.php?page=myblogs&amp;updated=1' ) );
-                die();
-                break;
-        }
-}
-add_action( 'admin_init', 'blogs_listing_post' );
-
-function blogs_listing() {
-        global $current_user;
-
-        $blogs = get_blogs_of_user( $current_user-&gt;ID );
-        if ( !$blogs || ( is_array( $blogs ) &amp;&amp; empty( $blogs ) ) ) {
-                wp_die( __( 'You must be a member of at least one blog to use this page.' ) );
-        }
-
-        if ( empty($title) )
-                $title = apply_filters( 'my_blogs_title', __( 'My Blogs' ) );
-        ?&gt;
-        &lt;div class=&quot;wrap&quot;&gt;
-        &lt;?php if ( $_GET[ 'updated' ] ) { ?&gt;
-                &lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;strong&gt;&lt;?php _e( 'Your blog options have been updated.' ); ?&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;
-        &lt;?php } ?&gt;
-        &lt;?php screen_icon(); ?&gt;
-        &lt;h2&gt;&lt;?php echo wp_specialchars( $title ); ?&gt;&lt;/h2&gt;
-        &lt;form id=&quot;myblogs&quot; action=&quot;&quot; method=&quot;post&quot;&gt;
-        &lt;?php
-        do_action( 'myblogs_allblogs_options' );
-        ?&gt;&lt;table class='widefat'&gt; &lt;?php
-        $settings_html = apply_filters( 'myblogs_options', '', 'global' );
-        if ( $settings_html != '' ) {
-                echo &quot;&lt;tr&gt;&lt;td valign='top'&gt;&lt;h3&gt;&quot; . __( 'Global Settings' ) . &quot;&lt;/h3&gt;&lt;/td&gt;&lt;td&gt;&quot;;
-                echo $settings_html;
-                echo &quot;&lt;/td&gt;&lt;/tr&gt;&quot;;
-        }
-        reset( $blogs );
-        $num = count( $blogs );
-        $cols = 1;
-        if ( $num &gt;= 20 ) {
-                $cols = 4;
-        } elseif ( $num &gt;= 10 ) {
-                $cols = 2;
-        }
-        $num_rows = ceil($num/$cols);
-        $split = 0;
-        for( $i = 1; $i &lt;= $num_rows; $i++ ) {
-                $rows[] = array_slice( $blogs, $split, $cols );
-                $split = $split + $cols;
-        }
-
-        foreach( $rows as $row ) {
-                $c = $c == &quot;alternate&quot; ? &quot;&quot; : &quot;alternate&quot;;
-                echo &quot;&lt;tr class='$c'&gt;&quot;;
-                foreach( $row as $user_blog ) {
-                        $t = $t == &quot;border-right: 1px solid #ccc;&quot; ? &quot;&quot; : &quot;border-right: 1px solid #ccc;&quot;;
-                        echo &quot;&lt;td valign='top' style='$t; width:50%'&gt;&quot;;
-                        echo &quot;&lt;h3&gt;{$user_blog-&gt;blogname}&lt;/h3&gt;&quot;;
-                        echo &quot;&lt;p&gt;&quot; . apply_filters( &quot;myblogs_blog_actions&quot;, &quot;&lt;a href='{$user_blog-&gt;siteurl}'&gt;&quot; . __( 'Visit' ) . &quot;&lt;/a&gt; | &lt;a href='{$user_blog-&gt;siteurl}/wp-admin/'&gt;&quot; . __( 'Dashboard' ) . &quot;&lt;/a&gt;&quot;, $user_blog ) . &quot;&lt;/p&gt;&quot;;
-                        echo apply_filters( 'myblogs_options', '', $user_blog );
-                        echo &quot;&lt;/td&gt;&quot;;
-                }
-                echo &quot;&lt;/tr&gt;&quot;;
-        }?&gt;
-        &lt;/table&gt;
-        &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;updateblogsettings&quot; /&gt;
-        &lt;p&gt;
-         &lt;input type=&quot;submit&quot; class=&quot;button-primary&quot; value=&quot;&lt;?php _e('Update Options') ?&gt;&quot; name=&quot;submit&quot; /&gt;
-        &lt;/p&gt;
-        &lt;/form&gt;
-        &lt;/div&gt;
-        &lt;?php
-}
-
-function blogs_page_init() {
-        global $current_user;
-        $all_blogs = get_blogs_of_user( $current_user-&gt;ID );
-        if ( $all_blogs != false &amp;&amp; !empty( $all_blogs ) ) {
-                $title = apply_filters( 'my_blogs_title', __( 'My Blogs' ) );
-                add_submenu_page( 'index.php', $title, $title, 'read', 'myblogs', 'blogs_listing' );
-        }
-}
-add_action('admin_menu', 'blogs_page_init');
-
</del><span class="cx"> function stripslashes_from_options( $blog_id ) {
</span><span class="cx">         global $wpdb;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/menu.php (12903 => 12904)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/menu.php        2010-01-29 21:45:32 UTC (rev 12903)
+++ trunk/wp-admin/menu.php        2010-01-29 23:21:01 UTC (rev 12904)
</span><span class="lines">@@ -26,6 +26,10 @@
</span><span class="cx"> $awaiting_mod = $awaiting_mod-&gt;moderated;
</span><span class="cx"> 
</span><span class="cx"> $menu[0] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top', 'menu-dashboard', 'div' );
</span><ins>+if ( is_multisite() ) {
+        $submenu[ 'index.php' ][0] = array( __('Dashboard'), 'read', 'index.php' );
+        $submenu[ 'index.php' ][5] = array( __('My Sites'), 'read', 'my-sites.php' );
+}
</ins><span class="cx"> 
</span><span class="cx"> if ( is_multisite() &amp;&amp; is_super_admin() ) {
</span><span class="cx">         $menu[1] = array( '', 'read', 'separator0', '', 'wp-menu-separator' );
</span></span></pre>
</div>
</div>

</body>
</html>