PageRenderTime 33ms CodeModel.GetById 19ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

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

#
PHP | 132 lines | 108 code | 22 blank | 2 comment | 27 complexity | 57c61a781c017f004fbe82f7db0c8801 MD5 | raw file
  1<?php
  2@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
  3if (!isset($_GET["page"])) require_once('admin.php');
  4if ( $editing ) {
  5	if ( user_can_richedit() )
  6		wp_enqueue_script( 'wp_tiny_mce' );
  7}
  8wp_enqueue_script( 'wp-gears' );
  9
 10$min_width_pages = array( 'post.php', 'post-new.php', 'page.php', 'page-new.php', 'widgets.php', 'comment.php', 'link.php' );
 11$the_current_page = preg_replace('|^.*/wp-admin/|i', '', $_SERVER['PHP_SELF']);
 12$ie6_no_scrollbar = true;
 13
 14function add_minwidth($c) {
 15	return $c . 'minwidth ';
 16}
 17
 18if ( in_array( $the_current_page, $min_width_pages ) ) {
 19		$ie6_no_scrollbar = false;
 20		add_filter( 'admin_body_class', 'add_minwidth' );
 21}
 22
 23get_admin_page_title();
 24
 25?>
 26<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 27<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
 28<head>
 29<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
 30<title><?php bloginfo('name') ?> &rsaquo; <?php echo wp_specialchars( strip_tags( $title ) ); ?> &#8212; WordPress</title>
 31<?php
 32
 33wp_admin_css( 'css/global' );
 34wp_admin_css();
 35wp_admin_css( 'css/colors' );
 36wp_admin_css( 'css/ie' );
 37
 38?>
 39<script type="text/javascript">
 40//<![CDATA[
 41addLoadEvent = 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();}}};
 42//]]>
 43</script>
 44<?php if ( ($parent_file != 'link-manager.php') && ($parent_file != 'options-general.php') && $ie6_no_scrollbar ) : ?>
 45<style type="text/css">* html { overflow-x: hidden; }</style>
 46<?php endif;
 47
 48$hook_suffixes = array();
 49
 50if ( isset($page_hook) )
 51	$hook_suffixes[] = "-$page_hook";
 52else if ( isset($plugin_page) )
 53	$hook_suffixes[] = "-$plugin_page";
 54else if ( isset($pagenow) )
 55	$hook_suffixes[] = "-$pagenow";
 56
 57$hook_suffixes[] = '';
 58
 59foreach ( $hook_suffixes as $hook_suffix )
 60	do_action("admin_print_styles$hook_suffix"); // do_action( 'admin_print_styles-XXX' ); do_action( 'admin_print_styles' );
 61foreach ( $hook_suffixes as $hook_suffix )
 62	do_action("admin_print_scripts$hook_suffix"); // do_action( 'admin_print_scripts-XXX' ); do_action( 'admin_print_scripts' );
 63foreach ( $hook_suffixes as $hook_suffix )
 64	do_action("admin_head$hook_suffix"); // do_action( 'admin_head-XXX' ); do_action( 'admin_head' );
 65unset($hook_suffixes, $hook_suffix);
 66
 67?>
 68</head>
 69<body class="wp-admin <?php echo apply_filters( 'admin_body_class', '' ); ?>">
 70<div id="wpwrap">
 71<div id="wpcontent">
 72<div id="wphead">
 73<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>
 74</div>
 75
 76<?php
 77if ( ! $is_opera ) { 
 78?>
 79	<div id="gears-info-box" class="info-box" style="display:none;">
 80	<img src="images/gear.png" title="Gear" alt="" class="gears-img" />
 81	<div id="gears-msg1">
 82	<h3 class="info-box-title"><?php _e('Speed up WordPress'); ?></h3>
 83	<p><?php _e('WordPress now has support for Gears, which adds new features to your web browser.'); ?><br />
 84	<a href="http://gears.google.com/" target="_blank" style="font-weight:normal;"><?php _e('More information...'); ?></a></p>
 85	<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>
 86	<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>
 87	<button class="button" style="margin-left:10px;" onclick="document.getElementById('gears-info-box').style.display='none';"><?php _e('Cancel'); ?></button></div>
 88	</div>
 89
 90	<div id="gears-msg2" style="display:none;">
 91	<h3 class="info-box-title"><?php _e('Gears Status'); ?></h3>
 92	<p><?php _e('Gears is installed on this computer but is not enabled for use with WordPress.'); ?></p> 
 93	<p><?php 
 94	
 95	if ( $is_safari )
 96		_e('To enable it, make sure this web site is not on the denied list in Gears Settings under the Safari menu, then click the button below.');
 97	else
 98		_e('To enable it, make sure this web site is not on the denied list in Gears Settings under your browser Tools menu, then click the button below.'); 
 99	
100	?></p>
101	<p><strong><?php _e('However if this is a public or shared computer, Gears should not be enabled.'); ?></strong></p>
102	<div class="submit"><button class="button" onclick="wpGears.getPermission();"><?php _e('Enable Gears'); ?></button>
103	<button class="button" style="margin-left:10px;" onclick="document.getElementById('gears-info-box').style.display='none';"><?php _e('Cancel'); ?></button></div>
104	</div>
105
106	<div id="gears-msg3" style="display:none;">
107	<h3 class="info-box-title"><?php _e('Gears Status'); ?></h3>
108	<p><?php
109	
110	if ( $is_safari )
111		_e('Gears is installed and enabled on this computer. You can disable it from the Safari menu.');
112	else
113		_e('Gears is installed and enabled on this computer. You can disable it from your browser Tools menu.'); 
114	
115	?></p>
116	<p><?php _e('If there are any errors, try disabling Gears, then reload the page and enable it again.'); ?></p>
117	<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>
118	<div class="submit"><button class="button" onclick="document.getElementById('gears-info-box').style.display='none';"><?php _e('Close'); ?></button></div>
119	</div>
120	</div>
121<?php } ?>
122
123<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 ( ! $is_opera ) { ?> | <span id="gears-menu"><a href="#" onclick="wpGears.message(1);return false;"><?php _e('Turbo') ?></a></span><?php } ?></p></div>
124
125<?php
126require(ABSPATH . 'wp-admin/menu-header.php');
127
128if ( $parent_file == 'options-general.php' ) {
129	require(ABSPATH . 'wp-admin/options-head.php');
130}
131?>
132<div id="wpbody">