<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[13796] trunk/wp-admin: More ms-options cleanup.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13796">13796</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-03-22 06:02:04 +0000 (Mon, 22 Mar 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>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.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminmseditphp">trunk/wp-admin/ms-edit.php</a></li>
<li><a href="#trunkwpadminmsoptionsphp">trunk/wp-admin/ms-options.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminmseditphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/ms-edit.php (13795 => 13796)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-edit.php        2010-03-22 04:19:10 UTC (rev 13795)
+++ trunk/wp-admin/ms-edit.php        2010-03-22 06:02:04 UTC (rev 13796)
</span><span class="lines">@@ -108,16 +108,16 @@
</span><span class="cx">                 }
</span><span class="cx">                 update_site_option( "dashboard_blog", $dashboard_blog_id );
</span><span class="cx">                 // global terms
</span><del>-                if ( !global_terms_enabled() && '1' == $_POST[ 'global_terms_enabled' ] ) {
</del><ins>+                if ( !global_terms_enabled() && ! empty( $_POST[ 'global_terms_enabled' ] ) ) {
</ins><span class="cx">                         require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
</span><span class="cx">                         // create global terms table
</span><span class="cx">                         install_global_terms();
</span><span class="cx">                 }
</span><span class="cx">                 $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' );
</span><del>-                $checked_options = array('mu_media_buttons', 'menu_items');
-                foreach ( $checked_options as $option_name ) {
</del><ins>+                $checked_options = array('mu_media_buttons' => array(), 'menu_items' => array(), 'registrationnotification' => 'no', 'upload_space_check_disabled' => 1 );
+                foreach ( $checked_options as $option_name => $option_unchecked_value ) {
</ins><span class="cx">                         if ( ! isset($_POST[ $option_name ]) )
</span><del>-                                $_POST[ $option_name ] = array();
</del><ins>+                                $_POST[ $option_name ] = $option_unchecked_value;
</ins><span class="cx">                 }
</span><span class="cx">                 foreach ( $options as $option_name ) {
</span><span class="cx">                         if ( ! isset($_POST[ $option_name ]) )
</span></span></pre></div>
<a id="trunkwpadminmsoptionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/ms-options.php (13795 => 13796)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-options.php        2010-03-22 04:19:10 UTC (rev 13795)
+++ trunk/wp-admin/ms-options.php        2010-03-22 06:02:04 UTC (rev 13796)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx">                 <h3><?php _e('Operational Settings'); ?></h3>
</span><span class="cx">                 <table class="form-table">
</span><span class="cx">                         <tr valign="top">
</span><del>-                                <th scope="row"><?php _e('Network Name') ?></th>
</del><ins>+                                <th scope="row"><label for="site_name"><?php _e('Network Name') ?></label></th>
</ins><span class="cx">                                 <td>
</span><span class="cx">                                         <input name="site_name" type="text" id="site_name" class="regular-text" value="<?php echo esc_attr($current_site->site_name) ?>" />
</span><span class="cx">                                         <br />
</span><span class="lines">@@ -36,26 +36,25 @@
</span><span class="cx">                         </tr>
</span><span class="cx">
</span><span class="cx">                         <tr valign="top">
</span><del>-                                <th scope="row"><?php _e('Network Admin Email') ?></th>
</del><ins>+                                <th scope="row"><label for="admin_email"><?php _e('Network Admin Email') ?></label></th>
</ins><span class="cx">                                 <td>
</span><span class="cx">                                         <input name="admin_email" type="text" id="admin_email" class="regular-text" value="<?php echo esc_attr( get_site_option('admin_email') ) ?>" />
</span><span class="cx">                                         <br />
</span><del>-                                        <?php printf( __( 'Registration and support emails will come from this address. An address such as "support@%s" is recommended.' ), $current_site->domain ); ?>
</del><ins>+                                        <?php printf( __( 'Registration and support emails will come from this address. An address such as <code>support@%s</code> is recommended.' ), $current_site->domain ); ?>
</ins><span class="cx">                                 </td>
</span><span class="cx">                         </tr>
</span><span class="cx">
</span><span class="cx">                         <tr valign="top">
</span><span class="cx">                                 <th scope="row"><?php _e('Global Terms') ?></th>
</span><span class="cx">                                 <td>
</span><del>-                                <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 />
-                                <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 />
-                                <?php _e( 'Maintain a global list of terms from all sites across the network.' ); ?></td>
</del><ins>+                                <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 />
+                                <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>
</ins><span class="cx">                         </tr>
</span><span class="cx">                 </table>
</span><span class="cx">                 <h3><?php _e('Dashboard Settings'); ?></h3>
</span><span class="cx">                 <table class="form-table">
</span><span class="cx">                         <tr valign="top">
</span><del>-                                <th scope="row"><?php _e('Dashboard Site') ?></th>
</del><ins>+                                <th scope="row"><label for="dashboard_blog"><?php _e('Dashboard Site') ?></label></th>
</ins><span class="cx">                                 <td>
</span><span class="cx">                                         <?php
</span><span class="cx">                                         if ( $dashboard_blog = get_site_option( 'dashboard_blog' ) ) {
</span><span class="lines">@@ -71,9 +70,9 @@
</span><span class="cx">                                 </td>
</span><span class="cx">                         </tr>
</span><span class="cx">                         <tr valign="top">
</span><del>-                                <th scope="row"><?php _e('Dashboard User Default Role') ?></th>
</del><ins>+                                <th scope="row"><label for="default_user_role"><?php _e('Dashboard User Default Role') ?></label></th>
</ins><span class="cx">                                 <td>
</span><del>-                                        <select name="default_user_role" id="role"><?php
</del><ins>+                                        <select name="default_user_role" id="default_user_role"><?php
</ins><span class="cx">                                         wp_dropdown_roles( get_site_option( 'default_user_role', 'subscriber' ) );
</span><span class="cx">                                         ?>
</span><span class="cx">                                         </select>
</span><span class="lines">@@ -82,7 +81,7 @@
</span><span class="cx">                                 </td>
</span><span class="cx">                         </tr>
</span><span class="cx">                         <tr valign="top">
</span><del>-                                <th scope="row"><?php _e('Admin Notice Feed') ?></th>
</del><ins>+                                <th scope="row"><label for="admin_notice_feed"><?php _e('Admin Notice Feed') ?></label></th>
</ins><span class="cx">                                 <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 />
</span><span class="cx">                                 <?php _e( 'Display the latest post from this RSS or Atom feed on all site dashboards. Leave blank to disable.' ); ?><br />
</span><span class="cx">                                 <?php if ( get_site_option( 'admin_notice_feed' ) != 'http://' . $current_site->domain . $current_site->path . 'feed/' )
</span><span class="lines">@@ -116,24 +115,19 @@
</span><span class="cx">                                         update_site_option( 'registrationnotification', 'yes' );
</span><span class="cx">                                 ?>
</span><span class="cx">                                 <td>
</span><del>-                                        <input name="registrationnotification" type="radio" id="registrationnotification1" value='yes'<?php checked( get_site_option('registrationnotification'), 'yes') ?> /> <?php _e('Yes'); ?><br />
-                                        <input name="registrationnotification" type="radio" id="registrationnotification2" value='no'<?php checked( get_site_option('registrationnotification'), 'no') ?> /> <?php _e('No'); ?><br />
-                                        <?php _e('Send the network admin an email notification every time someone registers a site or user account.') ?>
</del><ins>+                                        <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>
</ins><span class="cx">                                 </td>
</span><span class="cx">                         </tr>
</span><span class="cx">
</span><del>-                        <tr valign="top">
</del><ins>+                        <tr valign="top" id="addnewusers">
</ins><span class="cx">                                 <th scope="row"><?php _e('Add New Users') ?></th>
</span><span class="cx">                                 <td>
</span><del>-                                        <a name='addnewusers'></a>
-                                        <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 />
-                                        <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 />
-                                        <?php _e('Allow site administrators to add new users to their site via the "Users->Add New" page.') ?>
</del><ins>+                                        <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>
</ins><span class="cx">                                 </td>
</span><span class="cx">                         </tr>
</span><span class="cx">
</span><span class="cx">                         <tr valign="top">
</span><del>-                                <th scope="row"><?php _e('Banned Names') ?></th>
</del><ins>+                                <th scope="row"><label for="illegal_names"><?php _e('Banned Names') ?></label></th>
</ins><span class="cx">                                 <td>
</span><span class="cx">                                         <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" />
</span><span class="cx">                                         <br />
</span><span class="lines">@@ -142,7 +136,7 @@
</span><span class="cx">                         </tr>
</span><span class="cx">
</span><span class="cx">                         <tr valign="top">
</span><del>-                                <th scope="row"><?php _e('Limited Email Registrations') ?></th>
</del><ins>+                                <th scope="row"><label for="limited_email_domains"><?php _e('Limited Email Registrations') ?></label></th>
</ins><span class="cx">                                 <td>
</span><span class="cx">                                         <?php $limited_email_domains = get_site_option('limited_email_domains');
</span><span class="cx">                                         $limited_email_domains = str_replace( ' ', "\n", $limited_email_domains ); ?>
</span><span class="lines">@@ -153,7 +147,7 @@
</span><span class="cx">                         </tr>
</span><span class="cx">
</span><span class="cx">                         <tr valign="top">
</span><del>-                                <th scope="row"><?php _e('Banned Email Domains') ?></th>
</del><ins>+                                <th scope="row"><label for="banned_email_domains"><?php _e('Banned Email Domains') ?></label></th>
</ins><span class="cx">                                 <td>
</span><span class="cx">                                         <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>
</span><span class="cx">                                         <br />
</span><span class="lines">@@ -166,7 +160,7 @@
</span><span class="cx">                 <table class="form-table">
</span><span class="cx">
</span><span class="cx">                         <tr valign="top">
</span><del>-                                <th scope="row"><?php _e('Welcome Email') ?></th>
</del><ins>+                                <th scope="row"><label for="welcome_email"><?php _e('Welcome Email') ?></label></th>
</ins><span class="cx">                                 <td>
</span><span class="cx">                                         <textarea name="welcome_email" id="welcome_email" rows='5' cols='45' class="large-text"><?php echo stripslashes( get_site_option('welcome_email') ) ?></textarea>
</span><span class="cx">                                         <br />
</span><span class="lines">@@ -174,7 +168,7 @@
</span><span class="cx">                                 </td>
</span><span class="cx">                         </tr>
</span><span class="cx">                         <tr valign="top">
</span><del>-                                <th scope="row"><?php _e('Welcome User Email') ?></th>
</del><ins>+                                <th scope="row"><label for="welcome_user_email"><?php _e('Welcome User Email') ?></label></th>
</ins><span class="cx">                                 <td>
</span><span class="cx">                                          <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>
</span><span class="cx">                                         <br />
</span><span class="lines">@@ -182,7 +176,7 @@
</span><span class="cx">                                 </td>
</span><span class="cx">                         </tr>
</span><span class="cx">                         <tr valign="top">
</span><del>-                                <th scope="row"><?php _e('First Post') ?></th>
</del><ins>+                                <th scope="row"><label for="first_post"><?php _e('First Post') ?></label></th>
</ins><span class="cx">                                 <td>
</span><span class="cx">                                         <textarea name="first_post" id="first_post" rows='5' cols='45' class="large-text"><?php echo stripslashes( get_site_option('first_post') ) ?></textarea>
</span><span class="cx">                                         <br />
</span><span class="lines">@@ -190,7 +184,7 @@
</span><span class="cx">                                 </td>
</span><span class="cx">                         </tr>
</span><span class="cx">                         <tr valign="top">
</span><del>-                                <th scope="row"><?php _e('First Page') ?></th>
</del><ins>+                                <th scope="row"><label for="first_page"><?php _e('First Page') ?></label></th>
</ins><span class="cx">                                 <td>
</span><span class="cx">                                         <textarea name="first_page" id="first_page" rows='5' cols='45' class="large-text"><?php echo stripslashes( get_site_option('first_page') ) ?></textarea>
</span><span class="cx">                                         <br />
</span><span class="lines">@@ -198,7 +192,7 @@
</span><span class="cx">                                 </td>
</span><span class="cx">                         </tr>
</span><span class="cx">                         <tr valign="top">
</span><del>-                                <th scope="row"><?php _e('First Comment') ?></th>
</del><ins>+                                <th scope="row"><label for="first_comment"><?php _e('First Comment') ?></label></th>
</ins><span class="cx">                                 <td>
</span><span class="cx">                                         <textarea name="first_comment" id="first_comment" rows='5' cols='45' class="large-text"><?php echo stripslashes( get_site_option('first_comment') ) ?></textarea>
</span><span class="cx">                                         <br />
</span><span class="lines">@@ -206,7 +200,7 @@
</span><span class="cx">                                 </td>
</span><span class="cx">                         </tr>
</span><span class="cx">                         <tr valign="top">
</span><del>-                                <th scope="row"><?php _e('First Comment Author') ?></th>
</del><ins>+                                <th scope="row"><label for="first_comment_author"><?php _e('First Comment Author') ?></label></th>
</ins><span class="cx">                                 <td>
</span><span class="cx">                                         <input type="text" size='40' name="first_comment_author" id="first_comment_author" value="<?php echo get_site_option('first_comment_author') ?>" />
</span><span class="cx">                                         <br />
</span><span class="lines">@@ -214,7 +208,7 @@
</span><span class="cx">                                 </td>
</span><span class="cx">                         </tr>
</span><span class="cx">                         <tr valign="top">
</span><del>-                                <th scope="row"><?php _e('First Comment URL') ?></th>
</del><ins>+                                <th scope="row"><label for="first_comment_url"><?php _e('First Comment URL') ?></label></th>
</ins><span class="cx">                                 <td>
</span><span class="cx">                                         <input type="text" size='40' name="first_comment_url" id="first_comment_url" value="<?php echo esc_attr(get_site_option('first_comment_url')) ?>" />
</span><span class="cx">                                         <br />
</span><span class="lines">@@ -225,7 +219,7 @@
</span><span class="cx">                 <h3><?php _e('Upload Settings'); ?></h3>
</span><span class="cx">                 <table class="form-table">
</span><span class="cx">                         <tr valign="top">
</span><del>-                                <th scope="row"><?php _e('Upload media button') ?></th>
</del><ins>+                                <th scope="row"><?php _e('Media upload buttons') ?></th>
</ins><span class="cx">                                 <?php $mu_media_buttons = get_site_option( 'mu_media_buttons', array() ); ?>
</span><span class="cx">                                 <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 />
</span><span class="cx">                                 <label><input type='checkbox' id="mu_media_buttons_video" name="mu_media_buttons[video]" value='1'<?php checked( !empty($mu_media_buttons[ 'video' ]) ) ?>/> <?php _e( 'Videos' ); ?></label><br />
</span><span class="lines">@@ -236,18 +230,17 @@
</span><span class="cx">                         <tr valign="top">
</span><span class="cx">                                 <th scope="row"><?php _e('Site upload space') ?></th>
</span><span class="cx">                                 <td>
</span><del>-                                <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 />
-                                <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>
</del><ins>+                                <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 />
</ins><span class="cx">                         </tr>
</span><span class="cx">
</span><span class="cx">                         <tr valign="top">
</span><del>-                                <th scope="row"><?php _e('Upload file types') ?></th>
</del><ins>+                                <th scope="row"><label for="upload_filetypes"><?php _e('Upload file types') ?></label></th>
</ins><span class="cx">                                 <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>
</span><span class="cx">                         </tr>
</span><span class="cx">
</span><span class="cx">                         <tr valign="top">
</span><del>-                                <th scope="row"><?php _e('Max upload file size') ?></th>
-                                <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>
</del><ins>+                                <th scope="row"><label for="fileupload_maxk"><?php _e('Max upload file size') ?></label></th>
+                                <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>
</ins><span class="cx">                         </tr>
</span><span class="cx">                 </table>
</span><span class="cx">
</span><span class="lines">@@ -262,7 +255,7 @@
</span><span class="cx">                         <?php
</span><span class="cx">                                 ?>
</span><span class="cx">                                 <tr valign="top">
</span><del>-                                        <th><?php _e('Default Language') ?></th>
</del><ins>+                                        <th><label for="WPLANG"><?php _e('Default Language') ?></label></th>
</ins><span class="cx">                                         <td>
</span><span class="cx">                                                 <select name="WPLANG" id="WPLANG">
</span><span class="cx">                                                         <?php mu_dropdown_languages( $languages, get_site_option('WPLANG') ); ?>
</span></span></pre>
</div>
</div>
</body>
</html>