|
| 1 | +<?php |
| 2 | +require_once('admin.php'); |
| 3 | + |
| 4 | +$title = __('WordPress › Admin › Themes'); |
| 5 | +$parent_file = 'ms-admin.php'; |
| 6 | +require_once('admin-header.php'); |
| 7 | + |
| 8 | +if( is_super_admin() == false ) { |
| 9 | + wp_die( __('You do not have permission to access this page.') ); |
| 10 | +} |
| 11 | + |
| 12 | +if (isset($_GET['updated'])) { |
| 13 | + ?> |
| 14 | + <div id="message" class="updated fade"><p><?php _e('Site themes saved.') ?></p></div> |
| 15 | + <?php |
| 16 | +} |
| 17 | + |
| 18 | +$themes = get_themes(); |
| 19 | +$allowed_themes = get_site_allowed_themes(); |
| 20 | +?> |
| 21 | +<div class="wrap"> |
| 22 | + <form action='ms-edit.php?action=updatethemes' method='post'> |
| 23 | + <h2><?php _e('Site Themes') ?></h2> |
| 24 | + <p><?php _e('Disable themes site-wide. You can enable themes on a site by site basis.') ?></p> |
| 25 | + <table class="widefat"> |
| 26 | + <thead> |
| 27 | + <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> |
| 32 | + </tr> |
| 33 | + </thead> |
| 34 | + <tbody id="plugins"> |
| 35 | + <?php |
| 36 | + $total_theme_count = $activated_themes_count = 0; |
| 37 | + foreach( (array) $themes as $key => $theme ) { |
| 38 | + $total_theme_count++; |
| 39 | + $theme_key = wp_specialchars($theme['Stylesheet']); |
| 40 | + $class = ('alt' == $class) ? '' : 'alt'; |
| 41 | + $class1 = $enabled = $disabled = ''; |
| 42 | + |
| 43 | + if( isset( $allowed_themes[ $theme_key ] ) == true ) { |
| 44 | + $enabled = 'checked="checked" '; |
| 45 | + $activated_themes_count++; |
| 46 | + $class1 = ' active'; |
| 47 | + } else { |
| 48 | + $disabled = 'checked="checked" '; |
| 49 | + } |
| 50 | + ?> |
| 51 | + <tr valign="top" class="<?php echo $class.$class1; ?>"> |
| 52 | + <td style="text-align:center;"> |
| 53 | + <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> |
| 54 | + |
| 55 | + <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> |
| 56 | + </td> |
| 57 | + <th scope="row" style="text-align:left;"><?php echo $key ?></th> |
| 58 | + <td><?php echo $theme['Version'] ?></td> |
| 59 | + <td><?php echo $theme['Description'] ?></td> |
| 60 | + </tr> |
| 61 | + <?php } ?> |
| 62 | + </tbody> |
| 63 | + </table> |
| 64 | + |
| 65 | + <p class="submit"> |
| 66 | + <input type='submit' value='<?php _e('Update Themes »') ?>' /></p> |
| 67 | + </form> |
| 68 | + |
| 69 | + <h3><?php _e('Total')?></h3> |
| 70 | + <p> |
| 71 | + <?php printf(__('Themes Installed: %d'), $total_theme_count); ?> |
| 72 | + <br /> |
| 73 | + <?php printf(__('Themes Activated: %d'), $activated_themes_count); ?> |
| 74 | + </p> |
| 75 | +</div> |
| 76 | + |
| 77 | +<?php include('admin-footer.php'); ?> |
0 commit comments