]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/theme-install.php
Wordpress 3.0.4-scripts
[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 /** WordPress Administration Bootstrap */
10 require_once('./admin.php');
11
12 if ( ! current_user_can('install_themes') )
13         wp_die(__('You do not have sufficient permissions to install themes on this site.'));
14
15 include(ABSPATH . 'wp-admin/includes/theme-install.php');
16
17 $title = __('Install Themes');
18 $parent_file = 'themes.php';
19 $submenu_file = 'themes.php';
20
21 wp_reset_vars( array('tab', 'paged') );
22 wp_enqueue_style( 'theme-install' );
23 wp_enqueue_script( 'theme-install' );
24
25 add_thickbox();
26 wp_enqueue_script( 'theme-preview' );
27
28 //These are the tabs which are shown on the page,
29 $tabs = array();
30 $tabs['dashboard'] = __('Search');
31 if ( 'search' == $tab )
32         $tabs['search'] = __('Search Results');
33 $tabs['upload'] = __('Upload');
34 $tabs['featured'] = _x('Featured','Theme Installer');
35 //$tabs['popular']  = _x('Popular','Theme Installer');
36 $tabs['new']      = _x('Newest','Theme Installer');
37 $tabs['updated']  = _x('Recently Updated','Theme Installer');
38
39 $nonmenu_tabs = array('theme-information'); //Valid actions to perform which do not have a Menu item.
40
41 $tabs = apply_filters('install_themes_tabs', $tabs );
42 $nonmenu_tabs = apply_filters('install_themes_nonmenu_tabs', $nonmenu_tabs);
43
44 //If a non-valid menu tab has been selected, And its not a non-menu action.
45 if ( empty($tab) || ( ! isset($tabs[ $tab ]) && ! in_array($tab, (array)$nonmenu_tabs) ) ) {
46         $tab_actions = array_keys($tabs);
47         $tab = $tab_actions[0];
48 }
49 if ( empty($paged) )
50         $paged = 1;
51
52 $body_id = $tab;
53
54 do_action('install_themes_pre_' . $tab); //Used to override the general interface, Eg, install or theme information.
55
56 $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>';
57 $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>';
58 $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>';
59 $help .= '<p><strong>' . __('For more information:') . '</strong></p>';
60 $help .= '<p>' . __('<a href="http://codex.wordpress.org/Using_Themes#Adding_New_Themes" target="_blank">Documentation on Adding New Themes</a>') . '</p>';
61 $help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>';
62 add_contextual_help($current_screen, $help);
63
64 include('./admin-header.php');
65 ?>
66 <div class="wrap">
67 <?php screen_icon(); ?>
68 <h2><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>
69
70         <ul class="subsubsub">
71 <?php
72 $display_tabs = array();
73 foreach ( (array)$tabs as $action => $text ) {
74         $sep = ( end($tabs) != $text ) ? ' | ' : '';
75         $class = ( $action == $tab ) ? ' class="current"' : '';
76         $href = admin_url('theme-install.php?tab='. $action);
77         echo "\t\t<li><a href='$href'$class>$text</a>$sep</li>\n";
78 }
79 ?>
80         </ul>
81         <br class="clear" />
82         <?php do_action('install_themes_' . $tab, $paged); ?>
83 </div>
84 <?php
85 include('./admin-footer.php');