WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/01/2010 09:21:27 PM (10 years ago)
Author:
markjaquith
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/ms-themes.php

    r13771 r13918  
    11<?php
    2 require_once('admin.php');
     2require_once( './admin.php' );
    33
    4 $title = __('Network Themes');
     4$title = __( 'Network Themes' );
    55$parent_file = 'ms-admin.php';
    6 require_once('admin-header.php');
     6require_once( './admin-header.php' );
    77
    88if ( ! current_user_can( 'manage_network_themes' ) )
    9     wp_die( __('You do not have permission to access this page.') );
     9    wp_die( __( 'You do not have permission to access this page.' ) );
    1010
    11 if ( isset($_GET['updated']) ) {
     11if ( isset( $_GET['updated'] ) ) {
    1212    ?>
    13     <div id="message" class="updated fade"><p><?php _e('Site themes saved.') ?></p></div>
     13    <div id="message" class="updated fade"><p><?php _e( 'Site themes saved.' ) ?></p></div>
    1414    <?php
    1515}
     
    1919?>
    2020<div class="wrap">
    21     <form action='ms-edit.php?action=updatethemes' method='post'>
     21    <form action="<?php echo esc_url( admin_url( 'ms-edit.php?action=updatethemes' ) ); ?>" method="post">
    2222        <?php screen_icon(); ?>
    23         <h2><?php _e('Network Themes') ?></h2>
    24         <p><?php _e('Disable themes network-wide. You can enable themes on a site by site basis.') ?></p>
     23        <h2><?php _e( 'Network Themes' ) ?></h2>
     24        <p><?php _e( 'Disable themes network-wide. You can enable themes on a site by site basis.' ) ?></p>
    2525        <table class="widefat">
    2626            <thead>
    2727                <tr>
    28                     <th style="width:15%;text-align:center;"><?php _e('Active') ?></th>
    29                     <th style="width:25%;"><?php _e('Theme') ?></th>
    30                     <th style="width:10%;"><?php _e('Version') ?></th>
    31                     <th style="width:60%;"><?php _e('Description') ?></th>
     28                    <th style="width:15%;text-align:center;"><?php _e( 'Active' ) ?></th>
     29                    <th style="width:25%;"><?php _e( 'Theme' ) ?></th>
     30                    <th style="width:10%;"><?php _e( 'Version' ) ?></th>
     31                    <th style="width:60%;"><?php _e( 'Description' ) ?></th>
    3232                </tr>
    3333            </thead>
     
    3838            foreach ( (array) $themes as $key => $theme ) {
    3939                $total_theme_count++;
    40                 $theme_key = esc_html($theme['Stylesheet']);
    41                 $class = ('alt' == $class) ? '' : 'alt';
     40                $theme_key = esc_html( $theme['Stylesheet'] );
     41                $class = ( 'alt' == $class ) ? '' : 'alt';
    4242                $class1 = $enabled = $disabled = '';
     43                $enabled = $disabled = false;
    4344
    44                 if ( isset( $allowed_themes[ $theme_key ] ) == true ) {
    45                     $enabled = 'checked="checked" ';
     45                if ( isset( $allowed_themes[$theme_key] ) == true ) {
     46                    $enabled = true;
    4647                    $activated_themes_count++;
    47                     $class1 = ' active';
     48                    $class1 = 'active';
    4849                } else {
    49                     $disabled = 'checked="checked" ';
     50                    $disabled = true;
    5051                }
    5152                ?>
    52                 <tr valign="top" class="<?php echo $class.$class1; ?>">
     53                <tr valign="top" class="<?php echo $class, $class1; ?>">
    5354                    <td style="text-align:center;">
    54                         <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>
     55                        <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>
    5556                        &nbsp;&nbsp;&nbsp;
    56                         <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>
     57                        <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>
    5758                    </td>
    5859                    <th scope="row" style="text-align:left;"><?php echo $key ?></th>
     
    6566
    6667        <p class="submit">
    67             <input type='submit' value='<?php _e('Update Themes') ?>' /></p>
     68            <input type="submit" value="<?php _e( 'Update Themes' ) ?>" /></p>
    6869    </form>
    6970
    70     <h3><?php _e('Total')?></h3>
     71    <h3><?php _e( 'Total' )?></h3>
    7172    <p>
    72         <?php printf(__('Themes Installed: %d'), $total_theme_count); ?>
     73        <?php printf( __( 'Themes Installed: %d' ), $total_theme_count); ?>
    7374        <br />
    74         <?php printf(__('Themes Activated: %d'), $activated_themes_count); ?>
     75        <?php printf( __( 'Themes Activated: %d' ), $activated_themes_count); ?>
    7576    </p>
    7677</div>
    7778
    78 <?php include('admin-footer.php'); ?>
     79<?php include( './admin-footer.php' ); ?>
Note: See TracChangeset for help on using the changeset viewer.