Remove favorite_actions() from h2s. Restore Add New buttons. see #17324

git-svn-id: https://develop.svn.wordpress.org/trunk@17849 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2011-05-10 19:18:16 +00:00
parent 6cea4ea026
commit 57d714aedc
10 changed files with 42 additions and 53 deletions

View File

@ -190,9 +190,7 @@ require_once('./admin-header.php');
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php
echo esc_html( $post_type_object->labels->name );
favorite_actions( $current_screen );
<h2><?php echo esc_html( $post_type_object->labels->name ); ?> <a href="<?php echo $post_new_file ?>" class="button add-new-h2"><?php echo esc_html($post_type_object->labels->add_new); ?></a> <?php
if ( isset($_REQUEST['s']) && $_REQUEST['s'] )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() ); ?>
</h2>

View File

@ -56,10 +56,7 @@ $today = current_time('mysql', 1);
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php
echo esc_html( $title );
favorite_actions( $current_screen ); ?>
</h2>
<h2><?php echo esc_html( $title ); ?></h2>
<div id="dashboard-widgets-wrap">

View File

@ -59,9 +59,7 @@ if ( ! current_user_can('manage_links') )
<div class="wrap nosubsub">
<?php screen_icon(); ?>
<h2><?php
echo esc_html( $title );
favorite_actions( $current_screen );
<h2><?php echo esc_html( $title ); ?> <a href="link-add.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'link'); ?></a> <?php
if ( !empty($_REQUEST['s']) )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( stripslashes($_REQUEST['s']) ) ); ?>
</h2>

View File

@ -99,13 +99,13 @@ require_once( '../admin-header.php' );
<div class="wrap">
<?php screen_icon('ms-admin'); ?>
<h2><?php
_e('Sites');
echo $msg;
if ( current_user_can( 'create_sites') ) {
favorite_actions( $current_screen );
}
if ( isset( $_REQUEST['s'] ) && $_REQUEST['s'] ) {
<h2><?php _e('Sites') ?>
<?php echo $msg; ?>
<?php if ( current_user_can( 'create_sites') ) : ?>
<a href="<?php echo network_admin_url('site-new.php'); ?>" class="button add-new-h2"><?php echo esc_html_x( 'Add New', 'site' ); ?></a>
<?php endif; ?>
<?php if ( isset( $_REQUEST['s'] ) && $_REQUEST['s'] ) {
printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $s ) );
} ?>
</h2>

View File

@ -199,11 +199,7 @@ require_once(ABSPATH . 'wp-admin/admin-header.php');
<div class="wrap">
<?php screen_icon('themes'); ?>
<h2><?php
echo esc_html( $title );
if ( current_user_can('install_themes') ) {
favorite_actions( $current_screen );
}
<h2><?php echo esc_html( $title ); if ( current_user_can('install_themes') ) { ?> <a href="theme-install.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'theme'); ?></a><?php }
if ( $s )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $s ) ); ?>
</h2>

View File

@ -72,14 +72,13 @@ if ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] == 'true' && ! empty(
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php
esc_html_e( 'Users' );
if ( current_user_can( 'create_users' ) ) {
favorite_actions( $current_screen );
}
if ( !empty( $usersearch ) ) {
<h2><?php esc_html_e( 'Users' );
if ( current_user_can( 'create_users') ) : ?>
<a href="<?php echo network_admin_url('user-new.php'); ?>" class="button add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a><?php
endif;
if ( !empty( $usersearch ) )
printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $usersearch ) );
}
?>
</h2>

View File

@ -385,11 +385,10 @@ if ( !empty($invalid) )
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php
echo esc_html( $title );
if ( ( ! is_multisite() || is_network_admin() ) && current_user_can('install_plugins') ) {
favorite_actions( $current_screen );
}
<h2><?php echo esc_html( $title );
if ( ( ! is_multisite() || is_network_admin() ) && current_user_can('install_plugins') ) { ?>
<a href="<?php echo self_admin_url( 'plugin-install.php' ); ?>" class="button add-new-h2"><?php echo esc_html_x('Add New', 'plugin'); ?></a>
<?php }
if ( $s )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $s ) ); ?>
</h2>

View File

@ -71,16 +71,15 @@ require_once('./admin-header.php');
<div class="wrap"><?php
screen_icon();
if ( !is_multisite() ) : ?>
<h2 class="nav-tab-wrapper">
<a href="themes.php" class="nav-tab nav-tab-active"><?php echo esc_html( $title ); ?></a><?php
if ( current_user_can('install_themes') ) :
?><a href="<?php echo admin_url( 'theme-install.php'); ?>" class="nav-tab"><?php echo esc_html_x('Install Themes', 'theme'); ?></a><?php
endif;
<h2 class="nav-tab-wrapper">
<a href="themes.php" class="nav-tab nav-tab-active"><?php echo esc_html( $title ); ?></a>
<?php if ( current_user_can('install_themes') ) : ?>
<a href="<?php echo admin_url( 'theme-install.php'); ?>" class="nav-tab"><?php echo esc_html_x('Install Themes', 'theme'); ?></a>
<?php endif;
else : ?>
<h2>
<?php echo esc_html( $title ); ?>
<h2>
<?php echo esc_html( $title ); ?>
<?php endif; ?>
</h2>

View File

@ -160,9 +160,7 @@ require_once('./admin-header.php');
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php
echo esc_html( $title );
favorite_actions( $current_screen );
<h2><?php echo esc_html( $title ); ?> <a href="media-new.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'file'); ?></a> <?php
if ( isset($_REQUEST['s']) && $_REQUEST['s'] )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() ); ?>
</h2>

View File

@ -359,7 +359,12 @@ if ( ! empty($messages) ) {
<h2>
<?php
echo esc_html( $title );
favorite_actions( $current_screen );
if ( current_user_can( 'create_users' ) ) { ?>
<a href="user-new.php" class="button add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
<?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
<a href="user-new.php" class="button add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
<?php }
if ( $usersearch )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $usersearch ) ); ?>
</h2>