PageRenderTime 55ms CodeModel.GetById 32ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-admin/theme-install.php

https://github.com/MikeLockz/lockwitz
PHP | 71 lines | 47 code | 17 blank | 7 comment | 10 complexity | 4b759586b26fa787892a09ac3ecce6eb 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_style( 'theme-install' );
  26. wp_enqueue_script( 'theme-install' );
  27. add_thickbox();
  28. wp_enqueue_script( 'theme-preview' );
  29. $body_id = $tab;
  30. do_action('install_themes_pre_' . $tab); //Used to override the general interface, Eg, install or theme information.
  31. $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>';
  32. $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>';
  33. $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>';
  34. $help .= '<p><strong>' . __('For more information:') . '</strong></p>';
  35. $help .= '<p>' . __('<a href="http://codex.wordpress.org/Using_Themes#Adding_New_Themes" target="_blank">Documentation on Adding New Themes</a>') . '</p>';
  36. $help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>';
  37. add_contextual_help($current_screen, $help);
  38. include(ABSPATH . 'wp-admin/admin-header.php');
  39. ?>
  40. <div class="wrap">
  41. <?php
  42. screen_icon();
  43. if ( is_network_admin() ) : ?>
  44. <h2><?php echo esc_html( $title ); ?></h2>
  45. <?php else : ?>
  46. <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>
  47. <?php
  48. endif;
  49. $wp_list_table->views(); ?>
  50. <br class="clear" />
  51. <?php do_action('install_themes_' . $tab, $paged); ?>
  52. </div>
  53. <?php
  54. include(ABSPATH . 'wp-admin/admin-footer.php');