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

git-svn-id: http://svn.automattic.com/wordpress/trunk@17849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2011-05-10 19:18:16 +00:00
parent 6e356e3b0a
commit e5ec44416a
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

@ -34,7 +34,7 @@ $_SERVER['REQUEST_URI'] = remove_query_arg( $temp_args, $_SERVER['REQUEST_URI']
$referer = remove_query_arg( $temp_args, wp_get_referer() );
if ( $action ) {
$allowed_themes = get_site_option( 'allowedthemes' );
$allowed_themes = get_site_option( 'allowedthemes' );
switch ( $action ) {
case 'enable':
check_admin_referer('enable-theme_' . $_GET['theme']);
@ -100,11 +100,11 @@ if ( $action ) {
if ( $data['Name'] == $main_theme ) {
unset( $themes[$key] );
} else {
$files_to_delete = array_merge( $files_to_delete, list_files( WP_CONTENT_DIR . "/themes/$theme" ) );
$files_to_delete = array_merge( $files_to_delete, list_files( WP_CONTENT_DIR . "/themes/$theme" ) );
$theme_info[ $theme ] = $data;
}
}
if ( empty( $themes ) ) {
wp_redirect( add_query_arg( 'error', 'main', $referer ) );
exit;
@ -162,7 +162,7 @@ if ( $action ) {
foreach ( $themes as $theme )
$delete_result = delete_theme( $theme, esc_url( add_query_arg( array('verify-delete' => 1), $_SERVER['REQUEST_URI'] ) ) );
$paged = ( $_REQUEST['paged'] ) ? $_REQUEST['paged'] : 1;
$paged = ( $_REQUEST['paged'] ) ? $_REQUEST['paged'] : 1;
wp_redirect( network_admin_url( "themes.php?deleted=".count( $themes )."&paged=$paged&s=$s" ) );
exit;
break;
@ -199,13 +199,9 @@ 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 );
}
if ( $s )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $s ) ); ?>
<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>
<?php

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 ) ) {
printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $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>