WordPress.org

Make WordPress Core

Changeset 13953


Ignore:
Timestamp:
04/03/2010 12:10:44 AM (8 years ago)
Author:
nacin
Message:

More MS cleanups. props ocean90. see #12460

Location:
trunk/wp-admin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/ms-delete-site.php

    r13918 r13953  
    1717    }
    1818}
    19 
    20 $action = isset( $_POST['action'] ) ? $_POST['action'] : 'splash';
    2119
    2220$title = __( 'Delete Site' );
  • trunk/wp-admin/ms-options.php

    r13918 r13953  
    22require_once( './admin.php' );
    33
    4 if ( !is_multisite() )
     4if ( ! is_multisite() )
    55    wp_die( __( 'Multisite support is not enabled.' ) );
     6
     7if ( ! current_user_can( 'manage_network_options' ) )
     8    wp_die( __( 'You do not have permission to access this page.' ) );
    69
    710$title = __( 'Network Options' );
     
    912
    1013include( './admin-header.php' );
    11 
    12 if ( ! current_user_can( 'manage_network_options' ) )
    13     wp_die( __( 'You do not have permission to access this page.' ) );
    1414
    1515if (isset($_GET['updated'])) {
  • trunk/wp-admin/ms-sites.php

    r13918 r13953  
    55    wp_die( __( 'Multisite support is not enabled.' ) );
    66
     7if ( ! current_user_can( 'manage_sites' ) )
     8    wp_die( __( 'You do not have permission to access this page.' ) );
     9
    710$title = __( 'Sites' );
    811$parent_file = 'ms-admin.php';
     
    1114
    1215require_once( './admin-header.php' );
    13 
    14 if ( ! current_user_can( 'manage_sites' ) )
    15     wp_die( __( 'You do not have permission to access this page.' ) );
    1616
    1717$id = isset( $_GET['id'] ) ? intval( $_GET['id'] ) : 0;
     
    2323        switch ( $_GET['action'] ) {
    2424            case 'all_notspam':
    25                 _e( 'Sites mark as not spam.' );
     25                _e( 'Sites removed from spam.' );
    2626            break;
    2727            case 'all_spam':
    28                 _e( 'Sites mark as spam.' );
     28                _e( 'Sites marked as spam.' );
    2929            break;
    3030            case 'all_delete':
     
    5050            break;
    5151            case 'unspam':
    52                 _e( 'Site mark as not spam.' );
     52                _e( 'Site removed from spam.' );
    5353            break;
    5454            case 'spam':
    55                 _e( 'Site mark as spam.' );
     55                _e( 'Site marked as spam.' );
    5656            break;
    5757            case 'unmature':
    58                 _e( 'Site mark as not mature.' );
     58                _e( 'Site marked as not mature.' );
    5959            break;
    6060            case 'mature':
    61                 _e( 'Site mark as mature.' );
     61                _e( 'Site marked as mature.' );
    6262            break;
    6363            default:
     
    126126                            </td>
    127127                        </tr>
     128                        <?php if ( ! $is_main_site ) { ?>
    128129                        <tr class="form-field">
    129130                            <th scope="row"><?php _e( 'Archived' ); ?></th>
     
    134135                        </tr>
    135136                        <tr class="form-field">
    136                             <th scope="row"><?php _e( 'Mature' ); ?></th>
    137                             <td>
    138                                 <label><input type="radio" style="width:20px;" name="blog[mature]" value="1" <?php checked( $details->mature, 1 ); ?> /> <?php _e( 'Yes' ) ?></label>
    139                                 <label><input type="radio" style="width:20px;" name="blog[mature]" value="0" <?php checked( $details->mature, 0); ?> /> <?php _e( 'No' ) ?></label>
    140                             </td>
    141                         </tr>
    142                         <tr class="form-field">
    143137                            <th scope="row"><?php _e( 'Spam' ); ?></th>
    144138                            <td>
     
    154148                            </td>
    155149                        </tr>
     150                        <tr class="form-field">
     151                            <th scope="row"><?php _e( 'Mature' ); ?></th>
     152                            <td>
     153                                <label><input type="radio" style="width:20px;" name="blog[mature]" value="1" <?php checked( $details->mature, 1 ); ?> /> <?php _e( 'Yes' ) ?></label>
     154                                <label><input type="radio" style="width:20px;" name="blog[mature]" value="0" <?php checked( $details->mature, 0); ?> /> <?php _e( 'No' ) ?></label>
     155                            </td>
     156                        </tr>
     157                        <?php } ?>
    156158                    </table>
    157159                    <p class="submit" style="text-align:center;"><input type="submit" name="Submit" value="<?php esc_attr_e( 'Update Options' ) ?>" /></p>
     
    550552                                        echo '<p>' . sprintf( _x( '%1$s &#8211; <em>%2$s', '%1$s: site name. %2$s: site tagline.' ), get_blog_option( $blog['blog_id'], 'blogname' ), get_blog_option( $blog['blog_id'], 'blogdescription ' ) ) . '</em></p>';
    551553
    552                                     $actions    = array();
    553                                     $actions[]  = '<span class="edit"><a href="' . esc_url( admin_url( 'ms-sites.php?action=editblog&amp;id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a><span>';
    554                                     $actions[]  = "<span class='backend'><a href='" . esc_url( get_admin_url($blog['blog_id']) ) . "' class='edit'>" . __( 'Backend' ) . '</a></span>';
     554                                    // Preordered.
     555                                    $actions = array(
     556                                        'edit' => '', 'backend' => '',
     557                                        'activate' => '', 'deactivate' => '',
     558                                        'archive' => '', 'unarchive' => '',
     559                                        'spam' => '', 'unspam' => '',
     560                                        'delete' => '',
     561                                        'visit' => '',
     562                                    );
     563
     564                                    $actions['edit']    = '<span class="edit"><a href="' . esc_url( admin_url( 'ms-sites.php?action=editblog&amp;id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a><span>';
     565                                    $actions['backend'] = "<span class='backend'><a href='" . esc_url( get_admin_url($blog['blog_id']) ) . "' class='edit'>" . __( 'Backend' ) . '</a></span>';
    555566                                    if ( $current_site->blog_id != $blog['blog_id'] ) {
    556567                                        if ( get_blog_status( $blog['blog_id'], 'deleted' ) == '1' )
    557                                             $actions[]  = '<span class="activate"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=activateblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to activate the site %s" ), $blogname ) ) ) ) . '">' . __( 'Activate' ) . '</a></span>';
     568                                            $actions['activate']    = '<span class="activate"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=activateblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to activate the site %s" ), $blogname ) ) ) ) . '">' . __( 'Activate' ) . '</a></span>';
    558569                                        else
    559                                             $actions[]  = '<span class="activate"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=deactivateblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to deactivate the site %s" ), $blogname ) ) ) ) . '">' . __( 'Deactivate' ) . '</a></span>';
    560    
     570                                            $actions['deactivate']  = '<span class="activate"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=deactivateblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to deactivate the site %s" ), $blogname ) ) ) ) . '">' . __( 'Deactivate' ) . '</a></span>';
     571
    561572                                        if ( get_blog_status( $blog['blog_id'], 'archived' ) == '1' )
    562                                             $actions[]  = '<span class="archive"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=unarchiveblog&amp;id=' .  $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to unarchive the site %s." ), $blogname ) ) ) ) . '">' . __( 'Unarchive' ) . '</a></span>';
     573                                            $actions['unarchive']   = '<span class="archive"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=unarchiveblog&amp;id=' .  $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to unarchive the site %s." ), $blogname ) ) ) ) . '">' . __( 'Unarchive' ) . '</a></span>';
    563574                                        else
    564                                             $actions[]  = '<span class="archive"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=archiveblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to archive the site %s." ), $blogname ) ) ) ) . '">' . __( 'Archive' ) . '</a></span>';
    565    
     575                                            $actions['archive'] = '<span class="archive"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=archiveblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to archive the site %s." ), $blogname ) ) ) ) . '">' . __( 'Archive' ) . '</a></span>';
     576
    566577                                        if ( get_blog_status( $blog['blog_id'], 'spam' ) == '1' )
    567                                             $actions[]  = '<span class="spam"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=unspamblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to unspam the site %s." ), $blogname ) ) ) ) . '">' . __( 'Not Spam' ) . '</a></span>';
     578                                            $actions['unspam']  = '<span class="spam"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=unspamblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to unspam the site %s." ), $blogname ) ) ) ) . '">' . __( 'Not Spam' ) . '</a></span>';
    568579                                        else
    569                                             $actions[]  = '<span class="spam"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=spamblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to mark the site %s as spam." ), $blogname ) ) ) ) . '">' . __( 'Spam' ) . '</a></span>';
    570    
    571                                         if ( get_blog_status( $blog['blog_id'], 'mature' ) == '1' )
    572                                             $actions[]  = '<span class="mature"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=unmatureblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to unmature the site %s." ), $blogname ) ) ) ) . '">' . __( 'Not Mature' ) . '</a></span>';
    573                                         else
    574                                             $actions[]  = '<span class="mature"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=matureblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to mark the site %s as mature." ), $blogname ) ) ) ) . '">' . __( 'Mature' ) . '</a></span>';
    575    
    576                                         $actions[]  = '<span class="delete"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=deleteblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to delete the site %s." ), $blogname ) ) ) ) . '">' . __( 'Delete' ) . '</a></span>';
     580                                            $actions['spam']    = '<span class="spam"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=spamblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to mark the site %s as spam." ), $blogname ) ) ) ) . '">' . __( 'Spam' ) . '</a></span>';
     581
     582                                        $actions['delete']  = '<span class="delete"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;action2=deleteblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to delete the site %s." ), $blogname ) ) ) ) . '">' . __( 'Delete' ) . '</a></span>';
    577583                                    }
    578584
    579                                     $actions[]  = "<span class='view'><a href='" . esc_url( get_home_url( $blog['blog_id'] ) ) . "' rel='permalink'>" . __( 'Visit' ) . '</a>';
    580 
     585                                    $actions['visit']   = "<span class='view'><a href='" . esc_url( get_home_url( $blog['blog_id'] ) ) . "' rel='permalink'>" . __( 'Visit' ) . '</a>';
     586                                    $actions = array_filter( $actions );
    581587                                    if ( count( $actions ) ) : ?>
    582588                                    <div class="row-actions">
     
    601607                        case 'registered': ?>
    602608                                <td valign="top">
    603                                 <?php 
     609                                <?php
    604610                                if ( $blog['registered'] == '0000-00-00 00:00:00' )
    605611                                    echo '&#x2014;';
  • trunk/wp-admin/ms-themes.php

    r13918 r13953  
    11<?php
    22require_once( './admin.php' );
     3
     4if ( ! current_user_can( 'manage_network_themes' ) )
     5    wp_die( __( 'You do not have permission to access this page.' ) );
    36
    47$title = __( 'Network Themes' );
    58$parent_file = 'ms-admin.php';
    69require_once( './admin-header.php' );
    7 
    8 if ( ! current_user_can( 'manage_network_themes' ) )
    9     wp_die( __( 'You do not have permission to access this page.' ) );
    1010
    1111if ( isset( $_GET['updated'] ) ) {
  • trunk/wp-admin/ms-users.php

    r13941 r13953  
    55    wp_die( __( 'Multisite support is not enabled.' ) );
    66
     7if ( ! current_user_can( 'manage_network_users' ) )
     8    wp_die( __( 'You do not have permission to access this page.' ) );
     9
    710$title = __( 'Users' );
    811$parent_file = 'ms-admin.php';
     
    1114
    1215require_once( './admin-header.php' );
    13 
    14 if ( ! current_user_can( 'manage_network_users' ) )
    15     wp_die( __( 'You do not have permission to access this page.' ) );
    1616
    1717if ( isset( $_GET['updated'] ) && $_GET['updated'] == 'true' && ! empty( $_GET['action'] ) ) {
     
    2727            break;
    2828            case 'all_notspam':
    29                 _e( 'Users marked as not spam.' );
     29                _e( 'Users removed from spam.' );
    3030            break;
    3131            case 'all_delete':
Note: See TracChangeset for help on using the changeset viewer.