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