Huge MS refactoring and code cleanup. see #12460. props ocean90.

git-svn-id: http://svn.automattic.com/wordpress/trunk@13918 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith
2010-04-01 21:21:27 +00:00
parent 5ca84a117e
commit d510d0bdc7
9 changed files with 1305 additions and 1218 deletions

View File

@@ -1,16 +1,16 @@
<?php
require_once('admin.php');
require_once( './admin.php' );
$title = __('Network Themes');
$title = __( 'Network Themes' );
$parent_file = 'ms-admin.php';
require_once('admin-header.php');
require_once( './admin-header.php' );
if ( ! current_user_can( 'manage_network_themes' ) )
wp_die( __('You do not have permission to access this page.') );
wp_die( __( 'You do not have permission to access this page.' ) );
if ( isset($_GET['updated']) ) {
if ( isset( $_GET['updated'] ) ) {
?>
<div id="message" class="updated fade"><p><?php _e('Site themes saved.') ?></p></div>
<div id="message" class="updated fade"><p><?php _e( 'Site themes saved.' ) ?></p></div>
<?php
}
@@ -18,17 +18,17 @@ $themes = get_themes();
$allowed_themes = get_site_allowed_themes();
?>
<div class="wrap">
<form action='ms-edit.php?action=updatethemes' method='post'>
<form action="<?php echo esc_url( admin_url( 'ms-edit.php?action=updatethemes' ) ); ?>" method="post">
<?php screen_icon(); ?>
<h2><?php _e('Network Themes') ?></h2>
<p><?php _e('Disable themes network-wide. You can enable themes on a site by site basis.') ?></p>
<h2><?php _e( 'Network Themes' ) ?></h2>
<p><?php _e( 'Disable themes network-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>
<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">
@@ -37,23 +37,24 @@ $allowed_themes = get_site_allowed_themes();
$class = '';
foreach ( (array) $themes as $key => $theme ) {
$total_theme_count++;
$theme_key = esc_html($theme['Stylesheet']);
$class = ('alt' == $class) ? '' : 'alt';
$theme_key = esc_html( $theme['Stylesheet'] );
$class = ( 'alt' == $class ) ? '' : 'alt';
$class1 = $enabled = $disabled = '';
$enabled = $disabled = false;
if ( isset( $allowed_themes[ $theme_key ] ) == true ) {
$enabled = 'checked="checked" ';
if ( isset( $allowed_themes[$theme_key] ) == true ) {
$enabled = true;
$activated_themes_count++;
$class1 = ' active';
$class1 = 'active';
} else {
$disabled = 'checked="checked" ';
$disabled = true;
}
?>
<tr valign="top" class="<?php echo $class.$class1; ?>">
<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>
<label><input name="theme[<?php echo $theme_key ?>]" type="radio" id="enabled_<?php echo $theme_key ?>" value="enabled" <?php checked( $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>
<label><input name="theme[<?php echo $theme_key ?>]" type="radio" id="disabled_<?php echo $theme_key ?>" value="disabled" <?php checked( $disabled ) ?> /> <?php _e( 'No' ) ?></label>
</td>
<th scope="row" style="text-align:left;"><?php echo $key ?></th>
<td><?php echo $theme['Version'] ?></td>
@@ -64,15 +65,15 @@ $allowed_themes = get_site_allowed_themes();
</table>
<p class="submit">
<input type='submit' value='<?php _e('Update Themes') ?>' /></p>
<input type="submit" value="<?php _e( 'Update Themes' ) ?>" /></p>
</form>
<h3><?php _e('Total')?></h3>
<h3><?php _e( 'Total' )?></h3>
<p>
<?php printf(__('Themes Installed: %d'), $total_theme_count); ?>
<?php printf( __( 'Themes Installed: %d' ), $total_theme_count); ?>
<br />
<?php printf(__('Themes Activated: %d'), $activated_themes_count); ?>
<?php printf( __( 'Themes Activated: %d' ), $activated_themes_count); ?>
</p>
</div>
<?php include('admin-footer.php'); ?>
<?php include( './admin-footer.php' ); ?>