Changes in trunk/wp-admin/plugin-install.php [17322:15135]
- File:
-
- 1 edited
-
trunk/wp-admin/plugin-install.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/plugin-install.php
r17322 r15135 6 6 * @subpackage Administration 7 7 */ 8 // TODO route this pages via a specific iframe handler instead of the do_action below9 if ( !defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'plugin-information' == $_GET['tab'] ) )10 define( 'IFRAME_REQUEST', true );11 8 12 9 /** WordPress Administration Bootstrap */ … … 16 13 wp_die(__('You do not have sufficient permissions to install plugins on this site.')); 17 14 18 if ( is_multisite() && ! is_network_admin() ) { 19 wp_redirect( network_admin_url( 'plugin-install.php' ) ); 20 exit(); 21 } 22 23 $wp_list_table = _get_list_table('WP_Plugin_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/plugin-install.php'); 31 16 32 17 $title = __('Install Plugins'); 33 18 $parent_file = 'plugins.php'; 19 20 wp_reset_vars( array('tab', 'paged') ); 21 22 //These are the tabs which are shown on the page, 23 $tabs = array(); 24 $tabs['dashboard'] = __('Search'); 25 if ( 'search' == $tab ) 26 $tabs['search'] = __('Search Results'); 27 $tabs['upload'] = __('Upload'); 28 $tabs['featured'] = _x('Featured','Plugin Installer'); 29 $tabs['popular'] = _x('Popular','Plugin Installer'); 30 $tabs['new'] = _x('Newest','Plugin Installer'); 31 $tabs['updated'] = _x('Recently Updated','Plugin Installer'); 32 33 $nonmenu_tabs = array('plugin-information'); //Valid actions to perform which do not have a Menu item. 34 35 $tabs = apply_filters('install_plugins_tabs', $tabs ); 36 $nonmenu_tabs = apply_filters('install_plugins_nonmenu_tabs', $nonmenu_tabs); 37 38 //If a non-valid menu tab has been selected, And its not a non-menu action. 39 if ( empty($tab) || ( ! isset($tabs[ $tab ]) && ! in_array($tab, (array)$nonmenu_tabs) ) ) { 40 $tab_actions = array_keys($tabs); 41 $tab = $tab_actions[0]; 42 } 43 if ( empty($paged) ) 44 $paged = 1; 34 45 35 46 wp_enqueue_style( 'plugin-install' ); … … 52 63 ); 53 64 54 include( ABSPATH . 'wp-admin/admin-header.php');65 include('./admin-header.php'); 55 66 ?> 56 67 <div class="wrap"> … … 58 69 <h2><?php echo esc_html( $title ); ?></h2> 59 70 60 <?php $wp_list_table->views(); ?> 61 62 <br class="clear" /> 63 <?php do_action('install_plugins_' . $tab, $paged); ?> 71 <ul class="subsubsub"> 72 <?php 73 $display_tabs = array(); 74 foreach ( (array)$tabs as $action => $text ) { 75 $sep = ( end($tabs) != $text ) ? ' | ' : ''; 76 $class = ( $action == $tab ) ? ' class="current"' : ''; 77 $href = admin_url('plugin-install.php?tab=' . $action); 78 echo "\t\t<li><a href='$href'$class>$text</a>$sep</li>\n"; 79 } 80 ?> 81 </ul> 82 <br class="clear" /> 83 <?php do_action('install_plugins_' . $tab, $paged); ?> 64 84 </div> 65 85 <?php 66 include(ABSPATH . 'wp-admin/admin-footer.php'); 67 86 include('./admin-footer.php');
Note: See TracChangeset
for help on using the changeset viewer.