mp-wp_genesis 1 <?php
mp-wp_genesis 2 /**
mp-wp_genesis 3 * Install plugin administration panel.
mp-wp_genesis 4 *
mp-wp_genesis 5 * @package WordPress
mp-wp_genesis 6 * @subpackage Administration
mp-wp_genesis 7 */
mp-wp_genesis 8
mp-wp_genesis 9 /** WordPress Administration Bootstrap */
mp-wp_genesis 10 require_once('admin.php');
mp-wp_genesis 11
mp-wp_genesis 12 if ( ! current_user_can('install_plugins') )
mp-wp_genesis 13 wp_die(__('You do not have sufficient permissions to install plugins on this blog.'));
mp-wp_genesis 14
mp-wp_genesis 15 include(ABSPATH . 'wp-admin/includes/plugin-install.php');
mp-wp_genesis 16
mp-wp_genesis 17 $title = __('Install Plugins');
mp-wp_genesis 18 $parent_file = 'plugins.php';
mp-wp_genesis 19
mp-wp_genesis 20 wp_reset_vars( array('tab', 'paged') );
mp-wp_genesis 21 wp_enqueue_style( 'plugin-install' );
mp-wp_genesis 22 wp_enqueue_script( 'plugin-install' );
mp-wp_genesis 23 add_thickbox();
mp-wp_genesis 24
mp-wp_genesis 25 //These are the tabs which are shown on the page,
mp-wp_genesis 26 $tabs = array();
mp-wp_genesis 27 $tabs['dashboard'] = __('Start Page'); //TODO: Better name?
mp-wp_genesis 28 if ( 'search' == $tab )
mp-wp_genesis 29 $tabs['search'] = __('Search Results');
mp-wp_genesis 30 $tabs['featured'] = __('Featured');
mp-wp_genesis 31 $tabs['popular'] = __('Popular');
mp-wp_genesis 32 $tabs['new'] = __('Newest');
mp-wp_genesis 33 $tabs['updated'] = __('Recently Updated');
mp-wp_genesis 34
mp-wp_genesis 35 $nonmenu_tabs = array('install', 'plugin-information', 'upload'); //Valid actions to perform which do not have a Menu item.
mp-wp_genesis 36
mp-wp_genesis 37 $tabs = apply_filters('install_plugins_tabs', $tabs );
mp-wp_genesis 38 $nonmenu_tabs = apply_filters('install_plugins_nonmenu_tabs', $nonmenu_tabs);
mp-wp_genesis 39
mp-wp_genesis 40 //If a non-valid menu tab has been selected, And its not a non-menu action.
mp-wp_genesis 41 if( empty($tab) || ( ! isset($tabs[ $tab ]) && ! in_array($tab, (array)$nonmenu_tabs) ) ) {
mp-wp_genesis 42 $tab_actions = array_keys($tabs);
mp-wp_genesis 43 $tab = $tab_actions[0];
mp-wp_genesis 44 }
mp-wp_genesis 45 if( empty($paged) )
mp-wp_genesis 46 $paged = 1;
mp-wp_genesis 47
mp-wp_genesis 48 $body_id = $tab;
mp-wp_genesis 49
mp-wp_genesis 50 do_action('install_plugins_pre_' . $tab); //Used to override the general interface, Eg, install or plugin information.
mp-wp_genesis 51
mp-wp_genesis 52 include('admin-header.php');
mp-wp_genesis 53 ?>
mp-wp_genesis 54 <div class="wrap">
mp-wp_genesis 55 <?php screen_icon(); ?>
mp-wp_genesis 56 <h2><?php echo wp_specialchars( $title ); ?></h2>
mp-wp_genesis 57
mp-wp_genesis 58 <ul class="subsubsub">
mp-wp_genesis 59 <?php
mp-wp_genesis 60 $display_tabs = array();
mp-wp_genesis 61 foreach ( (array)$tabs as $action => $text ) {
mp-wp_genesis 62 $sep = ( end($tabs) != $text ) ? ' | ' : '';
mp-wp_genesis 63 $class = ( $action == $tab ) ? ' class="current"' : '';
mp-wp_genesis 64 $href = admin_url('plugin-install.php?tab='. $action);
mp-wp_genesis 65 echo "\t\t<li><a href='$href'$class>$text</a>$sep</li>\n";
mp-wp_genesis 66 }
mp-wp_genesis 67 ?>
mp-wp_genesis 68 </ul>
mp-wp_genesis 69 <br class="clear" />
mp-wp_genesis 70 <?php do_action('install_plugins_' . $tab, $paged); ?>
mp-wp_genesis 71 </div>
mp-wp_genesis 72 <?php
mp-wp_genesis 73 include('admin-footer.php');
mp-wp_genesis 74 ?>