]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/admin-header.php
a34a51b882e59990e079f96c8a5a7a879d17b114
[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, $is_iphone,
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 userSettings = {
54                 'url': '<?php echo SITECOOKIEPATH; ?>',
55                 'uid': '<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>',
56                 'time':'<?php echo time() ?>'
57         },
58         ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>',
59         pagenow = '<?php echo $current_screen->id; ?>',
60         typenow = '<?php echo $current_screen->post_type; ?>',
61         adminpage = '<?php echo $admin_body_class; ?>',
62         thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',
63         decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',
64         isRtl = <?php echo (int) is_rtl(); ?>;
65 </script>
66 <?php
67
68 do_action('admin_enqueue_scripts', $hook_suffix);
69 do_action("admin_print_styles-$hook_suffix");
70 do_action('admin_print_styles');
71 do_action("admin_print_scripts-$hook_suffix");
72 do_action('admin_print_scripts');
73 do_action("admin_head-$hook_suffix");
74 do_action('admin_head');
75
76 if ( get_user_setting('mfold') == 'f' )
77         $admin_body_class .= ' folded';
78
79 if ( is_admin_bar_showing() )
80         $admin_body_class .= ' admin-bar';
81
82 if ( is_rtl() )
83         $admin_body_class .= ' rtl';
84
85 $admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( $wp_version ) );
86 $admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', $wp_version ) );
87 $admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' );
88
89 if ( $is_iphone ) { ?>
90 <style type="text/css">.row-actions{visibility:visible;}</style>
91 <?php } ?>
92 </head>
93 <body class="wp-admin no-js <?php echo apply_filters( 'admin_body_class', '' ) . " $admin_body_class"; ?>">
94 <script type="text/javascript">document.body.className = document.body.className.replace('no-js','js');</script>
95
96 <div id="wpwrap">
97 <?php require(ABSPATH . 'wp-admin/menu-header.php'); ?>
98 <div id="wpcontent">
99
100 <?php
101 do_action('in_admin_header');
102 ?>
103
104 <div id="wpbody">
105 <?php
106 unset($title_class, $blog_name, $total_update_count, $update_title);
107
108 $current_screen->set_parentage( $parent_file );
109
110 ?>
111
112 <div id="wpbody-content">
113 <?php
114
115 $current_screen->render_screen_meta();
116
117 if ( is_network_admin() )
118         do_action('network_admin_notices');
119 elseif ( is_user_admin() )
120         do_action('user_admin_notices');
121 else
122         do_action('admin_notices');
123
124 do_action('all_admin_notices');
125
126 if ( $parent_file == 'options-general.php' )
127         require(ABSPATH . 'wp-admin/options-head.php');