]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/theme-install.php
Wordpress 3.1.1
[autoinstalls/wordpress.git] / wp-admin / theme-install.php
1 <?php
2 /**
3  * Install theme administration panel.
4  *
5  * @package WordPress
6  * @subpackage Administration
7  */
8
9 if ( !defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'theme-information' == $_GET['tab'] ) )
10         define( 'IFRAME_REQUEST', true );
11
12 /** WordPress Administration Bootstrap */
13 require_once('./admin.php');
14
15 if ( ! current_user_can('install_themes') )
16         wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) );
17
18 if ( is_multisite() && ! is_network_admin() ) {
19         wp_redirect( network_admin_url( 'theme-install.php' ) );
20         exit();
21 }
22
23 $wp_list_table = _get_list_table('WP_Theme_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 }
31
32 $title = __('Install Themes');
33 $parent_file = 'themes.php';
34 if ( !is_network_admin() )
35         $submenu_file = 'themes.php';
36
37 wp_enqueue_style( 'theme-install' );
38 wp_enqueue_script( 'theme-install' );
39
40 add_thickbox();
41 wp_enqueue_script( 'theme-preview' );
42
43 $body_id = $tab;
44
45 do_action('install_themes_pre_' . $tab); //Used to override the general interface, Eg, install or theme information.
46
47 $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 licensed under the GNU General Public License, version 2, just like WordPress.'), 'http://wordpress.org/extend/themes/') . '</p>';
48 $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>';
49 $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&#8217;s folder via FTP into your <code>/wp-content/themes</code> directory.') . '</p>';
50 $help .= '<p><strong>' . __('For more information:') . '</strong></p>';
51 $help .= '<p>' . __('<a href="http://codex.wordpress.org/Using_Themes#Adding_New_Themes" target="_blank">Documentation on Adding New Themes</a>') . '</p>';
52 $help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>';
53 add_contextual_help($current_screen, $help);
54
55 include(ABSPATH . 'wp-admin/admin-header.php');
56 ?>
57 <div class="wrap">
58 <?php
59 screen_icon();
60
61 if ( is_network_admin() ) : ?>
62 <h2><?php echo esc_html( $title ); ?></h2>
63 <?php else : ?>
64 <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>
65
66 <?php
67 endif;
68
69 $wp_list_table->views(); ?>
70
71 <br class="clear" />
72 <?php do_action('install_themes_' . $tab, $paged); ?>
73 </div>
74 <?php
75 include(ABSPATH . 'wp-admin/admin-footer.php');
76