PageRenderTime 115ms CodeModel.GetById 19ms RepoModel.GetById 5ms app.codeStats 0ms

/wp-admin/theme-install.php

https://bitbucket.org/abnopanda/wordpress
PHP | 86 lines | 60 code | 19 blank | 7 comment | 10 complexity | ee28a60aec01638bc254391198fd05bd MD5 | raw file
  1. <?php
  2. /**
  3. * Install theme administration panel.
  4. *
  5. * @package WordPress
  6. * @subpackage Administration
  7. */
  8. if ( !defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'theme-information' == $_GET['tab'] ) )
  9. define( 'IFRAME_REQUEST', true );
  10. /** WordPress Administration Bootstrap */
  11. require_once('./admin.php');
  12. if ( ! current_user_can('install_themes') )
  13. wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) );
  14. if ( is_multisite() && ! is_network_admin() ) {
  15. wp_redirect( network_admin_url( 'theme-install.php' ) );
  16. exit();
  17. }
  18. $wp_list_table = _get_list_table('WP_Theme_Install_List_Table');
  19. $pagenum = $wp_list_table->get_pagenum();
  20. $wp_list_table->prepare_items();
  21. $title = __('Install Themes');
  22. $parent_file = 'themes.php';
  23. if ( !is_network_admin() )
  24. $submenu_file = 'themes.php';
  25. wp_enqueue_script( 'theme-install' );
  26. wp_enqueue_script( 'theme' );
  27. $body_id = $tab;
  28. do_action('install_themes_pre_' . $tab); //Used to override the general interface, Eg, install or theme information.
  29. $help_overview =
  30. '<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>' .
  31. '<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>' .
  32. '<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>';
  33. get_current_screen()->add_help_tab( array(
  34. 'id' => 'overview',
  35. 'title' => __('Overview'),
  36. 'content' => $help_overview
  37. ) );
  38. $help_installing =
  39. '<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>' .
  40. '<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>';
  41. get_current_screen()->add_help_tab( array(
  42. 'id' => 'installing',
  43. 'title' => __('Previewing and Installing'),
  44. 'content' => $help_installing
  45. ) );
  46. get_current_screen()->set_help_sidebar(
  47. '<p><strong>' . __('For more information:') . '</strong></p>' .
  48. '<p>' . __('<a href="http://codex.wordpress.org/Using_Themes#Adding_New_Themes" target="_blank">Documentation on Adding New Themes</a>') . '</p>' .
  49. '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
  50. );
  51. include(ABSPATH . 'wp-admin/admin-header.php');
  52. ?>
  53. <div class="wrap">
  54. <?php
  55. screen_icon();
  56. if ( is_network_admin() ) : ?>
  57. <h2><?php echo esc_html( $title ); ?></h2>
  58. <?php else : ?>
  59. <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>
  60. <?php
  61. endif;
  62. $wp_list_table->views(); ?>
  63. <br class="clear" />
  64. <?php do_action('install_themes_' . $tab, $paged); ?>
  65. </div>
  66. <?php
  67. include(ABSPATH . 'wp-admin/admin-footer.php');