2008-08-04 21:17:42 +00:00
< ? php
2008-08-16 07:27:34 +00:00
/**
* Install plugin administration panel .
*
* @ package WordPress
* @ subpackage Administration
*/
/** WordPress Administration Bootstrap */
2008-08-04 21:17:42 +00:00
require_once ( 'admin.php' );
2008-08-05 17:06:42 +00:00
if ( ! current_user_can ( 'install_plugins' ) )
wp_die ( __ ( 'You do not have sufficient permissions to install plugins on this blog.' ));
2008-08-04 21:17:42 +00:00
include ( ABSPATH . 'wp-admin/includes/plugin-install.php' );
$title = __ ( 'Install Plugins' );
$parent_file = 'plugins.php' ;
wp_reset_vars ( array ( 'tab' , 'paged' ) );
wp_enqueue_style ( 'plugin-install' );
wp_enqueue_script ( 'plugin-install' );
add_thickbox ();
//These are the tabs which are shown on the page, Note that 'install' and 'plugin-information' are valid hooks, but not shown here due to not requiring the header
$tabs = array (
'search' => __ ( 'Search Plugins' ),
'upload' => __ ( 'Upload a Plugin' ),
'featured' => __ ( 'Featured Plugins' ),
'popular' => __ ( 'Popular Plugins' ),
'new' => __ ( 'Newest Plugins' ),
'updated' => __ ( 'Recently Updated Plugins' )
);
$tabs = apply_filters ( 'install_plugins_tabs' , $tabs );
if ( empty ( $tab ) || ( ! isset ( $tabs [ $tab ]) && ! in_array ( $tab , array ( 'install' , 'plugin-information' )) ) ){
$tab_actions = array_keys ( $tabs );
$tab = $tab_actions [ 0 ];
}
if ( empty ( $paged ) )
$paged = 1 ;
$body_id = $tab ;
do_action ( 'install_plugins_pre_' . $tab );
include ( 'admin-header.php' );
?>
< div class = " wrap " >
< ul class = " subsubsub " >
< ? php
$display_tabs = array ();
foreach ( ( array ) $tabs as $action => $text ) {
$sep = ( end ( $tabs ) != $text ) ? ' | ' : '' ;
$class = ( $action == $tab ) ? ' class="current"' : '' ;
$href = admin_url ( 'plugin-install.php?tab=' . $action );
echo " \t \t <li><a href=' $href ' $class > $text </a> $sep </li> \n " ;
}
?>
</ ul >
< ? php do_action ( 'install_plugins_' . $tab , $paged ); ?>
</ div >
< ? php
include ( 'admin-footer.php' );
2008-08-04 21:01:09 +00:00
?>