Make WordPress Core

Changeset 13796


Ignore:
Timestamp:
03/22/2010 06:02:04 AM (15 years ago)
Author:
nacin
Message:

More ms-options cleanup. Add label elements, and transition to checkboxes from radios where we can. Also fix notice in global_terms_enabled post handling.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

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

    r13733 r13796  
    109109        update_site_option( "dashboard_blog", $dashboard_blog_id );
    110110        // global terms
    111         if ( !global_terms_enabled() && '1' == $_POST[ 'global_terms_enabled' ] ) {
     111        if ( !global_terms_enabled() && ! empty( $_POST[ 'global_terms_enabled' ] ) ) {
    112112            require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    113113            // create global terms table
     
    115115        }
    116116        $options = array( 'registrationnotification', 'registration', 'add_new_users', 'menu_items', 'mu_media_buttons', 'upload_space_check_disabled', 'blog_upload_space', 'upload_filetypes', 'site_name', 'first_post', 'first_page', 'first_comment', 'first_comment_url', 'first_comment_author', 'welcome_email', 'welcome_user_email', 'fileupload_maxk', 'admin_notice_feed', 'global_terms_enabled' );
    117         $checked_options = array('mu_media_buttons', 'menu_items');
    118         foreach ( $checked_options as $option_name ) {
     117        $checked_options = array('mu_media_buttons' => array(), 'menu_items' => array(), 'registrationnotification' => 'no', 'upload_space_check_disabled' => 1 );
     118        foreach ( $checked_options as $option_name => $option_unchecked_value ) {
    119119            if ( ! isset($_POST[ $option_name ]) )
    120                 $_POST[ $option_name ] = array();
     120                $_POST[ $option_name ] = $option_unchecked_value;
    121121        }
    122122        foreach ( $options as $option_name ) {
  • trunk/wp-admin/ms-options.php

    r13795 r13796  
    2828        <table class="form-table">
    2929            <tr valign="top">
    30                 <th scope="row"><?php _e('Network Name') ?></th>
     30                <th scope="row"><label for="site_name"><?php _e('Network Name') ?></label></th>
    3131                <td>
    3232                    <input name="site_name" type="text" id="site_name" class="regular-text" value="<?php echo esc_attr($current_site->site_name) ?>" />
     
    3737
    3838            <tr valign="top">
    39                 <th scope="row"><?php _e('Network Admin Email') ?></th>
     39                <th scope="row"><label for="admin_email"><?php _e('Network Admin Email') ?></label></th>
    4040                <td>
    4141                    <input name="admin_email" type="text" id="admin_email" class="regular-text" value="<?php echo esc_attr( get_site_option('admin_email') ) ?>" />
    4242                    <br />
    43                     <?php printf( __( 'Registration and support emails will come from this address. An address such as "support@%s" is recommended.' ), $current_site->domain ); ?>
     43                    <?php printf( __( 'Registration and support emails will come from this address. An address such as <code>support@%s</code> is recommended.' ), $current_site->domain ); ?>
    4444                </td>
    4545            </tr>
     
    4848                <th scope="row"><?php _e('Global Terms') ?></th>
    4949                <td>
    50                 <label><input type='radio' id="global_terms_enabled" name="global_terms_enabled" value='1'<?php checked( get_site_option( 'global_terms_enabled' ), 1 ) ?>/> <?php _e( 'Enabled' ); ?></label><br />
    51                 <label><input type='radio' id="global_terms_enabled" name="global_terms_enabled" value='0'<?php checked( get_site_option( 'global_terms_enabled' ), 0 ) ?>/> <?php _e( 'Disabled' ); ?></label><br />
    52                 <?php _e( 'Maintain a global list of terms from all sites across the network.' ); ?></td>
     50                <label><input type='radio' id="global_terms_enabled" name="global_terms_enabled" value='1'<?php checked( get_site_option( 'global_terms_enabled' ), 1 ) ?>/> <?php _e( 'Maintain a global list of terms from all sites across the network.' ); ?></label><br />
     51                <label><input type='radio' id="global_terms_enabled" name="global_terms_enabled" value='0'<?php checked( get_site_option( 'global_terms_enabled' ), 0 ) ?>/> <?php _e( 'Disabled' ); ?></label></td>
    5352            </tr>
    5453        </table>
     
    5655        <table class="form-table">
    5756            <tr valign="top">
    58                 <th scope="row"><?php _e('Dashboard Site') ?></th>
     57                <th scope="row"><label for="dashboard_blog"><?php _e('Dashboard Site') ?></label></th>
    5958                <td>
    6059                    <?php
     
    7271            </tr>
    7372            <tr valign="top">
    74                 <th scope="row"><?php _e('Dashboard User Default Role') ?></th>
    75                 <td>
    76                     <select name="default_user_role" id="role"><?php
     73                <th scope="row"><label for="default_user_role"><?php _e('Dashboard User Default Role') ?></label></th>
     74                <td>
     75                    <select name="default_user_role" id="default_user_role"><?php
    7776                    wp_dropdown_roles( get_site_option( 'default_user_role', 'subscriber' ) );
    7877                    ?>
     
    8382            </tr>
    8483            <tr valign="top">
    85                 <th scope="row"><?php _e('Admin Notice Feed') ?></th>
     84                <th scope="row"><label for="admin_notice_feed"><?php _e('Admin Notice Feed') ?></label></th>
    8685                <td><input name="admin_notice_feed" class="large-text" type="text" id="admin_notice_feed" value="<?php echo esc_attr( get_site_option( 'admin_notice_feed' ) ) ?>" size="80" /><br />
    8786                <?php _e( 'Display the latest post from this RSS or Atom feed on all site dashboards. Leave blank to disable.' ); ?><br />
     
    117116                ?>
    118117                <td>
    119                     <input name="registrationnotification" type="radio" id="registrationnotification1" value='yes'<?php checked( get_site_option('registrationnotification'), 'yes') ?> /> <?php _e('Yes'); ?><br />
    120                     <input name="registrationnotification" type="radio" id="registrationnotification2" value='no'<?php checked( get_site_option('registrationnotification'), 'no') ?> /> <?php _e('No'); ?><br />
    121                     <?php _e('Send the network admin an email notification every time someone registers a site or user account.') ?>
    122                 </td>
    123             </tr>
    124 
    125             <tr valign="top">
     118                    <label><input name="registrationnotification" type="checkbox" id="registrationnotification" value='yes'<?php checked( get_site_option('registrationnotification'), 'yes' ) ?> /> <?php _e('Send the network admin an email notification every time someone registers a site or user account.') ?></label>
     119                </td>
     120            </tr>
     121
     122            <tr valign="top" id="addnewusers">
    126123                <th scope="row"><?php _e('Add New Users') ?></th>
    127124                <td>
    128                     <a name='addnewusers'></a>
    129                     <input name="add_new_users" type="radio" id="add_new_users1" value='1'<?php checked( get_site_option('add_new_users'), 1 ) ?> /> <?php _e('Yes'); ?><br />
    130                     <input name="add_new_users" type="radio" id="add_new_users2" value='0'<?php checked( get_site_option('add_new_users'), 0 ) ?> /> <?php _e('No'); ?><br />
    131                     <?php _e('Allow site administrators to add new users to their site via the "Users->Add New" page.') ?>
    132                 </td>
    133             </tr>
    134 
    135             <tr valign="top">
    136                 <th scope="row"><?php _e('Banned Names') ?></th>
     125                    <label><input name="add_new_users" type="checkbox" id="add_new_users" value='1'<?php checked( get_site_option('add_new_users') ) ?> /> <?php _e('Allow site administrators to add new users to their site via the "Users->Add New" page.'); ?></label>
     126                </td>
     127            </tr>
     128
     129            <tr valign="top">
     130                <th scope="row"><label for="illegal_names"><?php _e('Banned Names') ?></label></th>
    137131                <td>
    138132                    <input name="illegal_names" type="text" id="illegal_names" class="large-text" value="<?php echo esc_attr( implode( " ", get_site_option('illegal_names') ) ); ?>" size="45" />
     
    143137
    144138            <tr valign="top">
    145                 <th scope="row"><?php _e('Limited Email Registrations') ?></th>
     139                <th scope="row"><label for="limited_email_domains"><?php _e('Limited Email Registrations') ?></label></th>
    146140                <td>
    147141                    <?php $limited_email_domains = get_site_option('limited_email_domains');
     
    154148
    155149            <tr valign="top">
    156                 <th scope="row"><?php _e('Banned Email Domains') ?></th>
     150                <th scope="row"><label for="banned_email_domains"><?php _e('Banned Email Domains') ?></label></th>
    157151                <td>
    158152                    <textarea name="banned_email_domains" id="banned_email_domains" cols='45' rows='5'><?php echo wp_htmledit_pre( get_site_option('banned_email_domains') == '' ? '' : implode( "\n", (array) get_site_option('banned_email_domains') ) ); ?></textarea>
     
    167161
    168162            <tr valign="top">
    169                 <th scope="row"><?php _e('Welcome Email') ?></th>
     163                <th scope="row"><label for="welcome_email"><?php _e('Welcome Email') ?></label></th>
    170164                <td>
    171165                    <textarea name="welcome_email" id="welcome_email" rows='5' cols='45' class="large-text"><?php echo stripslashes( get_site_option('welcome_email') ) ?></textarea>
     
    175169            </tr>
    176170            <tr valign="top">
    177                 <th scope="row"><?php _e('Welcome User Email') ?></th>
     171                <th scope="row"><label for="welcome_user_email"><?php _e('Welcome User Email') ?></label></th>
    178172                <td>
    179173                        <textarea name="welcome_user_email" id="welcome_user_email" rows='5' cols='45' class="large-text"><?php echo stripslashes( get_site_option('welcome_user_email') ) ?></textarea>
     
    183177            </tr>
    184178            <tr valign="top">
    185                 <th scope="row"><?php _e('First Post') ?></th>
     179                <th scope="row"><label for="first_post"><?php _e('First Post') ?></label></th>
    186180                <td>
    187181                    <textarea name="first_post" id="first_post" rows='5' cols='45' class="large-text"><?php echo stripslashes( get_site_option('first_post') ) ?></textarea>
     
    191185            </tr>
    192186            <tr valign="top">
    193                 <th scope="row"><?php _e('First Page') ?></th>
     187                <th scope="row"><label for="first_page"><?php _e('First Page') ?></label></th>
    194188                <td>
    195189                    <textarea name="first_page" id="first_page" rows='5' cols='45' class="large-text"><?php echo stripslashes( get_site_option('first_page') ) ?></textarea>
     
    199193            </tr>
    200194            <tr valign="top">
    201                 <th scope="row"><?php _e('First Comment') ?></th>
     195                <th scope="row"><label for="first_comment"><?php _e('First Comment') ?></label></th>
    202196                <td>
    203197                    <textarea name="first_comment" id="first_comment" rows='5' cols='45' class="large-text"><?php echo stripslashes( get_site_option('first_comment') ) ?></textarea>
     
    207201            </tr>
    208202            <tr valign="top">
    209                 <th scope="row"><?php _e('First Comment Author') ?></th>
     203                <th scope="row"><label for="first_comment_author"><?php _e('First Comment Author') ?></label></th>
    210204                <td>
    211205                    <input type="text" size='40' name="first_comment_author" id="first_comment_author" value="<?php echo get_site_option('first_comment_author') ?>" />
     
    215209            </tr>
    216210            <tr valign="top">
    217                 <th scope="row"><?php _e('First Comment URL') ?></th>
     211                <th scope="row"><label for="first_comment_url"><?php _e('First Comment URL') ?></label></th>
    218212                <td>
    219213                    <input type="text" size='40' name="first_comment_url" id="first_comment_url" value="<?php echo esc_attr(get_site_option('first_comment_url')) ?>" />
     
    226220        <table class="form-table">
    227221            <tr valign="top">
    228                 <th scope="row"><?php _e('Upload media button') ?></th>
     222                <th scope="row"><?php _e('Media upload buttons') ?></th>
    229223                <?php $mu_media_buttons = get_site_option( 'mu_media_buttons', array() ); ?>
    230224                <td><label><input type='checkbox' id="mu_media_buttons_image" name="mu_media_buttons[image]" value='1'<?php checked( !empty($mu_media_buttons[ 'image' ]) ) ?>/> <?php _e( 'Images' ); ?></label><br />
     
    237231                <th scope="row"><?php _e('Site upload space') ?></th>
    238232                <td>
    239                 <label><input type='radio' id="upload_space_check_disabled" name="upload_space_check_disabled" value='0'<?php checked( get_site_option( 'upload_space_check_disabled' ), 0 ) ?>/> <?php printf( __( 'Limit total size of files uploaded to %s MB' ), '<input name="blog_upload_space" type="text" id="blog_upload_space" value="' . esc_attr( get_site_option('blog_upload_space', 10) ) . '" size="3" />' ); ?></label><br />
    240                 <label><input type='radio' id="upload_space_check_disabled" name="upload_space_check_disabled" value='1'<?php checked( get_site_option( 'upload_space_check_disabled' ) ) ?>/> <?php _e( 'Disabled' ); ?></label><br /></td>
    241             </tr>
    242 
    243             <tr valign="top">
    244                 <th scope="row"><?php _e('Upload file types') ?></th>
     233                <label><input type='checkbox' id="upload_space_check_disabled" name="upload_space_check_disabled" value='0'<?php checked( get_site_option( 'upload_space_check_disabled' ), 0 ) ?>/> <?php printf( __( 'Limit total size of files uploaded to %s MB' ), '<input name="blog_upload_space" type="text" id="blog_upload_space" value="' . esc_attr( get_site_option('blog_upload_space', 10) ) . '" size="3" />' ); ?></label><br />
     234            </tr>
     235
     236            <tr valign="top">
     237                <th scope="row"><label for="upload_filetypes"><?php _e('Upload file types') ?></label></th>
    245238                <td><input name="upload_filetypes" type="text" id="upload_filetypes" class="large-text" value="<?php echo esc_attr( get_site_option('upload_filetypes', 'jpg jpeg png gif') ) ?>" size="45" /></td>
    246239            </tr>
    247240
    248241            <tr valign="top">
    249                 <th scope="row"><?php _e('Max upload file size') ?></th>
    250                 <td><input name="fileupload_maxk" type="text" id="fileupload_maxk" value="<?php echo esc_attr( get_site_option('fileupload_maxk', 300) ) ?>" size="5" /> KB</td>
     242                <th scope="row"><label for="fileupload_maxk"><?php _e('Max upload file size') ?></label></th>
     243                <td><?php printf( _x( '%s KB', 'File size in kilobytes' ), '<input name="fileupload_maxk" type="text" id="fileupload_maxk" value="' . esc_attr( get_site_option('fileupload_maxk', 300 ) ) . '" size="5" />' ); ?></td>
    251244            </tr>
    252245        </table>
     
    263256                ?>
    264257                <tr valign="top">
    265                     <th><?php _e('Default Language') ?></th>
     258                    <th><label for="WPLANG"><?php _e('Default Language') ?></label></th>
    266259                    <td>
    267260                        <select name="WPLANG" id="WPLANG">
Note: See TracChangeset for help on using the changeset viewer.