Make WordPress Core


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

More MS cleanups. props ocean90. see #12460

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;';
Note: See TracChangeset for help on using the changeset viewer.