Ticket #590: part1.patch

File part1.patch, 29.3 kB (added by momo360modena, 6 months ago)

Site Admin WPmu 1.5 Part 1/2

  • users.php

    old new  
    505505 
    506506<?php if( apply_filters('show_adduser_fields', true) ) {?> 
    507507<div class="wrap"> 
    508 <h2 id="add-new-user"><?php _e('Add User From Community') ?></h2> 
     508<h2 id="add-new-user"><?php _e('Add user from community') ?></h2> 
    509509<div class="narrow"> 
    510510<form action="" method="post" name="adduser" id="adduser"> 
    511511<?php wp_nonce_field('add-user') ?> 
    512512<input type='hidden' name='action' value='addexistinguser'> 
    513513<p><?php _e('Type the e-mail address of another user to add them to your blog.')?></p> 
    514 <table> 
    515 <tr><th scope="row"><?php _e('User&nbsp;E-Mail:')?> </th><td><input type="text" name="newuser" id="newuser"></td></tr> 
    516         <tr> 
     514 
     515<table class="form-table"> 
     516        <tr class="form-field form-required"> 
     517                <th scope="row"><?php _e('User&nbsp;E-Mail')?></th> 
     518                <td><input type="text" name="newuser" id="newuser" /></td> 
     519        </tr> 
     520        <tr class="form-field"> 
    517521                <th scope="row"><?php _e('Role:') ?></th> 
    518                 <td><select name="new_role" id="new_role"><?php  
    519                 foreach($wp_roles->role_names as $role => $name) { 
    520                         $selected = ''; 
    521                         if( $role == 'subscriber' ) 
    522                                 $selected = 'selected="selected"'; 
    523                         echo "<option {$selected} value=\"{$role}\">{$name}</option>"; 
    524                 } 
    525                 ?></select></td> 
     522                        <td> 
     523                        <select name="new_role" id="new_role"> 
     524                                <?php wp_dropdown_roles('subscriber'); ?> 
     525                        </select> 
     526                </td> 
    526527        </tr> 
    527528</table> 
    528529<p class="submit"> 
  • wpmu-options.php

    old new  
    1 <?php 
    2 require_once('admin.php'); 
    3 $title = __('WordPress MU &rsaquo; Admin &rsaquo; Site Options'); 
    4 $parent_file = 'wpmu-admin.php'; 
    5  
    6 include('admin-header.php'); 
    7  
    8 if( is_site_admin() == false ) { 
    9     wp_die( __('<p>You do not have permission to access this page.</p>') ); 
    10 
    11  
    12 if (isset($_GET['updated'])) { 
    13         ?> 
    14         <div id="message" class="updated fade"><p><?php _e('Options saved.') ?></p></div> 
    15         <?php 
    16 
    17 ?> 
    18  
    19 <div class="wrap">  
    20         <h2><?php _e('Site Options') ?></h2>  
    21         <form method="post" action="wpmu-edit.php?action=siteoptions">   
    22                 <?php wp_nonce_field( "siteoptions" ); ?> 
    23                  
    24                 <fieldset class="options"> 
    25                         <legend><?php _e('Operational Settings <em>(These settings cannot be modified by blog owners)</em>') ?></legend>  
    26                         <table width="100%" cellspacing="2" cellpadding="5" class="editform">  
    27                                 <tr valign="top">  
    28                                         <th scope="row"><?php _e('Site Name:') ?></th>  
    29                                         <td> 
    30                                                 <input name="site_name" type="text" id="site_name" style="width: 95%" value="<?php echo $current_site->site_name ?>" size="45" /> 
    31                                                 <br /> 
    32                                                 <?php _e('What you would like to call this website.') ?> 
    33                                         </td>  
    34                                 </tr>  
    35                                  
    36                                 <tr valign="top">  
    37                                         <th scope="row"><?php _e('Site Admin Email:') ?></th>  
    38                                         <td> 
    39                                                 <input name="admin_email" type="text" id="admin_email" style="width: 95%" value="<?php echo stripslashes( get_site_option('admin_email') ) ?>" size="45" /> 
    40                                                 <br /> 
    41                                                 <?php printf( __( 'Registration and support mails will come from this address. Make it generic like "support@%s"' ), $current_site->domain ); ?> 
    42                                         </td> 
    43                                 </tr>  
    44                                  
    45                                 <tr valign="top">  
    46                                         <th scope="row"><?php _e('Allow new registrations') ?></th>  
    47                                         <?php 
    48                                         if( !get_site_option('registration') ) 
    49                                                 update_site_option( 'registration', 'all' ); 
    50                                         ?> 
    51                                         <td> 
    52                                                 <label><input name="registration" type="radio" id="registration1" value='none' <?php echo get_site_option('registration') == 'none' ? 'checked="checked"' : ''; ?> /> <?php _e('Disabled'); ?></label><br /> 
    53                                                 <label><input name="registration" type="radio" id="registration2" value='all' <?php echo get_site_option('registration') == 'all' ? 'checked="checked"' : ''; ?> /> <?php _e('Enabled for all. Blogs and user accounts can be created.'); ?></label><br /> 
    54                                                 <label><input name="registration" type="radio" id="registration3" value='user' <?php echo get_site_option('registration') == 'user' ? 'checked="checked"' : ''; ?> /> <?php _e('Enabled for users only. Only user account can be created.'); ?></label><br /> 
    55                                                 <label><input name="registration" type="radio" id="registration4" value='blog' <?php echo get_site_option('registration') == 'blog' ? 'checked="checked"' : ''; ?> /> <?php _e('Enabled for blogs only. Only logged in users can create new blogs.'); ?></label><br /> 
    56                                                 <?php _e('Disable or enable registration and who or what can be registered. (Default=all)') ?> 
    57                                         </td>  
    58                                 </tr>  
    59                                  
    60                                 <tr valign="top">  
    61                                         <th scope="row"><?php _e('Registration notification') ?></th>  
    62                                         <?php 
    63                                         if( !get_site_option('registrationnotification') ) 
    64                                                 update_site_option( 'registrationnotification', 'yes' ); 
    65                                         ?> 
    66                                         <td> 
    67                                                 <input name="registrationnotification" type="radio" id="registrationnotification1" value='yes' <?php echo get_site_option('registrationnotification') == 'yes' ? 'checked="checked"' : ''; ?> /> <?php _e('Yes'); ?><br /> 
    68                                                 <input name="registrationnotification" type="radio" id="registrationnotification2" value='no' <?php echo get_site_option('registrationnotification') == 'no' ? 'checked="checked"' : ''; ?> /> <?php _e('No'); ?><br /> 
    69                                                 <?php _e('Send the site admin an email notification every time someone registers a blog or user account.') ?> 
    70                                         </td>  
    71                                 </tr>  
    72                                  
    73                                 <tr valign="top">  
    74                                         <th scope="row"><?php _e('Welcome Email:') ?></th>  
    75                                         <td> 
    76                                                 <textarea name="welcome_email" id="welcome_email" rows='5' cols='45' style="width: 95%"><?php echo stripslashes( get_site_option('welcome_email') ) ?></textarea> 
    77                                                 <br /> 
    78                                                 <?php _e('The welcome email sent to new blog owners.') ?> 
    79                                         </td>  
    80                                 </tr>  
    81                                  
    82                                 <tr valign="top">  
    83                                         <th scope="row"><?php _e('First Post:') ?></th>  
    84                                         <td> 
    85                                                 <textarea name="first_post" id="first_post" rows='5' cols='45' style="width: 95%"><?php echo stripslashes( get_site_option('first_post') ) ?></textarea> 
    86                                                 <br /> 
    87                                                 <?php _e('First post on a new blog.') ?> 
    88                                         </td>  
    89                                 </tr>  
    90                                  
    91                                 <tr valign="top">  
    92                                         <th scope="row"><?php _e('Banned Names:') ?></th>  
    93                                         <td> 
    94                                                 <input name="illegal_names" type="text" id="illegal_names" style="width: 95%" value="<?php echo implode( " ", get_site_option('illegal_names') ); ?>" size="45" /> 
    95                                                 <br /> 
    96                                                 <?php _e('Users are not allowed to register these blogs. Separate names by spaces.') ?> 
    97                                         </td>  
    98                                 </tr>  
    99                                  
    100                                 <tr valign="top"> 
    101                                         <th scope="row"><?php _e('Limited Email Registrations:') ?></th>  
    102                                         <td> 
    103                                                 <input name="limited_email_domains" type="text" id="limited_email_domains" style="width: 95%" value="<?php echo get_site_option('limited_email_domains') == '' ? '' : @implode( " ", get_site_option('limited_email_domains') ); ?>" size="45" /> 
    104                                                 <br /> 
    105                                                 <?php _e('If you want to limit blog registrations to certain domains. Separate domains by spaces.') ?> 
    106                                         </td>  
    107                                 </tr>  
    108                                  
    109                                 <tr valign="top">  
    110                                         <th scope="row"><?php _e('Banned Email Domains:') ?></th>  
    111                                         <td> 
    112                                                 <textarea name="banned_email_domains" id="banned_email_domains" cols='40' rows='5'><?php echo get_site_option('banned_email_domains') == '' ? '' : @implode( "\n", get_site_option('banned_email_domains') ); ?></textarea> 
    113                                                 <br /> 
    114                                                 <?php _e('If you want to ban certain email domains from blog registrations. One domain per line.') ?> 
    115                                         </td>  
    116                                 </tr> 
    117                                  
    118                                 <tr valign="top">  
    119                                         <th scope="row"><?php _e('Blog upload space:') ?></th>  
    120                                         <td><input name="blog_upload_space" type="text" id="blog_upload_space" value="<?php echo get_site_option('blog_upload_space', 10) ?>" size="3" /> MB</td> 
    121                                 </tr> 
    122                                  
    123                                 <tr valign="top">  
    124                                         <th scope="row"><?php _e('Upload File Types:') ?></th>  
    125                                         <td><input name="upload_filetypes" type="text" id="upload_filetypes" value="<?php echo get_site_option('upload_filetypes', 'jpg jpeg png gif') ?>" size="45" /></td> 
    126                                 </tr> 
    127                                  
    128                                 <tr valign="top">  
    129                                         <th scope="row"><?php _e('Max upload file size:') ?></th>  
    130                                         <td><input name="fileupload_maxk" type="text" id="fileupload_maxk" value="<?php echo get_site_option('fileupload_maxk', 300) ?>" size="5" /> KB</td> 
    131                                 </tr>  
    132                         </table> 
    133                 </fieldset> 
    134                  
    135                 <fieldset class="options"> 
    136                         <legend><?php _e('Administration Settings') ?></legend>  
    137                         <table width="100%" cellspacing="2" cellpadding="5" class="editform">  
    138                                 <tr valign="top">  
    139                                         <th scope="row"><?php _e('Site Admins:') ?></th>  
    140                                         <td> 
    141                                                 <input name="site_admins" type="text" id="site_admins" style="width: 95%" value="<?php echo implode(' ', get_site_option( 'site_admins', array( 'admin' ) ) ) ?>" size="45" /> 
    142                                                 <br /> 
    143                                                 <?php _e('These users may login to the main blog and administer the site. Space separated list of usernames.') ?> 
    144                                         </td>  
    145                                 </tr>  
    146                         </table> 
    147                 </fieldset> 
    148                  
    149                 <fieldset class="options"> 
    150                         <legend><?php _e('Site Wide Settings <em>(These settings may be overridden by blog owners)</em>') ?></legend>  
    151                         <table width="100%" cellspacing="2" cellpadding="5" class="editform">  
    152                                 <?php 
    153                                 $lang_files = glob( ABSPATH . LANGDIR . '/*.mo' ); 
    154                                 $lang = get_site_option('WPLANG'); 
    155                                 if( is_array( $lang_files ) ) { 
    156                                         ?> 
    157                                         <tr valign="top">  
    158                                                 <th width="33%" scope="row"><?php _e('Default Language:') ?></th>  
    159                                                 <td> 
    160                                                         <select name="WPLANG" id="WPLANG"> 
    161                                                         <?php 
    162                                                         echo '<option value=""'.((empty($lang)) ? ' selected="selected"' : '').'>'.__('English')."</option>"; 
    163                                                         foreach ( (array) $lang_files as $key => $val ) { 
    164                                                                 $code_lang = basename( $val, '.mo' ); 
    165                                                                 echo '<option value="'.$code_lang.'"'.(($lang == $code_lang) ? ' selected="selected"' : '').'> '.format_code_lang($code_lang).'</option>'; 
    166                                                         } 
    167                                                         ?> 
    168                                                         </select> 
    169                                                 </td> 
    170                                         </tr>  
    171                                         <?php 
    172                                 } // languages 
    173                                 ?> 
    174                         </table> 
    175                 </fieldset> 
    176                  
    177                 <fieldset class="options"> 
    178                         <legend><?php _e('Menus <em>(Enable or disable WP Backend Menus)</em>') ?></legend>  
    179                         <table cellspacing="2" cellpadding="5" class="editform">  
    180                                 <tr> 
    181                                         <th scope='row'><?php _e("Menu"); ?></th> 
    182                                         <th scope='row'><?php _e("Enabled"); ?></th> 
    183                                 </tr> 
    184                                 <?php 
    185                                 $menu_perms = get_site_option( "menu_items" ); 
    186                                 $menu_items = array('plugins'); 
    187                                 foreach ( (array) $menu_items as $key => $val ) { 
    188                                         $checked = ( $menu_perms[$val] == '1' ) ? ' checked="checked"' : ''; 
    189                                         echo "<tr><th scope='row'>" . ucfirst( $val ) . "</th><td><input type='checkbox' name='menu_items[" . $val . "]' value='1'" . $checked . " /></td></tr>";  
    190                                 } 
    191                                 ?> 
    192                         </table> 
    193                 </fieldset> 
    194  
    195                 <?php 
    196                 // Add more options here 
    197                 do_action( 'wpmu_options' ); 
    198                 ?> 
    199                  
    200                 <p class="submit">  
    201                         <input type="submit" name="Submit" value="<?php _e('Update Options') ?>" /></p>  
    202         </form>  
    203 </div> 
    204  
    205 <?php include('./admin-footer.php'); ?> 
     1<?php 
     2require_once('admin.php'); 
     3$title = __('WordPress MU &rsaquo; Admin &rsaquo; Site Options'); 
     4$parent_file = 'wpmu-admin.php'; 
     5 
     6include('admin-header.php'); 
     7 
     8if( is_site_admin() == false ) { 
     9    wp_die( __('<p>You do not have permission to access this page.</p>') ); 
     10
     11 
     12if (isset($_GET['updated'])) { 
     13        ?> 
     14        <div id="message" class="updated fade"><p><?php _e('Options saved.') ?></p></div> 
     15        <?php 
     16
     17?> 
     18 
     19<div class="wrap">  
     20        <h2><?php _e('Site Options') ?></h2>  
     21        <form method="post" action="wpmu-edit.php?action=siteoptions">   
     22                <?php wp_nonce_field( "siteoptions" ); ?> 
     23                 
     24                <h3><?php _e('Operational Settings <em>(These settings cannot be modified by blog owners)</em>') ?></h3>  
     25                <table class="form-table"> 
     26                        <tr valign="top">  
     27                                <th scope="row"><?php _e('Site Name') ?></th>  
     28                                <td> 
     29                                        <input name="site_name" type="text" id="site_name" style="width: 95%" value="<?php echo $current_site->site_name ?>" size="45" /> 
     30                                        <br /> 
     31                                        <?php _e('What you would like to call this website.') ?> 
     32                                </td>  
     33                        </tr>  
     34                         
     35                        <tr valign="top">  
     36                                <th scope="row"><?php _e('Site Admin Email') ?></th>  
     37                                <td> 
     38                                        <input name="admin_email" type="text" id="admin_email" style="width: 95%" value="<?php echo stripslashes( get_site_option('admin_email') ) ?>" size="45" /> 
     39                                        <br /> 
     40                                        <?php printf( __( 'Registration and support mails will come from this address. Make it generic like "support@%s"' ), $current_site->domain ); ?> 
     41                                </td> 
     42                        </tr>  
     43                         
     44                        <tr valign="top">  
     45                                <th scope="row"><?php _e('Allow new registrations') ?></th>  
     46                                <?php 
     47                                if( !get_site_option('registration') ) 
     48                                        update_site_option( 'registration', 'all' ); 
     49                                ?> 
     50                                <td> 
     51                                        <label><input name="registration" type="radio" id="registration1" value='none' <?php echo get_site_option('registration') == 'none' ? 'checked="checked"' : ''; ?> /> <?php _e('Disabled'); ?></label><br /> 
     52                                        <label><input name="registration" type="radio" id="registration2" value='all' <?php echo get_site_option('registration') == 'all' ? 'checked="checked"' : ''; ?> /> <?php _e('Enabled for all. Blogs and user accounts can be created.'); ?></label><br /> 
     53                                        <label><input name="registration" type="radio" id="registration3" value='user' <?php echo get_site_option('registration') == 'user' ? 'checked="checked"' : ''; ?> /> <?php _e('Enabled for users only. Only user account can be created.'); ?></label><br /> 
     54                                        <label><input name="registration" type="radio" id="registration4" value='blog' <?php echo get_site_option('registration') == 'blog' ? 'checked="checked"' : ''; ?> /> <?php _e('Enabled for blogs only. Only logged in users can create new blogs.'); ?></label><br /> 
     55                                        <?php _e('Disable or enable registration and who or what can be registered. (Default=all)') ?> 
     56                                </td>  
     57                        </tr>  
     58                         
     59                        <tr valign="top">  
     60                                <th scope="row"><?php _e('Registration notification') ?></th>  
     61                                <?php 
     62                                if( !get_site_option('registrationnotification') ) 
     63                                        update_site_option( 'registrationnotification', 'yes' ); 
     64                                ?> 
     65                                <td> 
     66                                        <input name="registrationnotification" type="radio" id="registrationnotification1" value='yes' <?php echo get_site_option('registrationnotification') == 'yes' ? 'checked="checked"' : ''; ?> /> <?php _e('Yes'); ?><br /> 
     67                                        <input name="registrationnotification" type="radio" id="registrationnotification2" value='no' <?php echo get_site_option('registrationnotification') == 'no' ? 'checked="checked"' : ''; ?> /> <?php _e('No'); ?><br /> 
     68                                        <?php _e('Send the site admin an email notification every time someone registers a blog or user account.') ?> 
     69                                </td>  
     70                        </tr>  
     71                         
     72                        <tr valign="top">  
     73                                <th scope="row"><?php _e('Welcome Email') ?></th>  
     74                                <td> 
     75                                        <textarea name="welcome_email" id="welcome_email" rows='5' cols='45' style="width: 95%"><?php echo stripslashes( get_site_option('welcome_email') ) ?></textarea> 
     76                                        <br /> 
     77                                        <?php _e('The welcome email sent to new blog owners.') ?> 
     78                                </td>  
     79                        </tr>  
     80                         
     81                        <tr valign="top">  
     82                                <th scope="row"><?php _e('First Post') ?></th>  
     83                                <td> 
     84                                        <textarea name="first_post" id="first_post" rows='5' cols='45' style="width: 95%"><?php echo stripslashes( get_site_option('first_post') ) ?></textarea> 
     85                                        <br /> 
     86                                        <?php _e('First post on a new blog.') ?> 
     87                                </td>  
     88                        </tr>  
     89                         
     90                        <tr valign="top">  
     91                                <th scope="row"><?php _e('Banned Names') ?></th>  
     92                                <td> 
     93                                        <input name="illegal_names" type="text" id="illegal_names" style="width: 95%" value="<?php echo implode( " ", get_site_option('illegal_names') ); ?>" size="45" /> 
     94                                        <br /> 
     95                                        <?php _e('Users are not allowed to register these blogs. Separate names by spaces.') ?> 
     96                                </td>  
     97                        </tr>  
     98                         
     99                        <tr valign="top"> 
     100                                <th scope="row"><?php _e('Limited Email Registrations') ?></th>  
     101                                <td> 
     102                                        <input name="limited_email_domains" type="text" id="limited_email_domains" style="width: 95%" value="<?php echo get_site_option('limited_email_domains') == '' ? '' : @implode( " ", get_site_option('limited_email_domains') ); ?>" size="45" /> 
     103                                        <br /> 
     104                                        <?php _e('If you want to limit blog registrations to certain domains. Separate domains by spaces.') ?> 
     105                                </td>  
     106                        </tr>  
     107                         
     108                        <tr valign="top">  
     109                                <th scope="row"><?php _e('Banned Email Domains') ?></th>  
     110                                <td> 
     111                                        <textarea name="banned_email_domains" id="banned_email_domains" cols='40' rows='5'><?php echo get_site_option('banned_email_domains') == '' ? '' : @implode( "\n", get_site_option('banned_email_domains') ); ?></textarea> 
     112                                        <br /> 
     113                                        <?php _e('If you want to ban certain email domains from blog registrations. One domain per line.') ?> 
     114                                </td>  
     115                        </tr> 
     116                         
     117                        <tr valign="top">  
     118                                <th scope="row"><?php _e('Blog upload space') ?></th>  
     119                                <td><input name="blog_upload_space" type="text" id="blog_upload_space" value="<?php echo get_site_option('blog_upload_space', 10) ?>" size="3" /> MB</td> 
     120                        </tr> 
     121                         
     122                        <tr valign="top">  
     123                                <th scope="row"><?php _e('Upload File Types') ?></th>  
     124                                <td><input name="upload_filetypes" type="text" id="upload_filetypes" value="<?php echo get_site_option('upload_filetypes', 'jpg jpeg png gif') ?>" size="45" /></td> 
     125                        </tr> 
     126                         
     127                        <tr valign="top">  
     128                                <th scope="row"><?php _e('Max upload file size') ?></th>  
     129                                <td><input name="fileupload_maxk" type="text" id="fileupload_maxk" value="<?php echo get_site_option('fileupload_maxk', 300) ?>" size="5" /> KB</td> 
     130                        </tr>  
     131                </table> 
     132                 
     133                <h3><?php _e('Administration Settings') ?></h3>          
     134                <table class="form-table"> 
     135                        <tr valign="top">  
     136                                <th scope="row"><?php _e('Site Admins') ?></th>  
     137                                <td> 
     138                                        <input name="site_admins" type="text" id="site_admins" style="width: 95%" value="<?php echo implode(' ', get_site_option( 'site_admins', array( 'admin' ) ) ) ?>" size="45" /> 
     139                                        <br /> 
     140                                        <?php _e('These users may login to the main blog and administer the site. Space separated list of usernames.') ?> 
     141                                </td>  
     142                        </tr>  
     143                </table> 
     144                 
     145                <h3><?php _e('Site Wide Settings <em>(These settings may be overridden by blog owners)</em>') ?></h3>  
     146                <table class="form-table"> 
     147                        <?php 
     148                        $lang_files = glob( ABSPATH . LANGDIR . '/*.mo' ); 
     149                        $lang = get_site_option('WPLANG'); 
     150                        if( is_array( $lang_files ) ) { 
     151                                ?> 
     152                                <tr valign="top">  
     153                                        <th width="33%"><?php _e('Default Language') ?></th>  
     154                                        <td> 
     155                                                <select name="WPLANG" id="WPLANG"> 
     156                                                <?php 
     157                                                echo '<option value=""'.((empty($lang)) ? ' selected="selected"' : '').'>'.__('English')."</option>"; 
     158                                                foreach ( (array) $lang_files as $key => $val ) { 
     159                                                        $code_lang = basename( $val, '.mo' ); 
     160                                                        echo '<option value="'.$code_lang.'"'.(($lang == $code_lang) ? ' selected="selected"' : '').'> '.format_code_lang($code_lang).'</option>'; 
     161                                                } 
     162                                                ?> 
     163                                                </select> 
     164                                        </td> 
     165                                </tr>  
     166                                <?php 
     167                        } // languages 
     168                        ?> 
     169                </table> 
     170                 
     171                <h3><?php _e('Menus <em>(Enable or disable WP Backend Menus)</em>') ?></h3>  
     172                <table class="form-table"> 
     173                        <tr> 
     174                                <th scope="row"><?php _e("Menu"); ?></th> 
     175                                <th scope="row"><?php _e("Enabled"); ?></th> 
     176                        </tr> 
     177                        <?php 
     178                        $menu_perms = get_site_option( "menu_items" ); 
     179                        $menu_items = array('plugins'); 
     180                        foreach ( (array) $menu_items as $key => $val ) { 
     181                                $checked = ( $menu_perms[$val] == '1' ) ? ' checked="checked"' : ''; 
     182                                echo "<tr><th scope='row'>" . ucfirst( $val ) . "</th><td><input type='checkbox' name='menu_items[" . $val . "]' value='1'" . $checked . " /></td></tr>";  
     183                        } 
     184                        ?> 
     185                </table> 
     186 
     187                <?php do_action( 'wpmu_options' ); // Add more options here ?> 
     188                 
     189                <p class="submit">  
     190                        <input type="submit" name="Submit" value="<?php _e('Update Options') ?>" /></p>  
     191        </form>  
     192</div> 
     193 
     194<?php include('./admin-footer.php'); ?> 
  • wpmu-themes.php

    old new  
    1 <?php 
    2 require_once('admin.php'); 
    3  
    4 $title = __('WordPress MU &rsaquo; Admin &rsaquo; Themes'); 
    5 $parent_file = 'wpmu-admin.php'; 
    6 require_once('admin-header.php'); 
    7  
    8 if( is_site_admin() == false ) { 
    9         wp_die( __('<p>You do not have permission to access this page.</p>') ); 
    10 
    11  
    12 if (isset($_GET['updated'])) { 
    13         ?> 
    14         <div id="message" class="updated fade"><p><?php _e('Site themes saved.') ?></p></div> 
    15         <?php 
    16 
    17  
    18 $themes = get_themes(); 
    19 $allowed_themes = get_site_allowed_themes(); 
    20 ?> 
    21 <div class="wrap"> 
    22         <form action='wpmu-edit.php?action=updatethemes' method='post'> 
    23                 <h2><?php _e('Site Themes') ?></h2> 
    24                 <p><?php _e('Disable themes site-wide. You can enable themes on a blog by blog basis.') ?></p>           
    25                 <table style="border:0; width:100%;" cellspacing="5" cellpadding="5"> 
    26                         <thead> 
    27                         <tr> 
    28                                 <th style="width:15%;"><?php _e('Active') ?></th> 
    29                                 <th style="width:15%;"><?php _e('Theme') ?></th> 
    30                                 <th style="width:70%;"><?php _e('Description') ?></th> 
    31                         </tr> 
    32                         </thead> 
    33                         <tbody id="the-list"> 
    34                         <?php 
    35                         foreach( (array) $themes as $key => $theme ) : 
    36                                 $theme_key = wp_specialchars($theme['Stylesheet']); 
    37                                 $class = ('alternate' == $class) ? '' : 'alternate'; 
    38                                 $enabled = $disabled = ''; 
    39                                  
    40                                 if( isset( $allowed_themes[ $theme_key ] ) == true ) { 
    41                                         $enabled = 'checked="checked" '; 
    42                                 } else { 
    43                                         $disabled = 'checked="checked" '; 
    44                                 } 
    45                                 ?> 
    46                                 <tr valign="top" class="<?php echo $class; ?>"> 
    47                                         <td style="text-align:center;"> 
    48                                                 <label><input name="theme[<?php echo $theme_key ?>]" type="radio" id="disabled_<?php echo $theme_key ?>" value="disabled" <?php echo $disabled ?> /> <?php _e('No') ?></label> 
    49                                                 &nbsp;&nbsp;&nbsp;  
    50                                                 <label><input name="theme[<?php echo $theme_key ?>]" type="radio" id="enabled_<?php echo $theme_key ?>" value="enabled" <?php echo $enabled ?> /> <?php _e('Yes') ?></label> 
    51                                         </td> 
    52                                         <th scope="row" style="text-align:left;"><?php echo $key ?></th>  
    53                                         <td><?php echo $theme['Description'] ?></td> 
    54                                 </tr>  
    55                         <?php endforeach; ?> 
    56                         </tbody> 
    57                 </table> 
    58                  
    59                 <p class="submit"> 
    60                         <input type='submit' value='<?php _e('Update Themes &raquo;') ?>' /></p> 
    61         </form> 
    62 </div> 
    63  
    64 <?php include('admin-footer.php'); ?> 
     1<?php 
     2require_once('admin.php'); 
     3 
     4$title = __('WordPress MU &rsaquo; Admin &rsaquo; Themes'); 
     5$parent_file = 'wpmu-admin.php'; 
     6require_once('admin-header.php'); 
     7 
     8if( is_site_admin() == false ) { 
     9        wp_die( __('<p>You do not have permission to access this page.</p>') ); 
     10
     11 
     12if (isset($_GET['updated'])) { 
     13        ?> 
     14        <div id="message" class="updated fade"><p><?php _e('Site themes saved.') ?></p></div> 
     15        <?php 
     16
     17 
     18$themes = get_themes(); 
     19$allowed_themes = get_site_allowed_themes(); 
     20?> 
     21<div class="wrap"> 
     22        <form action='wpmu-edit.php?action=updatethemes' method='post'> 
     23                <h2><?php _e('Site Themes') ?></h2> 
     24                <p><?php _e('Disable themes site-wide. You can enable themes on a blog by blog basis.') ?></p>           
     25                <table class="widefat"> 
     26                        <thead> 
     27                                <tr> 
     28                                        <th style="width:15%;text-align:center;"><?php _e('Active') ?></th> 
     29                                        <th style="width:25%;"><?php _e('Theme') ?></th> 
     30                                        <th style="width:60%;"><?php _e('Description') ?></th> 
     31                                </tr> 
     32                        </thead> 
     33                        <tbody id="plugins"> 
     34                        <?php 
     35                        foreach( (array) $themes as $key => $theme ) : 
     36                                $theme_key = wp_specialchars($theme['Stylesheet']); 
     37                                $class = ('alt' == $class) ? '' : 'alt'; 
     38                                $class1 = $enabled = $disabled = ''; 
     39                                 
     40                                if( isset( $allowed_themes[ $theme_key ] ) == true ) { 
     41                                        $enabled = 'checked="checked" '; 
     42                                        $class1 = ' active'; 
     43                                } else { 
     44                                        $disabled = 'checked="checked" '; 
     45                                } 
     46                                ?> 
     47                                <tr valign="top" class="<?php echo $class.$class1; ?>"> 
     48                                        <td style="text-align:center;"> 
     49                                                <label><input name="theme[<?php echo $theme_key ?>]" type="radio" id="disabled_<?php echo $theme_key ?>" value="disabled" <?php echo $disabled ?> /> <?php _e('No') ?></label> 
     50                                                &nbsp;&nbsp;&nbsp;  
     51                                                <label><input name="theme[<?php echo $theme_key ?>]" type="radio" id="enabled_<?php echo $theme_key ?>" value="enabled" <?php echo $enabled ?> /> <?php _e('Yes') ?></label> 
     52                                        </td> 
     53                                        <th scope="row" style="text-align:left;"><?php echo $key ?></th>  
     54                                        <td><?php echo $theme['Description'] ?></td> 
     55                                </tr>  
     56                        <?php endforeach; ?> 
     57                        </tbody> 
     58                </table> 
     59                 
     60                <p class="submit"> 
     61                        <input type='submit' value='<?php _e('Update Themes &raquo;') ?>' /></p> 
     62        </form> 
     63</div> 
     64 
     65<?php include('admin-footer.php'); ?> 
  • wpmu-upgrade-site.php

    old new  
    1 <?php 
    2 require_once('admin.php'); 
    3  
    4 $http_fopen = ini_get("allow_url_fopen"); 
    5 if( !$http_fopen ) { 
    6         require_once('../wp-includes/class-snoopy.php'); 
    7 } 
    8  
    9 $title = __('WordPress MU &rsaquo; Admin &rsaquo; Upgrade Site'); 
    10 $parent_file = 'wpmu-admin.php'; 
    11 require_once('admin-header.php'); 
    12  
    13 if( is_site_admin() == false ) { 
    14     wp_die( __('<p>You do not have permission to access this page.</p>') ); 
    15 } 
    16  
    17 echo '<div class="wrap">'; 
    18 echo '<h2>'.__('Upgrade Site').'</h2>'; 
    19 switch( $_GET['action'] ) { 
    20         case "upgrade": 
    21                 $n = ( isset($_GET['n']) ) ? intval($_GET['n']) : 0; 
    22                  
    23                 $blogs = $wpdb->get_results( "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT {$n}, 5", ARRAY_A ); 
    24                 if( is_array( $blogs ) ) { 
    25                         echo "<ul>"; 
    26                         foreach( (array) $blogs as $details ) { 
    27                                 if( $details['spam'] == 0 && $details['deleted'] == 0 && $details['archived'] == 0 ) { 
    28                                         $siteurl = $wpdb->get_var("SELECT option_value from {$wpdb->base_prefix}{$details['blog_id']}_options WHERE option_name = 'siteurl'"); 
    29                                         echo "<li>$siteurl</li>"; 
    30                                         if( $http_fopen ) { 
    31                                                 $fp = fopen( $siteurl . "wp-admin/upgrade.php?step=1", "r" ); 
    32                                                 if( $fp ) { 
    33                                                         while( feof( $fp ) == false ) { 
    34                                                                 fgets($fp, 4096); 
    35                                                         } 
    36                                                         fclose( $fp ); 
    37                                                 } 
    38                                         } else { 
    39                                                 $client = new Snoopy(); 
    40                                                 @$client->fetch($siteurl . "wp-admin/upgrade.php?step=1"); 
    41                                         } 
    42                                 } 
    43                         } 
    44                         echo "</ul>"; 
    45                         ?> 
    46                         <p><?php _e("If your browser doesn't start loading the next page automatically click this link:"); ?> <a href="wpmu-upgrade-site.php?action=upgrade&amp;n=<?php echo ($n + 5) ?>"><?php _e("Next Blogs"); ?></a></p> 
    47                         <script type='text/javascript'> 
    48                                 <!-- 
    49                                 function nextpage() { 
    50                                         location.href = "wpmu-upgrade-site.php?action=upgrade&n=<?php echo ($n + 5) ?>"; 
    51                                 } 
    52                                 setTimeout( "nextpage()", 250 ); 
    53                                 //--> 
    54                         </script> 
    55                         <?php 
    56                 } else { 
    57                         echo '<p>'.__('All Done!').'</p>'; 
    58                 } 
    59         break; 
    60          
    61         default: ?> 
    62                 <p><?php _e("You can upgrade all the blogs on your site through this page. It works by calling the upgrade script of each blog automatically. Hit the link below to upgrade."); ?></p> 
    63                 <p><a href="wpmu-upgrade-site.php?action=upgrade"><?php _e("Upgrade Site"); ?></a></p> 
    64         <?php 
    65         break; 
    66 } 
    67 ?> 
    68 </div> 
    69  
    70 <?php include('admin-footer.php'); ?> 
     1<?php 
     2require_once('admin.php'); 
     3 
     4$http_fopen = ini_get("allow_url_fopen"); 
     5if( !$http_fopen ) { 
     6<