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
+7 -7
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>
+7 -11
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
+7 -8
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>