Make WordPress Core

Changeset 15489


Ignore:
Timestamp:
08/02/2010 07:07:03 PM (14 years ago)
Author:
ryan
Message:

Favorite action for network admin. see #14435

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-header.php

    r15484 r15489  
    154154</div>
    155155
    156 <?php !is_network_admin() ? favorite_actions($current_screen) : ''; ?>
     156<?php favorite_actions($current_screen); ?>
    157157</div>
    158158</div>
  • trunk/wp-admin/includes/template.php

    r15339 r15489  
    33273327
    33283328    if ( !$default_action ) {
    3329         switch ( $screen->id ) {
    3330             case 'upload':
    3331                 $default_action = array('media-new.php' => array(__('New Media'), 'upload_files'));
    3332                 break;
    3333             case 'media':
    3334                 $default_action = array('upload.php' => array(__('Edit Media'), 'upload_files'));
    3335                 break;
    3336             case 'link-manager':
    3337             case 'link':
    3338                 if ( 'add' != $screen->action )
    3339                     $default_action = array('link-add.php' => array(__('New Link'), 'manage_links'));
    3340                 else
    3341                     $default_action = array('link-manager.php' => array(__('Edit Links'), 'manage_links'));
    3342                 break;
    3343             case 'users':
    3344                 $default_action = array('user-new.php' => array(__('New User'), 'create_users'));
    3345                 break;
    3346             case 'user':
    3347                 $default_action = array('users.php' => array(__('Edit Users'), 'edit_users'));
    3348                 break;
    3349             case 'plugins':
    3350                 $default_action = array('plugin-install.php' => array(__('Install Plugins'), 'install_plugins'));
    3351                 break;
    3352             case 'plugin-install':
    3353                 $default_action = array('plugins.php' => array(__('Manage Plugins'), 'activate_plugins'));
    3354                 break;
    3355             case 'themes':
    3356                 $default_action = array('theme-install.php' => array(__('Install Themes'), 'install_themes'));
    3357                 break;
    3358             case 'theme-install':
    3359                 $default_action = array('themes.php' => array(__('Manage Themes'), 'switch_themes'));
    3360                 break;
    3361             default:
    3362                 $default_action = array('post-new.php' => array(__('New Post'), 'edit_posts'));
    3363                 break;
     3329        if ( $screen->is_network ) {
     3330            $default_action = array('sites.php' => array( __('Sites'), 'manage_sites'));
     3331        } else {
     3332            switch ( $screen->id ) {
     3333                case 'upload':
     3334                    $default_action = array('media-new.php' => array(__('New Media'), 'upload_files'));
     3335                    break;
     3336                case 'media':
     3337                    $default_action = array('upload.php' => array(__('Edit Media'), 'upload_files'));
     3338                    break;
     3339                case 'link-manager':
     3340                case 'link':
     3341                    if ( 'add' != $screen->action )
     3342                        $default_action = array('link-add.php' => array(__('New Link'), 'manage_links'));
     3343                    else
     3344                        $default_action = array('link-manager.php' => array(__('Edit Links'), 'manage_links'));
     3345                    break;
     3346                case 'users':
     3347                    $default_action = array('user-new.php' => array(__('New User'), 'create_users'));
     3348                    break;
     3349                case 'user':
     3350                    $default_action = array('users.php' => array(__('Edit Users'), 'edit_users'));
     3351                    break;
     3352                case 'plugins':
     3353                    $default_action = array('plugin-install.php' => array(__('Install Plugins'), 'install_plugins'));
     3354                    break;
     3355                case 'plugin-install':
     3356                    $default_action = array('plugins.php' => array(__('Manage Plugins'), 'activate_plugins'));
     3357                    break;
     3358                case 'themes':
     3359                    $default_action = array('theme-install.php' => array(__('Install Themes'), 'install_themes'));
     3360                    break;
     3361                case 'theme-install':
     3362                    $default_action = array('themes.php' => array(__('Manage Themes'), 'switch_themes'));
     3363                    break;
     3364                default:
     3365                    $default_action = array('post-new.php' => array(__('New Post'), 'edit_posts'));
     3366                    break;
     3367            }
    33643368        }
    33653369    }
    33663370
    3367     $actions = array(
    3368         'post-new.php' => array(__('New Post'), 'edit_posts'),
    3369         'edit.php?post_status=draft' => array(__('Drafts'), 'edit_posts'),
    3370         'post-new.php?post_type=page' => array(__('New Page'), 'edit_pages'),
    3371         'media-new.php' => array(__('Upload'), 'upload_files'),
    3372         'edit-comments.php' => array(__('Comments'), 'moderate_comments')
     3371    if ( !$screen->is_network ) {
     3372        $actions = array(
     3373            'post-new.php' => array(__('New Post'), 'edit_posts'),
     3374            'edit.php?post_status=draft' => array(__('Drafts'), 'edit_posts'),
     3375            'post-new.php?post_type=page' => array(__('New Page'), 'edit_pages'),
     3376            'media-new.php' => array(__('Upload'), 'upload_files'),
     3377            'edit-comments.php' => array(__('Comments'), 'moderate_comments')
     3378            );
     3379    } else {
     3380        $actions = array(
     3381            'sites.php' => array( __('Sites'), 'manage_sites'),
     3382            'users.php' => array( __('Users'), 'manage_network_users')
    33733383        );
     3384    }
    33743385
    33753386    $default_key = array_keys($default_action);
     
    39473958    }
    39483959
     3960    $current_screen->is_network = is_network_admin() ? true : false;
     3961
    39493962    $current_screen = apply_filters('current_screen', $current_screen);
    39503963}
Note: See TracChangeset for help on using the changeset viewer.