Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r15179 r16847  
    1010require_once( './admin.php' );
    1111
    12 if ( ! current_user_can( 'manage_network_themes' ) )
    13     wp_die( __( 'You do not have permission to access this page.' ) );
    14 
    15 $title = __( 'Network Themes' );
    16 $parent_file = 'ms-admin.php';
    17 
    18 add_contextual_help($current_screen,
    19     '<p>' . __('This screen enables and disables the inclusion of themes available to choose in the Appearance menu for each site. It does not activate or deactivate which theme a site is currently using.') . '</p>' .
    20     '<p>' . __('If the network admin disables a theme that is in use, it can still remain selected on that site. If another theme is chosen, the disabled theme will not appear in the site&#8217;s Appearance > Themes screen.') . '</p>' .
    21     '<p>' . __('Themes can be enabled on a site by site basis by the network admin on the Edit Site screen you go to via the Edit action link on the Sites screen.') . '</p>' .
    22     '<p><strong>' . __('For more information:') . '</strong></p>' .
    23     '<p>' . __('<a href="http://codex.wordpress.org/Super_Admin_Themes_SubPanel" target="_blank">Documentation on Network Themes</a>') . '</p>' .
    24     '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
    25 );
    26 
    27 require_once( './admin-header.php' );
    28 
    29 if ( isset( $_GET['updated'] ) ) {
    30     ?>
    31     <div id="message" class="updated"><p><?php _e( 'Site themes saved.' ) ?></p></div>
    32     <?php
    33 }
    34 
    35 $themes = get_themes();
    36 $allowed_themes = get_site_allowed_themes();
     12wp_redirect( network_admin_url('themes.php') );
     13exit;
    3714?>
    38 <div class="wrap">
    39     <form action="<?php echo esc_url( admin_url( 'ms-edit.php?action=updatethemes' ) ); ?>" method="post">
    40         <?php screen_icon(); ?>
    41         <h2><?php _e( 'Network Themes' ) ?></h2>
    42         <p><?php _e( 'Themes must be enabled for your network before they will be available to individual sites.' ) ?></p>
    43         <p class="submit">
    44             <input type="submit" value="<?php _e( 'Apply Changes' ) ?>" /></p>
    45         <table class="widefat">
    46             <thead>
    47                 <tr>
    48                     <th style="width:15%;"><?php _e( 'Enable' ) ?></th>
    49                     <th style="width:25%;"><?php _e( 'Theme' ) ?></th>
    50                     <th style="width:10%;"><?php _e( 'Version' ) ?></th>
    51                     <th style="width:60%;"><?php _e( 'Description' ) ?></th>
    52                 </tr>
    53             </thead>
    54             <tbody id="plugins">
    55             <?php
    56             $total_theme_count = $activated_themes_count = 0;
    57             $class = '';
    58             foreach ( (array) $themes as $key => $theme ) {
    59                 $total_theme_count++;
    60                 $theme_key = esc_html( $theme['Stylesheet'] );
    61                 $class = ( 'alt' == $class ) ? '' : 'alt';
    62                 $class1 = $enabled = $disabled = '';
    63                 $enabled = $disabled = false;
    64 
    65                 if ( isset( $allowed_themes[$theme_key] ) == true ) {
    66                     $enabled = true;
    67                     $activated_themes_count++;
    68                     $class1 = 'active';
    69                 } else {
    70                     $disabled = true;
    71                 }
    72                 ?>
    73                 <tr valign="top" class="<?php echo $class . ' ' . $class1; ?>">
    74                     <td>
    75                         <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>
    76                         &nbsp;&nbsp;&nbsp;
    77                         <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>
    78                     </td>
    79                     <th scope="row" style="text-align:left;"><?php echo $key ?></th>
    80                     <td><?php echo $theme['Version'] ?></td>
    81                     <td><?php echo $theme['Description'] ?></td>
    82                 </tr>
    83             <?php } ?>
    84             </tbody>
    85         </table>
    86 
    87         <p class="submit">
    88             <input type="submit" value="<?php _e( 'Apply Changes' ) ?>" /></p>
    89     </form>
    90 
    91     <h3><?php _e( 'Total' )?></h3>
    92     <p>
    93         <?php printf( __( 'Themes Installed: %d' ), $total_theme_count); ?>
    94         <br />
    95         <?php printf( __( 'Themes Enabled: %d' ), $activated_themes_count); ?>
    96     </p>
    97 </div>
    98 
    99 <?php include( './admin-footer.php' ); ?>
Note: See TracChangeset for help on using the changeset viewer.