PageRenderTime 45ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/2.6/wp-admin/admin-header.php

#
PHP | 122 lines | 100 code | 20 blank | 2 comment | 27 complexity | 9e7bc4dfd1cbb741b6b624bab77a48e9 MD5 | raw file
Possible License(s): AGPL-1.0, LGPL-2.0, LGPL-2.1, GPL-2.0
  1. <?php
  2. @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
  3. if (!isset($_GET["page"])) require_once('admin.php');
  4. if ( $editing ) {
  5. if ( user_can_richedit() )
  6. wp_enqueue_script( 'wp_tiny_mce' );
  7. }
  8. wp_enqueue_script( 'wp-gears' );
  9. $min_width_pages = array( 'post.php', 'post-new.php', 'page.php', 'page-new.php', 'widgets.php', 'comment.php', 'link.php' );
  10. $the_current_page = preg_replace('|^.*/wp-admin/|i', '', $_SERVER['PHP_SELF']);
  11. $ie6_no_scrollbar = true;
  12. function add_minwidth($c) {
  13. return $c . 'minwidth ';
  14. }
  15. if ( in_array( $the_current_page, $min_width_pages ) ) {
  16. $ie6_no_scrollbar = false;
  17. add_filter( 'admin_body_class', 'add_minwidth' );
  18. }
  19. get_admin_page_title();
  20. ?>
  21. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  22. <html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
  23. <head>
  24. <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
  25. <title><?php bloginfo('name') ?> &rsaquo; <?php echo wp_specialchars( strip_tags( $title ) ); ?> &#8212; WordPress</title>
  26. <?php
  27. wp_admin_css( 'css/global' );
  28. wp_admin_css();
  29. wp_admin_css( 'css/colors' );
  30. wp_admin_css( 'css/ie' );
  31. ?>
  32. <script type="text/javascript">
  33. //<![CDATA[
  34. addLoadEvent = function(func) {if (typeof jQuery != "undefined") jQuery(document).ready(func); else if (typeof wpOnload!='function'){wpOnload=func;} else {var oldonload=wpOnload; wpOnload=function(){oldonload();func();}}};
  35. //]]>
  36. </script>
  37. <?php if ( ($parent_file != 'link-manager.php') && ($parent_file != 'options-general.php') && $ie6_no_scrollbar ) : ?>
  38. <style type="text/css">* html { overflow-x: hidden; }</style>
  39. <?php endif;
  40. $hook_suffixes = array();
  41. if ( isset($page_hook) )
  42. $hook_suffixes[] = "-$page_hook";
  43. else if ( isset($plugin_page) )
  44. $hook_suffixes[] = "-$plugin_page";
  45. else if ( isset($pagenow) )
  46. $hook_suffixes[] = "-$pagenow";
  47. $hook_suffixes[] = '';
  48. foreach ( $hook_suffixes as $hook_suffix )
  49. do_action("admin_print_styles$hook_suffix"); // do_action( 'admin_print_styles-XXX' ); do_action( 'admin_print_styles' );
  50. foreach ( $hook_suffixes as $hook_suffix )
  51. do_action("admin_print_scripts$hook_suffix"); // do_action( 'admin_print_scripts-XXX' ); do_action( 'admin_print_scripts' );
  52. foreach ( $hook_suffixes as $hook_suffix )
  53. do_action("admin_head$hook_suffix"); // do_action( 'admin_head-XXX' ); do_action( 'admin_head' );
  54. unset($hook_suffixes, $hook_suffix);
  55. ?>
  56. </head>
  57. <body class="wp-admin <?php echo apply_filters( 'admin_body_class', '' ); ?>">
  58. <div id="wpwrap">
  59. <div id="wpcontent">
  60. <div id="wphead">
  61. <h1><?php if ( '' == get_bloginfo('name', 'display') ) echo '&nbsp;'; else echo get_bloginfo('name', 'display'); ?><span id="viewsite"><a href="<?php echo trailingslashit( get_option('home') ); ?>"><?php _e('Visit Site') ?></a></span></h1>
  62. </div>
  63. <?php
  64. $gears_compat = false;
  65. if ( ($is_gecko || $is_winIE) && strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'webkit') === false ) {
  66. $gears_compat = true;
  67. ?>
  68. <div id="gears-info-box" class="info-box" style="display:none;">
  69. <img src="images/gear.png" title="Gear" alt="" class="gears-img" />
  70. <div id="gears-msg1">
  71. <h3 class="info-box-title"><?php _e('Speed up WordPress'); ?></h3>
  72. <p><?php _e('WordPress now has support for Gears, which adds new features to your web browser.'); ?><br />
  73. <a href="http://gears.google.com/" target="_blank" style="font-weight:normal;"><?php _e('More information...'); ?></a></p>
  74. <p><?php _e('After you install and enable Gears most of WordPress&#8217; images, scripts, and CSS files will be stored locally on your computer. This speeds up page load time.'); ?></p>
  75. <p><strong><?php _e('Don&#8217;t install on a public or shared computer.'); ?></strong></p> <div class="submit"><button onclick="window.location = 'http://gears.google.com/?action=install&amp;return=<?php echo urlencode( admin_url() ); ?>';" class="button"><?php _e('Install Now'); ?></button>
  76. <button class="button" style="margin-left:10px;" onclick="document.getElementById('gears-info-box').style.display='none';"><?php _e('Cancel'); ?></button></div>
  77. </div>
  78. <div id="gears-msg2" style="display:none;">
  79. <h3 class="info-box-title"><?php _e('Gears Status'); ?></h3>
  80. <p><?php _e('Gears is installed on this computer but is not enabled for use with WordPress.'); ?></p>
  81. <p><?php _e('To enable it, make sure this web site is not on the denied list in Gears Settings under your browser\'s Tools menu, then click the button below.'); ?></p>
  82. <p><strong><?php _e('However if this is a public or shared computer, Gears should not be enabled.'); ?></strong></p>
  83. <div class="submit"><button class="button" onclick="wpGears.getPermission();"><?php _e('Enable Gears'); ?></button>
  84. <button class="button" style="margin-left:10px;" onclick="document.getElementById('gears-info-box').style.display='none';"><?php _e('Cancel'); ?></button></div>
  85. </div>
  86. <div id="gears-msg3" style="display:none;">
  87. <h3 class="info-box-title"><?php _e('Gears Status'); ?></h3>
  88. <p><?php _e('Gears is installed and enabled on this computer. You can disable it from your browser Tools menu.'); ?></p>
  89. <p><?php _e('If there are any errors, try disabling Gears, then reload the page and enable it again.'); ?></p>
  90. <p><?php _e('Local storage status:'); ?> <span id="gears-wait"><span style="color:#f00;"><?php _e('Please wait! Updating files:'); ?></span> <span id="gears-upd-number"></span></span></p>
  91. <div class="submit"><button class="button" onclick="document.getElementById('gears-info-box').style.display='none';"><?php _e('Close'); ?></button></div>
  92. </div>
  93. </div>
  94. <?php } ?>
  95. <div id="user_info"><p><?php printf(__('Howdy, <a href="%1$s">%2$s</a>!'), 'profile.php', $user_identity) ?> | <a href="<?php echo site_url('wp-login.php?action=logout', 'login') ?>" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a> | <?php _e('<a href="http://codex.wordpress.org/">Help</a>') ?> | <?php _e('<a href="http://wordpress.org/support/">Forums</a>'); if ( $gears_compat ) { ?> | <span id="gears-menu"><a href="#" onclick="wpGears.message(1);return false;"><?php _e('Turbo') ?></a></span><?php } ?></p></div>
  96. <?php
  97. require(ABSPATH . 'wp-admin/menu-header.php');
  98. if ( $parent_file == 'options-general.php' ) {
  99. require(ABSPATH . 'wp-admin/options-head.php');
  100. }
  101. ?>
  102. <div id="wpbody">