<!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>[12769] trunk/wp-admin: add multisite theme admin, See #11644</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12769">12769</a></dd>
<dt>Author</dt> <dd>wpmuguru</dd>
<dt>Date</dt> <dd>2010-01-19 20:03:11 +0000 (Tue, 19 Jan 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>add multisite theme admin, See <a href="http://trac.wordpress.org/ticket/11644">#11644</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesschemaphp">trunk/wp-admin/includes/schema.php</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkwpadminmsthemesphp">trunk/wp-admin/ms-themes.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesschemaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/schema.php (12768 => 12769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/schema.php        2010-01-19 19:45:44 UTC (rev 12768)
+++ trunk/wp-admin/includes/schema.php        2010-01-19 20:03:11 UTC (rev 12769)
</span><span class="lines">@@ -640,9 +640,9 @@
</span><span class="cx">         $template = get_option( 'template' );
</span><span class="cx">         $stylesheet = get_option( 'stylesheet' );
</span><span class="cx">         if ( $template != $stylesheet )
</span><del>-                $allowed_themes = array( $template, $stylesheet );
</del><ins>+                $allowed_themes = array( $template => true, $stylesheet => true );
</ins><span class="cx">         else
</span><del>-                $allowed_themes = array( $stylesheet );
</del><ins>+                $allowed_themes = array( $stylesheet => true );
</ins><span class="cx">
</span><span class="cx">         $wpdb->query( $wpdb->prepare( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, %d, 'site_name', %s)", $network_id, $site_name ) );
</span><span class="cx">         $wpdb->query( $wpdb->prepare( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, %d, 'admin_email', %s)", $network_id, $site_user->user_email ) );
</span></span></pre></div>
<a id="trunkwpadminmsthemesphp"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/ms-themes.php (0 => 12769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-themes.php         (rev 0)
+++ trunk/wp-admin/ms-themes.php        2010-01-19 20:03:11 UTC (rev 12769)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+<?php
+require_once('admin.php');
+
+$title = __('WordPress &rsaquo; Admin &rsaquo; Themes');
+$parent_file = 'ms-admin.php';
+require_once('admin-header.php');
+
+if( is_super_admin() == false ) {
+        wp_die( __('You do not have permission to access this page.') );
+}
+
+if (isset($_GET['updated'])) {
+        ?>
+        <div id="message" class="updated fade"><p><?php _e('Site themes saved.') ?></p></div>
+        <?php
+}
+
+$themes = get_themes();
+$allowed_themes = get_site_allowed_themes();
+?>
+<div class="wrap">
+        <form action='ms-edit.php?action=updatethemes' method='post'>
+                <h2><?php _e('Site Themes') ?></h2>
+                <p><?php _e('Disable themes site-wide. You can enable themes on a site by site basis.') ?></p>
+                <table class="widefat">
+                        <thead>
+                                <tr>
+                                        <th style="width:15%;text-align:center;"><?php _e('Active') ?></th>
+                                        <th style="width:25%;"><?php _e('Theme') ?></th>
+                                        <th style="width:10%;"><?php _e('Version') ?></th>
+                                        <th style="width:60%;"><?php _e('Description') ?></th>
+                                </tr>
+                        </thead>
+                        <tbody id="plugins">
+                        <?php
+                        $total_theme_count = $activated_themes_count = 0;
+                        foreach( (array) $themes as $key => $theme ) {
+                                $total_theme_count++;
+                                $theme_key = wp_specialchars($theme['Stylesheet']);
+                                $class = ('alt' == $class) ? '' : 'alt';
+                                $class1 = $enabled = $disabled = '';
+
+                                if( isset( $allowed_themes[ $theme_key ] ) == true ) {
+                                        $enabled = 'checked="checked" ';
+                                        $activated_themes_count++;
+                                        $class1 = ' active';
+                                } else {
+                                        $disabled = 'checked="checked" ';
+                                }
+                                ?>
+                                <tr valign="top" class="<?php echo $class.$class1; ?>">
+                                        <td style="text-align:center;">
+                                                <label><input name="theme[<?php echo $theme_key ?>]" type="radio" id="enabled_<?php echo $theme_key ?>" value="enabled" <?php echo $enabled ?> /> <?php _e('Yes') ?></label>
+                                                &nbsp;&nbsp;&nbsp;
+                                                <label><input name="theme[<?php echo $theme_key ?>]" type="radio" id="disabled_<?php echo $theme_key ?>" value="disabled" <?php echo $disabled ?> /> <?php _e('No') ?></label>
+                                        </td>
+                                        <th scope="row" style="text-align:left;"><?php echo $key ?></th>
+                                        <td><?php echo $theme['Version'] ?></td>
+                                        <td><?php echo $theme['Description'] ?></td>
+                                </tr>
+                        <?php } ?>
+                        </tbody>
+                </table>
+
+                <p class="submit">
+                        <input type='submit' value='<?php _e('Update Themes &raquo;') ?>' /></p>
+        </form>
+        
+        <h3><?php _e('Total')?></h3>
+        <p>
+                <?php printf(__('Themes Installed: %d'), $total_theme_count); ?>
+                <br />
+                <?php printf(__('Themes Activated: %d'), $activated_themes_count); ?>
+        </p>
+</div>
+
+<?php include('admin-footer.php'); ?>
</ins></span></pre>
</div>
</div>
</body>
</html>