WordPress.org

Make WordPress Core

Changeset 6078


Ignore:
Timestamp:
09/11/2007 07:08:26 PM (11 years ago)
Author:
westi
Message:

Fix tab order when edit comments. Props Nazgul fixes #4726

Location:
trunk/wp-admin
Files:
2 edited

Legend:

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

    r6026 r6078  
    3434        <legend><label for="newcomment_author_url"><?php _e('URL:') ?></label></legend>
    3535        <div>
    36           <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="35" value="<?php echo attribute_escape( $comment->comment_author_url ); ?>" tabindex="3" />
     36          <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="35" value="<?php echo attribute_escape( $comment->comment_author_url ); ?>" tabindex="2" />
    3737    </div>
    3838</fieldset>
     
    5555    <tr>
    5656        <th scope="row" valign="top"><?php _e('Comment Status') ?>:</th>
    57         <td><label for="comment_status_approved" class="selectit"><input id="comment_status_approved" name="comment_status" type="radio" value="1" <?php checked($comment->comment_approved, '1'); ?> /> <?php _e('Approved') ?></label> &nbsp;
    58         <label for="comment_status_moderated" class="selectit"><input id="comment_status_moderated" name="comment_status" type="radio" value="0" <?php checked($comment->comment_approved, '0'); ?> /> <?php _e('Moderated') ?></label> &nbsp;
    59         <label for="comment_status_spam" class="selectit"><input id="comment_status_spam" name="comment_status" type="radio" value="spam" <?php checked($comment->comment_approved, 'spam'); ?> /> <?php _e('Spam') ?></label></td>
     57        <td><label for="comment_status_approved" class="selectit"><input id="comment_status_approved" name="comment_status" type="radio" value="1" <?php checked($comment->comment_approved, '1'); ?> tabindex="4" /> <?php _e('Approved') ?></label> &nbsp;
     58        <label for="comment_status_moderated" class="selectit"><input id="comment_status_moderated" name="comment_status" type="radio" value="0" <?php checked($comment->comment_approved, '0'); ?> tabindex="4" /> <?php _e('Moderated') ?></label> &nbsp;
     59        <label for="comment_status_spam" class="selectit"><input id="comment_status_spam" name="comment_status" type="radio" value="spam" <?php checked($comment->comment_approved, 'spam'); ?> tabindex="4" /> <?php _e('Spam') ?></label></td>
    6060    </tr>
    6161
     
    6363    <tr>
    6464        <th scope="row" valign="top"><?php _e('Edit time'); ?>:</th>
    65         <td><?php touch_time(('editcomment' == $action), 0); ?> </td>
     65        <td><?php touch_time(('editcomment' == $action), 0, 5); ?> </td>
    6666    </tr>
    6767<?php endif; ?>
  • trunk/wp-admin/includes/template.php

    r6033 r6078  
    417417}
    418418
    419 function touch_time( $edit = 1, $for_post = 1 ) {
     419function touch_time( $edit = 1, $for_post = 1, $tab_index = 0 ) {
    420420    global $wp_locale, $post, $comment;
    421421
    422422    if ( $for_post )
    423423        $edit = ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true;
    424 
    425     echo '<fieldset><legend><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp" /> <label for="timestamp">'.__( 'Edit timestamp' ).'</label></legend>';
     424   
     425    $tab_index_attribute = '';
     426    if ( (int) $tab_index > 0 )
     427        $tab_index_attribute = " tabindex=\"$tab_index\"";
     428
     429    echo '<fieldset><legend><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> <label for="timestamp">'.__( 'Edit timestamp' ).'</label></legend>';
    426430
    427431    $time_adj = time() + (get_option( 'gmt_offset' ) * 3600 );
     
    434438    $ss = ($edit) ? mysql2date( 's', $post_date ) : gmdate( 's', $time_adj );
    435439
    436     echo "<select name=\"mm\" onchange=\"edit_date.checked=true\">\n";
     440    echo "<select name=\"mm\" onchange=\"edit_date.checked=true\"$tab_index_attribute>\n";
    437441    for ( $i = 1; $i < 13; $i = $i +1 ) {
    438442        echo "\t\t\t<option value=\"$i\"";
     
    443447?>
    444448</select>
    445 <input type="text" id="jj" name="jj" value="<?php echo $jj; ?>" size="2" maxlength="2" onchange="edit_date.checked=true"/>
    446 <input type="text" id="aa" name="aa" value="<?php echo $aa ?>" size="4" maxlength="5" onchange="edit_date.checked=true" /> @
    447 <input type="text" id="hh" name="hh" value="<?php echo $hh ?>" size="2" maxlength="2" onchange="edit_date.checked=true" /> :
    448 <input type="text" id="mn" name="mn" value="<?php echo $mn ?>" size="2" maxlength="2" onchange="edit_date.checked=true" />
     449<input type="text" id="jj" name="jj" value="<?php echo $jj; ?>" size="2" maxlength="2" onchange="edit_date.checked=true"<?php echo $tab_index_attribute ?> />
     450<input type="text" id="aa" name="aa" value="<?php echo $aa ?>" size="4" maxlength="5" onchange="edit_date.checked=true"<?php echo $tab_index_attribute ?> /> @
     451<input type="text" id="hh" name="hh" value="<?php echo $hh ?>" size="2" maxlength="2" onchange="edit_date.checked=true"<?php echo $tab_index_attribute ?> /> :
     452<input type="text" id="mn" name="mn" value="<?php echo $mn ?>" size="2" maxlength="2" onchange="edit_date.checked=true"<?php echo $tab_index_attribute ?> />
    449453<input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" onchange="edit_date.checked=true" />
    450454<?php
Note: See TracChangeset for help on using the changeset viewer.