]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/theme-install.php
WordPress 3.8.2
[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( dirname( __FILE__ ) . '/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
27 $title = __('Install Themes');
28 $parent_file = 'themes.php';
29 if ( !is_network_admin() )
30         $submenu_file = 'themes.php';
31
32 wp_enqueue_script( 'theme-install' );
33 wp_enqueue_script( 'theme-preview' );
34
35 $body_id = $tab;
36
37 /**
38  * Fires before each of the tabs are rendered on the Install Themes page.
39  *
40  * The dynamic portion of the hook name, $tab, refers to the current
41  * theme install tab. Possible values are 'dashboard', 'search', 'upload',
42  * 'featured', 'new', or 'updated'.
43  *
44  * @since 2.8.0
45  */
46 do_action( "install_themes_pre_{$tab}" );
47
48 $help_overview =
49         '<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/themes/') . '</p>' .
50         '<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>' .
51         '<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>';
52
53 get_current_screen()->add_help_tab( array(
54         'id'      => 'overview',
55         'title'   => __('Overview'),
56         'content' => $help_overview
57 ) );
58
59 $help_installing =
60         '<p>' . __('Once you have generated a list of themes, you can preview and install any of them. Click on the thumbnail of the theme you&#8217;re interested in previewing. It will open up in a full-screen Preview page to give you a better idea of how that theme will look.') . '</p>' .
61         '<p>' . __('To install the theme so you can preview it with your site&#8217;s content and customize its theme options, click the "Install" button at the top of the left-hand pane. The theme files will be downloaded to your website automatically. When this is complete, the theme is now available for activation, which you can do by clicking the "Activate" link, or by navigating to your Manage Themes screen and clicking the "Live Preview" link under any installed theme&#8217;s thumbnail image.') . '</p>';
62
63 get_current_screen()->add_help_tab( array(
64         'id'      => 'installing',
65         'title'   => __('Previewing and Installing'),
66         'content' => $help_installing
67 ) );
68
69 get_current_screen()->set_help_sidebar(
70         '<p><strong>' . __('For more information:') . '</strong></p>' .
71         '<p>' . __('<a href="http://codex.wordpress.org/Using_Themes#Adding_New_Themes" target="_blank">Documentation on Adding New Themes</a>') . '</p>' .
72         '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
73 );
74
75 include(ABSPATH . 'wp-admin/admin-header.php');
76 ?>
77 <div class="wrap">
78 <h2><?php echo esc_html( $title ); ?></h2>
79 <?php
80
81 $wp_list_table->views(); ?>
82
83 <br class="clear" />
84 <?php
85 /**
86  * Fires at the top of each of the tabs on the Install Themes page.
87  *
88  * The dynamic portion of the hook name, $tab, refers to the current
89  * theme install tab. Possible values are 'dashboard', 'search', 'upload',
90  * 'featured', 'new', or 'updated'.
91  *
92  * @since 2.8.0
93  *
94  * @param int $paged Number of the current page of results being viewed.
95  */
96 do_action( "install_themes_{$tab}", $paged );
97 ?>
98 </div>
99 <?php
100 include(ABSPATH . 'wp-admin/admin-footer.php');