2009-02-11 18:10:11 -05:00
< ? php
/**
* Install theme administration panel .
*
* @ package WordPress
* @ subpackage Administration
*/
2010-12-01 13:53:37 -05:00
if ( ! defined ( 'IFRAME_REQUEST' ) && isset ( $_GET [ 'tab' ] ) && ( 'theme-information' == $_GET [ 'tab' ] ) )
2010-12-01 13:13:54 -05:00
define ( 'IFRAME_REQUEST' , true );
2010-12-13 16:21:50 -05:00
2009-02-11 18:10:11 -05:00
/** WordPress Administration Bootstrap */
2010-04-18 02:14:45 -04:00
require_once ( './admin.php' );
2010-12-16 03:43:22 -05:00
2010-12-07 16:06:19 -05:00
if ( ! current_user_can ( 'install_themes' ) )
wp_die ( __ ( 'You do not have sufficient permissions to install themes on this site.' ) );
2009-02-11 18:10:11 -05:00
2010-12-06 10:41:19 -05:00
if ( is_multisite () && ! is_network_admin () ) {
wp_redirect ( network_admin_url ( 'theme-install.php' ) );
exit ();
}
2011-01-16 16:47:24 -05:00
$wp_list_table = _get_list_table ( 'WP_Theme_Install_List_Table' );
2011-01-12 19:03:38 -05:00
$pagenum = $wp_list_table -> get_pagenum ();
2010-08-22 07:22:46 -04:00
$wp_list_table -> prepare_items ();
2009-02-11 18:10:11 -05:00
$title = __ ( 'Install Themes' );
$parent_file = 'themes.php' ;
2010-10-21 13:06:52 -04:00
if ( ! is_network_admin () )
$submenu_file = 'themes.php' ;
2009-02-11 18:10:11 -05:00
2009-02-12 13:31:16 -05:00
wp_enqueue_script ( 'theme-install' );
2009-02-11 18:10:11 -05:00
add_thickbox ();
2009-02-18 16:55:00 -05:00
wp_enqueue_script ( 'theme-preview' );
2009-02-11 18:10:11 -05:00
$body_id = $tab ;
do_action ( 'install_themes_pre_' . $tab ); //Used to override the general interface, Eg, install or theme information.
2011-06-10 12:35:32 -04:00
$help = '<p>' . sprintf ( __ ( 'You can find additional themes for your site by using the Theme Browser/Installer on this screen, which will display themes from the <a href="%s" target="_blank">WordPress.org Theme Directory</a>. These themes are designed and developed by third parties, are available free of charge, and are compatible with the license WordPress uses.' ), 'http://wordpress.org/extend/themes/' ) . '</p>' ;
2010-05-26 14:27:13 -04:00
$help .= '<p>' . __ ( 'You can Search for themes by keyword, author, or tag, or can get more specific and search by criteria listed in the feature filter. Alternately, you can browse the themes that are Featured, Newest, or Recently Updated. When you find a theme you like, you can preview it or install it.' ) . '</p>' ;
2010-06-01 13:44:38 -04:00
$help .= '<p>' . __ ( 'You can Upload a theme manually if you have already downloaded its ZIP archive onto your computer (make sure it is from a trusted and original source). You can also do it the old-fashioned way and copy a downloaded theme’s folder via FTP into your <code>/wp-content/themes</code> directory.' ) . '</p>' ;
2011-11-02 01:33:53 -04:00
2011-11-30 21:22:07 -05:00
get_current_screen () -> add_help_tab ( array (
'id' => 'overview' ,
'title' => __ ( 'Overview' ),
'content' => $help
) );
2010-01-15 11:58:36 -05:00
2011-11-02 17:32:16 -04:00
get_current_screen () -> set_help_sidebar (
2011-11-02 01:33:53 -04:00
'<p><strong>' . __ ( 'For more information:' ) . '</strong></p>' .
'<p>' . __ ( '<a href="http://codex.wordpress.org/Using_Themes#Adding_New_Themes" target="_blank">Documentation on Adding New Themes</a>' ) . '</p>' .
'<p>' . __ ( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
);
2010-10-21 13:06:52 -04:00
include ( ABSPATH . 'wp-admin/admin-header.php' );
2009-02-11 18:10:11 -05:00
?>
< div class = " wrap " >
2010-10-21 13:06:52 -04:00
< ? php
2010-10-21 15:55:28 -04:00
screen_icon ();
2010-10-21 13:06:52 -04:00
if ( is_network_admin () ) : ?>
< h2 >< ? php echo esc_html ( $title ); ?> </h2>
< ? php else : ?>
2010-10-25 16:45:58 -04:00
< h2 class = " nav-tab-wrapper " >< a href = " themes.php " class = " nav-tab " >< ? php echo esc_html_x ( 'Manage Themes' , 'theme' ); ?> </a><a href="theme-install.php" class="nav-tab nav-tab-active"><?php echo esc_html( $title ); ?></a></h2>
2009-02-11 18:10:11 -05:00
2010-10-21 15:55:28 -04:00
< ? php
2010-10-21 13:06:52 -04:00
endif ;
$wp_list_table -> views (); ?>
2010-09-05 17:26:27 -04:00
< br class = " clear " />
< ? php do_action ( 'install_themes_' . $tab , $paged ); ?>
2009-02-11 18:10:11 -05:00
</ div >
< ? php
2010-10-21 13:06:52 -04:00
include ( ABSPATH . 'wp-admin/admin-footer.php' );