]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/admin-header.php
Wordpress 3.5
[autoinstalls/wordpress.git] / wp-admin / admin-header.php
1 <?php
2 /**
3  * WordPress Administration Template Header
4  *
5  * @package WordPress
6  * @subpackage Administration
7  */
8
9 @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
10 if ( ! defined( 'WP_ADMIN' ) )
11         require_once( './admin.php' );
12
13 // In case admin-header.php is included in a function.
14 global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $wp_version,
15         $current_site, $update_title, $total_update_count, $parent_file;
16
17 // Catch plugins that include admin-header.php before admin.php completes.
18 if ( empty( $current_screen ) )
19         set_current_screen();
20
21 get_admin_page_title();
22 $title = esc_html( strip_tags( $title ) );
23
24 if ( is_network_admin() )
25         $admin_title = __( 'Network Admin' );
26 elseif ( is_user_admin() )
27         $admin_title = __( 'Global Dashboard' );
28 else
29         $admin_title = get_bloginfo( 'name' );
30
31 if ( $admin_title == $title )
32         $admin_title = sprintf( __( '%1$s &#8212; WordPress' ), $title );
33 else
34         $admin_title = sprintf( __( '%1$s &lsaquo; %2$s &#8212; WordPress' ), $title, $admin_title );
35
36 $admin_title = apply_filters( 'admin_title', $admin_title, $title );
37
38 wp_user_settings();
39
40 _wp_admin_html_begin();
41 ?>
42 <title><?php echo $admin_title; ?></title>
43 <?php
44
45 wp_enqueue_style( 'colors' );
46 wp_enqueue_style( 'ie' );
47 wp_enqueue_script('utils');
48
49 $admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
50 ?>
51 <script type="text/javascript">
52 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();}}};
53 var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
54         pagenow = '<?php echo $current_screen->id; ?>',
55         typenow = '<?php echo $current_screen->post_type; ?>',
56         adminpage = '<?php echo $admin_body_class; ?>',
57         thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',
58         decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',
59         isRtl = <?php echo (int) is_rtl(); ?>;
60 </script>
61 <?php
62
63 do_action('admin_enqueue_scripts', $hook_suffix);
64 do_action("admin_print_styles-$hook_suffix");
65 do_action('admin_print_styles');
66 do_action("admin_print_scripts-$hook_suffix");
67 do_action('admin_print_scripts');
68 do_action("admin_head-$hook_suffix");
69 do_action('admin_head');
70
71 if ( get_user_setting('mfold') == 'f' )
72         $admin_body_class .= ' folded';
73
74 if ( !get_user_setting('unfold') )
75         $admin_body_class .= ' auto-fold';
76
77 if ( is_admin_bar_showing() )
78         $admin_body_class .= ' admin-bar';
79
80 if ( is_rtl() )
81         $admin_body_class .= ' rtl';
82
83 $admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( $wp_version ) );
84 $admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', $wp_version ) );
85 $admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' );
86 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
87
88 if ( wp_is_mobile() )
89         $admin_body_class .= ' mobile';
90
91 $admin_body_class .= ' no-customize-support';
92
93 ?>
94 </head>
95 <body class="wp-admin wp-core-ui no-js <?php echo apply_filters( 'admin_body_class', '' ) . " $admin_body_class"; ?>">
96 <script type="text/javascript">
97         document.body.className = document.body.className.replace('no-js','js');
98 </script>
99
100 <?php
101 // If the customize-loader script is enqueued, make sure the customize
102 // body classes are correct as early as possible.
103 if ( wp_script_is( 'customize-loader', 'queue' ) && current_user_can( 'edit_theme_options' ) )
104         wp_customize_support_script();
105 ?>
106
107 <div id="wpwrap">
108 <a tabindex="1" href="#wpbody-content" class="screen-reader-shortcut"><?php _e('Skip to main content'); ?></a>
109 <?php require(ABSPATH . 'wp-admin/menu-header.php'); ?>
110 <div id="wpcontent">
111
112 <?php
113 do_action('in_admin_header');
114 ?>
115
116 <div id="wpbody">
117 <?php
118 unset($title_class, $blog_name, $total_update_count, $update_title);
119
120 $current_screen->set_parentage( $parent_file );
121
122 ?>
123
124 <div id="wpbody-content" aria-label="<?php esc_attr_e('Main content'); ?>" tabindex="0">
125 <?php
126
127 $current_screen->render_screen_meta();
128
129 if ( is_network_admin() )
130         do_action('network_admin_notices');
131 elseif ( is_user_admin() )
132         do_action('user_admin_notices');
133 else
134         do_action('admin_notices');
135
136 do_action('all_admin_notices');
137
138 if ( $parent_file == 'options-general.php' )
139         require(ABSPATH . 'wp-admin/options-head.php');