Changes in trunk/wp-admin/theme-install.php [15160:17322]
- File:
-
- 1 edited
-
trunk/wp-admin/theme-install.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/theme-install.php
r15160 r17322 7 7 */ 8 8 9 if ( !defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'theme-information' == $_GET['tab'] ) ) 10 define( 'IFRAME_REQUEST', true ); 11 9 12 /** WordPress Administration Bootstrap */ 10 13 require_once('./admin.php'); 11 14 12 15 if ( ! current_user_can('install_themes') ) 13 wp_die( __('You do not have sufficient permissions to install themes on this site.'));16 wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) ); 14 17 15 include(ABSPATH . 'wp-admin/includes/theme-install.php'); 18 if ( is_multisite() && ! is_network_admin() ) { 19 wp_redirect( network_admin_url( 'theme-install.php' ) ); 20 exit(); 21 } 22 23 $wp_list_table = _get_list_table('WP_Theme_Install_List_Table'); 24 $pagenum = $wp_list_table->get_pagenum(); 25 $wp_list_table->prepare_items(); 26 $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); 27 if ( $pagenum > $total_pages && $total_pages > 0 ) { 28 wp_redirect( add_query_arg( 'paged', $total_pages ) ); 29 exit; 30 } 16 31 17 32 $title = __('Install Themes'); 18 33 $parent_file = 'themes.php'; 19 $submenu_file = 'themes.php'; 34 if ( !is_network_admin() ) 35 $submenu_file = 'themes.php'; 20 36 21 wp_reset_vars( array('tab', 'paged') );22 37 wp_enqueue_style( 'theme-install' ); 23 38 wp_enqueue_script( 'theme-install' ); … … 25 40 add_thickbox(); 26 41 wp_enqueue_script( 'theme-preview' ); 27 28 //These are the tabs which are shown on the page,29 $tabs = array();30 $tabs['dashboard'] = __('Search');31 if ( 'search' == $tab )32 $tabs['search'] = __('Search Results');33 $tabs['upload'] = __('Upload');34 $tabs['featured'] = _x('Featured','Theme Installer');35 //$tabs['popular'] = _x('Popular','Theme Installer');36 $tabs['new'] = _x('Newest','Theme Installer');37 $tabs['updated'] = _x('Recently Updated','Theme Installer');38 39 $nonmenu_tabs = array('theme-information'); //Valid actions to perform which do not have a Menu item.40 41 $tabs = apply_filters('install_themes_tabs', $tabs );42 $nonmenu_tabs = apply_filters('install_themes_nonmenu_tabs', $nonmenu_tabs);43 44 //If a non-valid menu tab has been selected, And its not a non-menu action.45 if ( empty($tab) || ( ! isset($tabs[ $tab ]) && ! in_array($tab, (array)$nonmenu_tabs) ) ) {46 $tab_actions = array_keys($tabs);47 $tab = $tab_actions[0];48 }49 if ( empty($paged) )50 $paged = 1;51 42 52 43 $body_id = $tab; … … 62 53 add_contextual_help($current_screen, $help); 63 54 64 include( './admin-header.php');55 include(ABSPATH . 'wp-admin/admin-header.php'); 65 56 ?> 66 57 <div class="wrap"> 67 <?php screen_icon(); ?>68 <h2><a href="themes.php" class="nav-tab"><?php echo esc_html_x('Manage Themes', 'theme'); ?></a><a href="theme-install.php" class="nav-tab nav-tab-active"><?php echo esc_html( $title ); ?></a></h2> 58 <?php 59 screen_icon(); 69 60 70 <ul class="subsubsub"> 61 if ( is_network_admin() ) : ?> 62 <h2><?php echo esc_html( $title ); ?></h2> 63 <?php else : ?> 64 <h2 class="nav-tab-wrapper"><a href="themes.php" class="nav-tab"><?php echo esc_html_x('Manage Themes', 'theme'); ?></a><a href="theme-install.php" class="nav-tab nav-tab-active"><?php echo esc_html( $title ); ?></a></h2> 65 71 66 <?php 72 $display_tabs = array(); 73 foreach ( (array)$tabs as $action => $text ) { 74 $sep = ( end($tabs) != $text ) ? ' | ' : ''; 75 $class = ( $action == $tab ) ? ' class="current"' : ''; 76 $href = admin_url('theme-install.php?tab='. $action); 77 echo "\t\t<li><a href='$href'$class>$text</a>$sep</li>\n"; 78 } 79 ?> 80 </ul> 81 <br class="clear" /> 82 <?php do_action('install_themes_' . $tab, $paged); ?> 67 endif; 68 69 $wp_list_table->views(); ?> 70 71 <br class="clear" /> 72 <?php do_action('install_themes_' . $tab, $paged); ?> 83 73 </div> 84 74 <?php 85 include('./admin-footer.php'); 75 include(ABSPATH . 'wp-admin/admin-footer.php'); 76
Note: See TracChangeset
for help on using the changeset viewer.