admin-header.php
6.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<?php
/**
* WordPress Administration Template Header
*
* @package WordPress
* @subpackage Administration
*/
@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
if ( ! defined( 'WP_ADMIN' ) )
require_once( './admin.php' );
// In case admin-header.php is included in a function.
global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $wp_version,
$current_site, $update_title, $total_update_count, $parent_file;
// Catch plugins that include admin-header.php before admin.php completes.
if ( empty( $current_screen ) )
set_current_screen();
get_admin_page_title();
$title = esc_html( strip_tags( $title ) );
if ( is_network_admin() )
$admin_title = __( 'Network Admin' );
elseif ( is_user_admin() )
$admin_title = __( 'Global Dashboard' );
else
$admin_title = get_bloginfo( 'name' );
if ( $admin_title == $title )
$admin_title = sprintf( __( '%1$s' ), $title );
else
$admin_title = sprintf( __( '%1$s ‹ %2$s' ), $title, $admin_title );
$admin_title = apply_filters( 'admin_title', $admin_title, $title );
wp_user_settings();
_wp_admin_html_begin();
?>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<title>全球搜</title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<?php
wp_enqueue_style( 'colors' );
wp_enqueue_style( 'ie' );
wp_enqueue_script('utils');
$admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
?>
<link href="css/head.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/head.js"></script>
<script type="text/javascript">
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();}}};
var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
pagenow = '<?php echo $current_screen->id; ?>',
typenow = '<?php echo $current_screen->post_type; ?>',
adminpage = '<?php echo $admin_body_class; ?>',
thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',
decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',
isRtl = <?php echo (int) is_rtl(); ?>;
</script>
<?php
do_action('admin_enqueue_scripts', $hook_suffix);
do_action("admin_print_styles-$hook_suffix");
do_action('admin_print_styles');
do_action("admin_print_scripts-$hook_suffix");
do_action('admin_print_scripts');
do_action("admin_head-$hook_suffix");
do_action('admin_head');
if ( get_user_setting('mfold') == 'f' )
$admin_body_class .= ' folded';
if ( !get_user_setting('unfold') )
$admin_body_class .= ' auto-fold';
if ( is_admin_bar_showing() )
$admin_body_class .= ' admin-bar';
if ( is_rtl() )
$admin_body_class .= ' rtl';
$admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( $wp_version ) );
$admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', $wp_version ) );
$admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' );
$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
if ( wp_is_mobile() )
$admin_body_class .= ' mobile';
$admin_body_class .= ' no-customize-support';
?>
<!-- 风格切换以及原页面升级 -->
<link href="../wp-content/plugins/modern-admin/style2017/skin.css?ver=20170106" type="text/css" rel="stylesheet">
<script type="text/javascript" src="//cdn.globalso.com/base.js"></script>
</head>
<body class="wp-admin wp-core-ui no-js <?php echo apply_filters( 'admin_body_class', '' ) . " $admin_body_class"; ?>" >
<script type="text/javascript">
document.body.className = document.body.className.replace('no-js','js');
</script>
<?php
// Make sure the customize body classes are correct as early as possible.
if ( current_user_can( 'edit_theme_options' ) )
wp_customize_support_script();
?>
<div id="wpbody" style="text-align:left;padding-left: 20px;margin:-40px 0 0 0;">
<div class="page_jump_wrap">
<select class="page_jump" id="select_language">
<option selected>较对语言</option>
</select>
</div>
<style>
.page_jump_wrap{position:absolute;right:120px; top:0;background:#FFF;border:1px solid #ccc; display: none}
.page_jump_wrap:before{ content:""; position:absolute;right:0; top:0; width:25px;height:100%; background:#FFF;pointer-events:none;}
.page_jump_wrap:after{content:""; position:absolute;right:12px; top:50%;margin-top:-3px;width:0;height:0;border-style: solid dashed dashed dashed;
border-width: 6px 4px 0 4px;border-color: #aaa transparent transparent transparent;pointer-events:none;}
.page_jump{ height:28px !important; line-height:normal !important;padding:0 0 0 8px !important;min-width:90px;font-size:12px;border:none; background:none; cursor:pointer;}
</style>
<script>
$(".page_jump").change(function(){
var url=$(this).find("option:selected").attr("data-url").trim();
if(url!==""){
window.open(url)
}
})
</script>
<?php
$sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : '';
$has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status;
if(in_array($post_type,["post","page","news"]) && $has_sample_permalink){?>
<script>
$.get("/wp-content/plugins/proofreading/api.php?type=get_user_language",{},function(res){
var language = JSON.parse(res);
var jump_url = '<?php echo get_permalink($post->ID)?>';
if(jump_url){
if(language.length>0){
$(".page_jump_wrap").show();
$.each(language,function(k,v){
var url ="/wp-admin/plugins.php?page=proofreading&jump_url="+jump_url+"&language="+v.short;
var option = ' <option value="'+v.short+'" data-url="'+url+'">'+v.chinese+'</option>';
$("#select_language").append(option);
});
}}
})
</script>
<? } ?>
<div id="wpbody-content" aria-label="Main content" tabindex="0">
<?php
unset($title_class, $blog_name, $total_update_count, $update_title);
$current_screen->set_parentage( $parent_file );
?>
<div aria-label="<?php esc_attr_e('Main content'); ?>" tabindex="0">
<?php
$current_screen->render_screen_meta();
if ( is_network_admin() )
do_action('network_admin_notices');
elseif ( is_user_admin() )
do_action('user_admin_notices');
else
do_action('admin_notices');
do_action('all_admin_notices');
if ( $parent_file == 'options-general.php' )
require(ABSPATH . 'wp-admin/options-head.php');