Make WordPress Core


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.