wp/wp-admin/index.php
author ymh <ymh.work@gmail.com>
Thu, 07 Nov 2013 00:08:07 +0000
changeset 1 f6eb5a861d2f
parent 0 d970ebf37754
child 5 5e2f62d02dcd
permissions -rw-r--r--
remove unnessary files. Make timthumb work
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
 * Dashboard Administration Screen
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
 * @package WordPress
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
 * @subpackage Administration
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
/** Load WordPress Bootstrap */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
require_once( dirname( __FILE__ ) . '/admin.php' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
/** Load WordPress dashboard API */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
require_once(ABSPATH . 'wp-admin/includes/dashboard.php');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
wp_dashboard_setup();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
wp_enqueue_script( 'dashboard' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
if ( current_user_can( 'edit_theme_options' ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
	wp_enqueue_script( 'customize-loader' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
if ( current_user_can( 'install_plugins' ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
	wp_enqueue_script( 'plugin-install' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
if ( current_user_can( 'upload_files' ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
	wp_enqueue_script( 'media-upload' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
add_thickbox();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
if ( wp_is_mobile() )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
	wp_enqueue_script( 'jquery-touch-punch' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
$title = __('Dashboard');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
$parent_file = 'index.php';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
if ( is_user_admin() )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
	add_screen_option('layout_columns', array('max' => 4, 'default' => 1) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
else
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
	add_screen_option('layout_columns', array('max' => 4, 'default' => 2) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
$help = '<p>' . __( 'Welcome to your WordPress Dashboard! This is the screen you will see when you log in to your site, and gives you access to all the site management features of WordPress. You can get help for any screen by clicking the Help tab in the upper corner.' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
// Not using chaining here, so as to be parseable by PHP4.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
$screen = get_current_screen();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
$screen->add_help_tab( array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
	'id'      => 'overview',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
	'title'   => __( 'Overview' ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
	'content' => $help,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    47
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    48
// Help tabs
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    49
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    50
$help  = '<p>' . __('The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.') . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    51
$help .= '<p>' . __('Links in the Toolbar at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.') . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    52
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    53
$screen->add_help_tab( array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    54
	'id'      => 'help-navigation',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    55
	'title'   => __('Navigation'),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    56
	'content' => $help,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    57
) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    58
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    59
$help  = '<p>' . __('You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.') . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    60
$help .= '<p>' . __('<strong>Screen Options</strong> - Use the Screen Options tab to choose which Dashboard boxes to show, and how many columns to display.') . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    61
$help .= '<p>' . __('<strong>Drag and Drop</strong> - To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.') . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
$help .= '<p>' . __('<strong>Box Controls</strong> - Click the title bar of the box to expand or collapse it. In addition, some boxes have configurable content, and will show a &#8220;Configure&#8221; link in the title bar if you hover over it.') . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    64
$screen->add_help_tab( array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
	'id'      => 'help-layout',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    66
	'title'   => __('Layout'),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    67
	'content' => $help,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68
) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    69
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    70
$help  = '<p>' . __('The boxes on your Dashboard screen are:') . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    71
if ( current_user_can( 'edit_posts' ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    72
	$help .= '<p>' . __('<strong>Right Now</strong> - Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.') . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    73
if ( current_user_can( 'moderate_comments' ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    74
	$help .= '<p>' . __('<strong>Recent Comments</strong> - Shows the most recent comments on your posts (configurable, up to 30) and allows you to moderate them.') . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    75
if ( current_user_can( 'publish_posts' ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    76
	$help .= '<p>' . __('<strong>Incoming Links</strong> - Shows links to your site found by Google Blog Search.') . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    77
if ( current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    78
	$help .= '<p>' . __('<strong>QuickPress</strong> - Allows you to create a new post and either publish it or save it as a draft.') . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    79
	$help .= '<p>' . __('<strong>Recent Drafts</strong> - Displays links to the 5 most recent draft posts you&#8217;ve started.') . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    80
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    81
$help .= '<p>' . __('<strong>WordPress Blog</strong> - Latest news from the official WordPress project.') . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    82
$help .= '<p>' . __('<strong>Other WordPress News</strong> - Shows the <a href="http://planet.wordpress.org" target="_blank">WordPress Planet</a> feed. You can configure it to show a different feed of your choosing.') . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    83
if ( ! is_multisite() && current_user_can( 'install_plugins' ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    84
	$help .= '<p>' . __('<strong>Plugins</strong> - Features the most popular, newest, and recently updated plugins from the WordPress.org Plugin Directory.') . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    85
if ( current_user_can( 'edit_theme_options' ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    86
	$help .= '<p>' . __('<strong>Welcome</strong> - Shows links for some of the most common tasks when setting up a new site.') . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    87
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    88
$screen->add_help_tab( array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    89
	'id'      => 'help-content',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    90
	'title'   => __('Content'),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    91
	'content' => $help,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    92
) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    93
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    94
unset( $help );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    95
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    96
$screen->set_help_sidebar(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    97
	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    98
	'<p>' . __( '<a href="http://codex.wordpress.org/Dashboard_Screen" target="_blank">Documentation on Dashboard</a>' ) . '</p>' .
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    99
	'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   100
);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   101
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   102
include (ABSPATH . 'wp-admin/admin-header.php');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   103
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   104
$today = current_time('mysql', 1);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   105
?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   106
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   107
<div class="wrap">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   108
<?php screen_icon(); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   109
<h2><?php echo esc_html( $title ); ?></h2>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   110
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   111
<?php if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) :
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   112
	$classes = 'welcome-panel';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   113
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   114
	$option = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   115
	// 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   116
	$hide = 0 == $option || ( 2 == $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   117
	if ( $hide )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   118
		$classes .= ' hidden'; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   119
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   120
 	<div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   121
 		<?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   122
		<a class="welcome-panel-close" href="<?php echo esc_url( admin_url( '?welcome=0' ) ); ?>"><?php _e( 'Dismiss' ); ?></a>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   123
		<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   124
		/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   125
		 * Add content to the welcome panel on the admin dashboard.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   126
		 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   127
		 * To remove the default welcome panel, use remove_action():
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   128
		 * <code>remove_action( 'welcome_panel', 'wp_welcome_panel' );</code>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   129
		 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   130
		 * @since 3.5.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   131
		 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   132
		do_action( 'welcome_panel' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   133
		?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   134
	</div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   135
<?php endif; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   136
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   137
<div id="dashboard-widgets-wrap">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   138
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   139
<?php wp_dashboard(); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   140
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   141
<div class="clear"></div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   142
</div><!-- dashboard-widgets-wrap -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   143
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   144
</div><!-- wrap -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   145
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   146
<?php require(ABSPATH . 'wp-admin/admin-footer.php'); ?>