Every time you nest a ternary operator, a kitten dies.

git-svn-id: http://svn.automattic.com/wordpress/trunk@16455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-11-18 05:37:00 +00:00
parent 8efb005a73
commit 27c21a741e
2 changed files with 23 additions and 20 deletions

View File

@ -312,7 +312,10 @@ function network_step2( $errors = false ) {
echo '<div class="error">' . $errors->get_error_message() . '</div>';
if ( $_POST ) {
$subdomain_install = allow_subdomain_install() ? ( allow_subdirectory_install() ? ! empty( $_POST['subdomain_install'] ) : true ) : false;
if ( allow_subdomain_install() )
$subdomain_install = allow_subdirectory_install() ? ! empty( $_POST['subdomain_install'] ) : true;
else
$subdomain_install = false;
} else {
if ( is_multisite() ) {
$subdomain_install = is_subdomain_install();

View File

@ -215,29 +215,25 @@ if ( is_multisite() ) {
if ( $do_both )
echo '<h3 id="add-existing-user">' . __('Add Existing User') . '</h3>';
if ( !is_super_admin() ) {
_e( 'Enter the email address of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' );
_e( 'Enter the email address of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' );
$label = __('E-mail');
} else {
_e( 'Enter the email address or username of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' );
_e( 'Enter the email address or username of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' );
$label = __('E-mail or Username');
}
?>
<form action="#add-existing-user" method="post" name="adduser" id="adduser" class="add:users: validate"<?php do_action('user_new_form_tag');?>>
<form action="" method="post" name="adduser" id="adduser" class="add:users: validate"<?php do_action('user_new_form_tag');?>>
<input name="action" type="hidden" id="action" value="adduser" />
<?php wp_nonce_field('add-user') ?>
<table class="form-table">
<tr class="form-field form-required">
<th scope="row"><label for="email"><?php echo $label; ?></label></th>
<td><input name="email" type="text" id="email" value="<?php echo esc_attr($new_user_email); ?>" /></td>
<td><input name="email" type="text" id="email" value="" /></td>
</tr>
<tr class="form-field">
<th scope="row"><label for="role"><?php _e('Role'); ?></label></th>
<td><select name="role" id="role">
<?php
if ( !$new_user_role )
$new_user_role = !empty($current_role) ? $current_role : get_option('default_role');
wp_dropdown_roles($new_user_role);
?>
<?php wp_dropdown_roles( get_option('default_role') ); ?>
</select>
</td>
</tr>
@ -255,21 +251,25 @@ if ( is_multisite() ) {
if ( current_user_can( 'create_users') ) {
if ( $do_both )
echo '<h3 id="create-new-user">' . __('Create New User') . '</h3>';
echo '<h3 id="create-new-user">' . __( 'Create New User' ) . '</h3>';
?>
<p><?php _e('Create a brand new user and add it to this site.'); ?></p>
<form action="#create-new-user" method="post" name="createuser" id="adduser" class="add:users: validate"<?php do_action('user_new_form_tag');?>>
<form action="" method="post" name="createuser" id="adduser" class="add:users: validate"<?php do_action('user_new_form_tag');?>>
<input name="action" type="hidden" id="action" value="createuser" />
<?php wp_nonce_field('create-user') ?>
<?php
// Load up the passed data, else set to a default.
foreach ( array('user_login' => 'login', 'first_name' => 'firstname', 'last_name' => 'lastname',
'email' => 'email', 'url' => 'uri', 'role' => 'role') as $post_field => $var ) {
foreach ( array( 'user_login' => 'login', 'first_name' => 'firstname', 'last_name' => 'lastname',
'email' => 'email', 'url' => 'uri', 'role' => 'role', 'send_password' => 'send_password', 'noconfirmation' => 'ignore_pass' ) as $post_field => $var ) {
$var = "new_user_$var";
if ( ! isset($$var) )
$$var = isset($_POST[$post_field]) ? stripslashes($_POST[$post_field]) : '';
if( isset( $_POST['createuser'] ) ) {
if ( ! isset($$var) )
$$var = isset( $_POST[$post_field] ) ? stripslashes( $_POST[$post_field] ) : '';
} else {
$$var = false;
}
}
$new_user_send_password = !$_POST || isset($_POST['send_password']);
?>
<table class="form-table">
<tr class="form-field form-required">
@ -306,7 +306,7 @@ $new_user_send_password = !$_POST || isset($_POST['send_password']);
</tr>
<tr>
<th scope="row"><label for="send_password"><?php _e('Send Password?') ?></label></th>
<td><label for="send_password"><input type="checkbox" name="send_password" id="send_password" <?php checked($new_user_send_password, true); ?> /> <?php _e('Send this password to the new user by email.'); ?></label></td>
<td><label for="send_password"><input type="checkbox" name="send_password" id="send_password" <?php checked( $new_user_send_password ); ?> /> <?php _e('Send this password to the new user by email.'); ?></label></td>
</tr>
<?php endif; ?>
<?php } // !is_multisite ?>
@ -324,7 +324,7 @@ $new_user_send_password = !$_POST || isset($_POST['send_password']);
<?php if ( is_multisite() && is_super_admin() ) { ?>
<tr>
<th scope="row"><label for="noconfirmation"><?php _e('Skip Confirmation Email') ?></label></th>
<td><label for="noconfirmation"><input type="checkbox" name="noconfirmation" id="noconfirmation" value="1" /> <?php _e( 'Add the user without sending them a confirmation email.' ); ?></label></td>
<td><label for="noconfirmation"><input type="checkbox" name="noconfirmation" id="noconfirmation" value="1" <?php checked( $new_user_ignore_pass ); ?> /> <?php _e( 'Add the user without sending them a confirmation email.' ); ?></label></td>
</tr>
<?php } ?>
</table>