Changes in trunk/wp-admin/plugin-install.php [15135:17322]
- File:
-
- 1 edited
-
trunk/wp-admin/plugin-install.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/plugin-install.php
r15135 r17322 6 6 * @subpackage Administration 7 7 */ 8 // TODO route this pages via a specific iframe handler instead of the do_action below 9 if ( !defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'plugin-information' == $_GET['tab'] ) ) 10 define( 'IFRAME_REQUEST', true ); 8 11 9 12 /** WordPress Administration Bootstrap */ … … 13 16 wp_die(__('You do not have sufficient permissions to install plugins on this site.')); 14 17 15 include(ABSPATH . 'wp-admin/includes/plugin-install.php'); 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 } 16 31 17 32 $title = __('Install Plugins'); 18 33 $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;45 34 46 35 wp_enqueue_style( 'plugin-install' ); … … 63 52 ); 64 53 65 include( './admin-header.php');54 include(ABSPATH . 'wp-admin/admin-header.php'); 66 55 ?> 67 56 <div class="wrap"> … … 69 58 <h2><?php echo esc_html( $title ); ?></h2> 70 59 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); ?> 60 <?php $wp_list_table->views(); ?> 61 62 <br class="clear" /> 63 <?php do_action('install_plugins_' . $tab, $paged); ?> 84 64 </div> 85 65 <?php 86 include('./admin-footer.php'); 66 include(ABSPATH . 'wp-admin/admin-footer.php'); 67
Note: See TracChangeset
for help on using the changeset viewer.