Changes in trunk/wp-admin/theme-install.php [17322:15160]
- File:
-
- 1 edited
-
trunk/wp-admin/theme-install.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/theme-install.php
r17322 r15160 7 7 */ 8 8 9 if ( !defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'theme-information' == $_GET['tab'] ) )10 define( 'IFRAME_REQUEST', true );11 12 9 /** WordPress Administration Bootstrap */ 13 10 require_once('./admin.php'); 14 11 15 12 if ( ! current_user_can('install_themes') ) 16 wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ));13 wp_die(__('You do not have sufficient permissions to install themes on this site.')); 17 14 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 } 15 include(ABSPATH . 'wp-admin/includes/theme-install.php'); 31 16 32 17 $title = __('Install Themes'); 33 18 $parent_file = 'themes.php'; 34 if ( !is_network_admin() ) 35 $submenu_file = 'themes.php'; 19 $submenu_file = 'themes.php'; 36 20 21 wp_reset_vars( array('tab', 'paged') ); 37 22 wp_enqueue_style( 'theme-install' ); 38 23 wp_enqueue_script( 'theme-install' ); … … 40 25 add_thickbox(); 41 26 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; 42 51 43 52 $body_id = $tab; … … 53 62 add_contextual_help($current_screen, $help); 54 63 55 include( ABSPATH . 'wp-admin/admin-header.php');64 include('./admin-header.php'); 56 65 ?> 57 66 <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> 69 70 <ul class="subsubsub"> 58 71 <?php 59 screen_icon(); 60 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 66 <?php 67 endif; 68 69 $wp_list_table->views(); ?> 70 71 <br class="clear" /> 72 <?php do_action('install_themes_' . $tab, $paged); ?> 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); ?> 73 83 </div> 74 84 <?php 75 include(ABSPATH . 'wp-admin/admin-footer.php'); 76 85 include('./admin-footer.php');
Note: See TracChangeset
for help on using the changeset viewer.