Make WordPress Core


Ignore:
Timestamp:
09/21/2008 07:45:45 PM (16 years ago)
Author:
azaozz
Message:

Sytling and improvements to inline editing, see #6815

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r8940 r8943  
    8787        $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
    8888        if ( $default_cat_id != $category->term_id )
    89             $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("categories.php?action=delete&amp;cat_ID=$category->term_id", 'delete-category_' . $category->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this category '%s'\n  'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
     89            $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("categories.php?action=delete&amp;cat_ID=$category->term_id", 'delete-category_' . $category->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this category '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
    9090        $action_count = count($actions);
    9191        $i = 0;
     
    158158        $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
    159159        if ( $default_cat_id != $category->term_id )
    160             $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("link-category.php?action=delete&amp;cat_ID=$category->term_id", 'delete-link-category_' . $category->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this category '%s'\n  'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
     160            $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("link-category.php?action=delete&amp;cat_ID=$category->term_id", 'delete-link-category_' . $category->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this category '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
    161161        $action_count = count($actions);
    162162        $i = 0;
     
    188188        switch ($column_name) {
    189189            case 'cb':
    190                $output .= "<th scope='row' class='check-column'>";
    191                if ( absint( get_option( 'default_link_category' ) ) != $category->term_id ) {
    192                 $output .= "<input type='checkbox' name='delete[]' value='$category->term_id' />";
    193                } else {
    194                 $output .= "&nbsp;";
    195                }
    196                $output .= "</th>";
    197                break;
     190                $output .= "<th scope='row' class='check-column'>";
     191                if ( absint( get_option( 'default_link_category' ) ) != $category->term_id ) {
     192                    $output .= "<input type='checkbox' name='delete[]' value='$category->term_id' />";
     193                } else {
     194                    $output .= "&nbsp;";
     195                }
     196                $output .= "</th>";
     197                break;
    198198            case 'name':
    199199                $output .= "<td $attributes>$edit</td>";
     
    250250
    251251        $class = in_array( $category->term_id, $popular_cats ) ? ' class="popular-category"' : '';
    252         $output .= "\n<li id='category-$category->term_id'$class>" . '<label for="in-category-' . $category->term_id . '" class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="post_category[]" id="in-category-' . $category->term_id . '"' . (in_array( $category->term_id, $selected_cats ) ? ' checked="checked"' : "" ) . '/> ' . wp_specialchars( apply_filters('the_category', $category->name )) . '</label>';
     252        $output .= "\n<li id='category-$category->term_id'$class>" . '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="post_category[]" id="in-category-' . $category->term_id . '"' . (in_array( $category->term_id, $selected_cats ) ? ' checked="checked"' : "" ) . '/> ' . wp_specialchars( apply_filters('the_category', $category->name )) . '</label>';
    253253    }
    254254
     
    316316
    317317        <li id="<?php echo $id; ?>" class="popular-category">
    318             <label class="selectit" for="in-<?php echo $id; ?>">
     318            <label class="selectit">
    319319            <input id="in-<?php echo $id; ?>" type="checkbox" value="<?php echo (int) $category->term_id; ?>" />
    320320                <?php echo wp_specialchars( apply_filters( 'the_category', $category->name ) ); ?>
     
    370370
    371371        $name = apply_filters( 'term_name', $tag->name );
    372         $edit_link = "edit-tags.php?action=edit&amp;tag_ID=$tag->term_id"; 
     372        $edit_link = "edit-tags.php?action=edit&amp;tag_ID=$tag->term_id";
    373373        $out = '';
    374374        $out .= '<tr id="tag-' . $tag->term_id . '"' . $class . '>';
     
    389389                    break;
    390390                case 'name':
    391                     $out .= '<td ' .  $attributes . '><strong><a class="row-title" href="' . $edit_link . '" title="' . attribute_escape(sprintf(__('Edit "%s"'), $name)) . '">' . $name . '</a></strong><br />';
     391                    $out .= '<td ' . $attributes . '><strong><a class="row-title" href="' . $edit_link . '" title="' . attribute_escape(sprintf(__('Edit "%s"'), $name)) . '">' . $name . '</a></strong><br />';
    392392                    $actions = array();
    393393                    $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
    394                     $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("edit-tags.php?action=delete&amp;tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this tag '%s'\n  'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
     394                    $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("edit-tags.php?action=delete&amp;tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this tag '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
    395395                    $action_count = count($actions);
    396396                    $i = 0;
     
    572572
    573573function print_column_headers( $type ) {
    574     $columns = get_column_headers( $type ); 
     574    $columns = get_column_headers( $type );
    575575    $hidden = (array) get_user_option( "manage-$type-columns-hidden" );
    576576    $styles = array();
     
    603603        $style = ' style="' . $style . '"';
    604604?>
    605     <th scope="col"<?php echo "id=\"$column_key\""; echo $class; echo $style?>><?php echo $column_display_name; ?></th>
     605    <th scope="col" <?php echo "id=\"$column_key\""; echo $class; echo $style?>><?php echo $column_display_name; ?></th>
    606606<?php }
    607607}
    608608
    609609function inline_edit_row( $type ) {
    610     global $current_user;
    611 
    612     if ( 'post' == $type )
    613         $post = get_default_post_to_edit();
    614     else
    615         $post = get_default_page_to_edit(); 
    616 
    617     echo '<tr id="inline-edit" style="display: none">';
    618     $columns = $type == 'post' ? wp_manage_posts_columns() : wp_manage_pages_columns();
     610    global $current_user, $mode;
     611
     612    $is_page = 'page' == $type;
     613    if ( $is_page )
     614        $post = get_default_page_to_edit();
     615    else
     616        $post = get_default_post_to_edit();
     617
     618    $columns = $is_page ? wp_manage_pages_columns() : wp_manage_posts_columns();
    619619    $hidden = (array) get_user_option( "manage-$type-columns-hidden" );
     620    $hidden_count = empty($hidden[0]) ? 0 : count($hidden);
     621    $col_count = count($columns) - $hidden_count;
     622    $m = ( isset($mode) && 'excerpt' == $mode ) ? 'excerpt' : 'list';
     623    ?>
     624    <tr title="<?php _e('Double-click to cancel'); ?>" id="inline-edit" style="display: none"><td colspan="<?php echo $col_count; ?>">
     625    <?php
    620626    foreach($columns as $column_name=>$column_display_name) {
    621         $class = "class=\"$column_name column-$column_name\"";
     627        $class = "class=\"$column_name column-$column_name quick-edit-div\"";
    622628
    623629        $style = '';
     
    628634
    629635        switch($column_name) {
    630 
    631             case 'cb': ?>
    632               <th class="check-column"></th>
    633               <?php
    634               break;
     636            case 'cb':
     637                break;
    635638
    636639            case 'modified':
    637640            case 'date':
    638                 $attributes = 'class="date column-date"' . $style;
    639641            ?>
    640                 <td class="date"<?php echo $style ?>>
     642                <div <?php echo $attributes; ?> title="<?php _e('Timestamp'); ?>">
     643                    <div class="title"><?php _e('Timestamp'); ?></div>
     644                    <div class="in">
    641645                    <?php touch_time(1, 1, 4, 1); ?>
    642                 </td>
     646                    </div>
     647                </div>
    643648                <?php
    644649                break;
    645650
    646651            case 'title':
    647                 $attributes = "class=\"$type-title column-title\"" . $style;
    648             ?>
    649                 <td <?php echo $attributes ?>>
    650                     <?php wp_nonce_field( 'inlineeditnonce', 'inline_edit_nonce', false ) ?>
    651                     <div class="title">
    652                         <input type="text" name="post_title" class="title" value="" /><br />
    653                         <label><?php _e('Slug'); ?></label><input type="text" name="post_name" value="" class="slug" />
     652                $attributes = "class=\"$type-title column-title quick-edit-div\"" . $style; ?>
     653                <div <?php echo $attributes ?>>
     654                    <div class="title"><?php _e('Title'); ?></div>
     655                    <div class="in">
     656                    <label title="<?php _e('Title'); ?>"><input type="text" name="post_title" class="ptitle" value="" /></label><br />
     657                    <div class="slug">
     658                    <label title="<?php _e('Slug'); ?>"><?php _e('Slug'); ?><input type="text" name="post_name" value="" /></label></div>
    654659                    </div>
    655                     <?php if ($type == 'page'): ?>
    656                     <div class="other">
    657                         <label><?php _e('Parent'); ?></label>
    658                         <select name="post_parent">
    659                             <option value="0"><?php _e('Main Page (no parent)'); ?></option>
    660                             <?php parent_dropdown(); ?>
    661                         </select><br />
    662                         <label><?php _e('Template'); ?></label>
    663                         <select name="page_template">
    664                             <option value='default'><?php _e('Default Template'); ?></option>
    665                             <?php page_template_dropdown() ?>
    666                         </select>
     660                </div>
     661                <?php if ( $is_page ) { ?>
     662                <div class="parent quick-edit-div" title="<?php _e('Page Parent'); ?>">
     663                    <div class="title"><?php _e('Page Parent'); ?></div>
     664                    <div class="in">
     665                    <select name="post_parent">
     666                        <option value="0"><?php _e('Main Page (no parent)'); ?></option>
     667                        <?php parent_dropdown(); ?>
     668                    </select>
    667669                    </div>
    668                     <div class="more">
    669                         <label><?php _e('Order'); ?></label><input type="text" name="menu_order" value="<?php echo $post->menu_order ?>" />
    670                         <label><?php _e('Password'); ?></label><input type="text" name="post_password" value="<?php echo $post->post_password ?>" />     
     670                </div>
     671                <div class="template quick-edit-div" title="<?php _e('Page Template'); ?>">
     672                    <div class="title"><?php _e('Page Template'); ?></div>
     673                    <div class="in">
     674                    <select name="page_template">
     675                        <option value='default'><?php _e('Default Template'); ?></option>
     676                        <?php page_template_dropdown() ?>
     677                    </select>
    671678                    </div>
    672                     <?php endif; ?>
    673                     <div class="clear"></div>
    674                     <div class="save">
    675                     <?php
    676                     $actions = array();
    677                     $actions['save'] = '<a href="#">' . __('Save') . '</a>';
    678                     $actions['cancel'] = '<a href="#">' . __('Cancel') . '</a>';
    679                     $action_count = count($actions);
    680                     $i = 0;
    681                     foreach ( $actions as $action => $link ) {
    682                         ++$i;
    683                         ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
    684                         echo "<span class='$action'>$link$sep</span>";
    685                     }
    686                     ?>
     679                </div>
     680                <div class="order quick-edit-div" title="<?php _e('Page Order'); ?>">
     681                    <div class="title"><?php _e('Page Order'); ?></div>
     682                    <div class="in">
     683                    <input type="text" name="menu_order" value="<?php echo $post->menu_order ?>" />
    687684                    </div>
    688                 </td>
     685                </div>
     686                <?php }
     687
     688                break;
     689
     690            case 'categories': ?>
     691                <div <?php echo $attributes ?> title="<?php _e('Categories'); ?>">
     692                    <div class="title"><?php _e('Categories'); ?>
     693                    <span class="catshow"><?php _e('(expand)'); ?></span>
     694                    <span class="cathide" style="display:none;"><?php _e('(fold)'); ?></span></div>
     695                    <ul class="cat-checklist">
     696                        <?php wp_category_checklist(); ?>
     697                    </ul>
     698                </div>
    689699                <?php
    690700                break;
    691701
    692             case 'categories': ?>
    693                 <td <?php echo $attributes ?>>
    694                     <ul class="categories">
    695                         <?php wp_category_checklist() ?>
    696                     </ul>
    697                 </td>
     702            case 'tags': ?>
     703                <div <?php echo $attributes ?> title="<?php _e('Tags'); ?>">
     704                    <div class="title"><?php _e('Tags'); ?></div>
     705                    <div class="in">
     706                    <textarea cols="22" rows="1" type="text" name="tags_input" class="tags_input"></textarea>
     707                    </div>
     708                </div>
    698709                <?php
    699710                break;
    700711
    701             case 'tags': ?>
    702                 <td <?php echo $attributes ?>>
    703                     <textarea name="tags_input"></textarea>
    704                 </td>
     712            case 'comments':
     713                $attributes = 'class="comments column-comments num quick-edit-div"' . $style; ?>
     714                <div <?php echo $attributes ?> title="<?php _e('Comments and Pings'); ?>">
     715                    <div class="title"><?php _e('Comments and Pings'); ?></div>
     716                    <div class="in">
     717                    <label><input type="checkbox" name="comment_status" value="open" />
     718                    <?php _e('Allow Comments'); ?></label><br />
     719                    <label><input type="checkbox" name="ping_status" value="open" />
     720                    <?php _e('Allow Pings'); ?></label>
     721                    </div>
     722                </div>
    705723                <?php
    706724                break;
    707725
    708             case 'comments':
    709                 $attributes = 'class="comments column-comments num"' . $style;
    710              ?>
    711                 <td <?php echo $attributes ?>>
    712                     <input title="Allow Comments" type="checkbox" name="comment_status" value="open" /><br />
    713                     <input title="Allow Pings" type="checkbox" name="ping_status" value="open" />
    714                 </td>
     726            case 'author':
     727                $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
     728                if ( $authors && count( $authors ) > 1 ) { ?>
     729                <div <?php echo $attributes ?> title="<?php _e('Author'); ?>">
     730                    <div class="title"><?php _e('Author'); ?></div>
     731                    <div class="in">
     732                    <?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author', 'class'=> 'authors', 'selected' => $post->post_author) ); ?>
     733                    </div>
     734                </div>
     735                <?php } ?>
     736
     737                <div class="password quick-edit-div" title="<?php _e('Password'); ?>">
     738                    <div class="title"><?php _e('Password'); ?></div>
     739                    <div class="in">
     740                    <input type="text" name="post_password" value="<?php echo $post->post_password ?>" />
     741                    <label title="<?php _e('Privacy'); ?>">
     742                    <input type="checkbox" name="keep_private" value="private" <?php checked($post->post_status, 'private'); ?> /> <?php echo $is_page ? __('Keep this page private') : __('Keep this post private'); ?></label>
     743                    </div>
     744                </div>
    715745                <?php
    716746                break;
    717747
    718             case 'author': ?>
    719                 <td <?php echo $attributes ?>>
    720                     <?php
    721                     $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
    722                     if ( $authors && count( $authors ) > 1 ) {
    723                         wp_dropdown_users( array('include' => $authors, 'name' => 'post_author', 'class'=> 'author', 'selected' => $post->post_author) );
    724                     } else {
    725                         echo $current_user->user_nicename.'<input type="hidden" value="'.$post->post_author.'" class="author" />';
    726                     }
    727                     ?>
    728                 </td>
    729                 <?php
    730                 break;
    731 
    732748            case 'status': ?>
    733                 <td <?php echo $attributes ?>>
     749                <div <?php echo $attributes ?> title="<?php _e('Status'); ?>">
     750                    <div class="title"><?php _e('Status'); ?></div>
     751                    <div class="in">
    734752                    <select name="post_status">
    735                         <?php if ( current_user_can('publish_posts') ) : // Contributors only get "Unpublished" and "Pending Review" ?>
     753                        <?php if ( current_user_can('publish_posts') ) { // Contributors only get "Unpublished" and "Pending Review" ?>
    736754                        <option value='publish'><?php _e('Published') ?></option>
    737755                        <option value='future'><?php _e('Scheduled') ?></option>
    738                         <?php endif; ?>
     756                        <?php } ?>
    739757                        <option value='pending'><?php _e('Pending Review') ?></option>
    740758                        <option value='draft'><?php _e('Unpublished') ?></option>
    741759                    </select>
    742                     <?php if($type == 'page'): ?>
    743                     <br /><label><input type="checkbox" name="page_private" value="private" <?php checked($post->post_status, 'private'); ?> /> <?php _e('Private') ?></label></p>
    744                     <?php else: ?>
    745                     <?php if ( current_user_can( 'edit_others_posts' ) ) : ?>
    746                     <br /><label><input type="checkbox" name="sticky" value="sticky" /> <?php _e('Sticky') ?></label></p>
    747                     <?php endif; ?>
    748                     <?php endif; ?>
    749                 </td>
     760                    </div>
     761                </div>
     762
     763                <?php if ( current_user_can( 'edit_others_posts' ) && ! $is_page ) { ?>
     764                <div class="sticky quick-edit-div" <?php echo $style; ?> title="<?php _e('Sticky') ?>">
     765                    <div class="title"><?php _e('Sticky'); ?></div>
     766                    <div class="in">
     767                    <label title="<?php _e('Sticky') ?>">
     768                    <input type="checkbox" name="sticky" value="sticky" /> <?php _e('Stick this post to the front page') ?></label>
     769                    </div>
     770                </div>
     771                <?php }
     772                break;
     773
     774            case 'control_view': ?>
     775                <div><a href="<?php the_permalink(); ?>" rel="permalink" class="view"><?php _e('View'); ?></a></div>
    750776                <?php
    751777                break;
    752778
    753             case 'control_view': ?>
    754                 <td><a href="<?php the_permalink(); ?>" rel="permalink" class="view"><?php _e('View'); ?></a></td>
     779            case 'control_edit': ?>
     780                <div><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='post.php?action=edit&amp;post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></div>
    755781                <?php
    756782                break;
    757783
    758             case 'control_edit': ?>
    759                 <td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='post.php?action=edit&amp;post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>
     784            case 'control_delete': ?>
     785                <div><?php if ( current_user_can('delete_post',$post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;post=$id", 'delete-post_' . $post->ID) . "' class='delete'>" . __('Delete') . "</a>"; } ?></div>
    760786                <?php
    761787                break;
    762788
    763             case 'control_delete': ?>
    764                 <td><?php if ( current_user_can('delete_post',$post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;post=$id", 'delete-post_' . $post->ID) . "' class='delete'>" . __('Delete') . "</a>"; } ?></td>
     789            default: ?>
     790                <div><?php do_action('manage_posts_custom_column', $column_name, $post->ID); ?></div>
    765791                <?php
    766792                break;
    767 
    768             default: ?>
    769                 <td><?php do_action('manage_posts_custom_column', $column_name, $post->ID); ?></td>
    770                 <?php
    771                 break;
    772         }
    773     }
    774 
    775     echo '</tr>';
    776 }
    777 
    778 function inline_save_row( $data ) { 
     793        }
     794    } ?>
     795
     796    <div class="clear"></div>
     797    <div class="quick-edit-save">
     798        <a accesskey="c" href="#inline-edit" title="<?php _e('Cancel'); ?>" class="button-secondary cancel"><?php _e('Cancel'); ?></a>
     799        <a accesskey="s" href="#inline-edit" title="<?php _e('Save'); ?>" class="button-secondary save"><?php _e('Save'); ?></a>
     800        <?php wp_nonce_field( 'inlineeditnonce', '_inline_edit', false ) ?>
     801        <input type="hidden" name="post_view" value="<?php echo $m; ?>" />
     802    </div>
     803    </td></tr>
     804<?php
     805}
     806
     807function inline_save_row( $data ) {
    779808    // get the original post content
    780809    $post = get_post( $data['post_ID'], ARRAY_A );
     
    782811
    783812    // statuses
    784     if ( 'page' == $data['post_type'] && 'private' == $data['page_private'] )
     813    if ( 'private' == $data['keep_private'] )
    785814        $data['post_status'] = 'private';
    786     if ( empty($data['comment_status']) ) 
     815    if ( empty($data['comment_status']) )
    787816        $data['comment_status'] = 'closed';
    788817    if ( empty($data['ping_status']) )
     
    800829}
    801830
    802 // outputs XML of the post/page data ready for use in the inline editor
    803 // accepts array of post IDs
    804 function get_inline_data($posts) {
    805     global $post;
    806 
    807     header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
    808     echo "<?xml version='1.0' ?>\n";
    809     echo "<posts>\n";
    810 
    811     foreach ($posts as $ID) {
    812         $GLOBALS['post'] = get_post($ID);
    813         $GLOBALS['post_ID'] = $ID;
    814 
    815         if ( ($post->post_type == 'post' && !current_user_can('edit_post', $ID)) ||
    816                 ($post->post_type == 'page' && !current_user_can('edit_page', $ID)) ||
    817                 ($post->post_type != 'post' && $post->post_type != 'page'))
    818             continue;
    819 
    820         echo "  <post id='$ID'>\n";
    821         echo "    <post_title>" . wp_specialchars($post->post_title, 1) . "</post_title>\n";
    822         echo "    <post_name>$post->post_name</post_name>\n";
    823         echo "    <post_author>$post->post_author</post_author>\n";
    824         echo "    <comment_status>$post->comment_status</comment_status>\n";
    825         echo "    <ping_status>$post->ping_status</ping_status>\n";
    826         echo "    <post_status>$post->post_status</post_status>\n";
    827         echo "    <jj>" . mysql2date( 'd', $post->post_date ) . "</jj>\n";
    828         echo "    <mm>" . mysql2date( 'm', $post->post_date ) . "</mm>\n";
    829         echo "    <aa>" . mysql2date( 'Y', $post->post_date ) . "</aa>\n";
    830         echo "    <hh>" . mysql2date( 'H', $post->post_date ) . "</hh>\n";
    831         echo "    <mn>" . mysql2date( 'i', $post->post_date ) . "</mn>\n";
    832         if( $post->post_type == 'post' ) {
    833             echo '    <tags_input>' . wp_specialchars(get_tags_to_edit( $post->ID ), 1) . "</tags_input>\n";
    834             echo '    <post_category>' . implode( ',', wp_get_post_categories( $post->ID ) ) . "</post_category>\n";
    835             echo '    <sticky>' . (is_sticky($post->ID) ? 'sticky' : '') . "</sticky>\n";
    836         }
    837         if( $post->post_type == 'page' ) {
    838             echo "    <post_parent>$post->post_parent</post_parent>\n";
    839             echo '    <page_template>' . wp_specialchars(get_post_meta( $post->ID, '_wp_page_template', true ), 1) . "</page_template>\n";
    840             echo "    <post_password>" . wp_specialchars($post->post_password, 1) . "</post_password>\n";
    841             echo "    <menu_order>$post->menu_order</menu_order>\n";
    842         }
    843         echo "  </post>\n";
    844     }
    845 
    846     echo '</posts>';
     831// adds hidden fields with the data for use in the inline editor
     832function get_inline_data($post) {
     833
     834    if ( ! current_user_can('edit_' . $post->post_type, $post->ID) )
     835        return;
     836   
     837    $title = apply_filters( 'the_title', $post->post_title );
     838    if ( empty($title) )
     839        $title = __('(no title)');
     840
     841    echo '
     842<div id="inline_' . $post->ID . '">
     843    <input type="hidden" name="" class="post_title" value="' . $title . '" />
     844    <input type="hidden" name="" class="post_name" value="' . $post->post_name . '" />
     845    <input type="hidden" name="" class="post_author" value="' . $post->post_author . '" />
     846    <input type="hidden" name="" class="comment_status" value="' . $post->comment_status . '" />
     847    <input type="hidden" name="" class="ping_status" value="' . $post->ping_status . '" />
     848    <input type="hidden" name="" class="post_status" value="' . $post->post_status . '" />
     849    <input type="hidden" name="" class="jj" value="' . mysql2date( 'd', $post->post_date ) . '" />
     850    <input type="hidden" name="" class="mm" value="' . mysql2date( 'm', $post->post_date ) . '" />
     851    <input type="hidden" name="" class="aa" value="' . mysql2date( 'Y', $post->post_date ) . '" />
     852    <input type="hidden" name="" class="hh" value="' . mysql2date( 'H', $post->post_date ) . '" />
     853    <input type="hidden" name="" class="mn" value="' . mysql2date( 'i', $post->post_date ) . '" />
     854    <input type="hidden" name="" class="post_password" value="' . wp_specialchars($post->post_password, 1) . '" />';
     855
     856    if( $post->post_type == 'page' )
     857        echo '
     858    <input type="hidden" name="" class="post_parent" value="' . $post->post_parent . '" />
     859    <input type="hidden" name="" class="page_template" value="' . wp_specialchars(get_post_meta( $post->ID, '_wp_page_template', true ), 1) . '" />
     860    <input type="hidden" name="" class="menu_order" value="' . $post->menu_order . '" />';
     861   
     862    if( $post->post_type == 'post' )
     863        echo '
     864    <input type="hidden" name="" class="tags_input" value="' . wp_specialchars( str_replace( ',', ', ', get_tags_to_edit($post->ID) ), 1) . '" />
     865    <input type="hidden" name="" class="post_category" value="' . implode( ',', wp_get_post_categories( $post->ID ) ) . '" />
     866    <input type="hidden" name="" class="sticky" value="' . (is_sticky($post->ID) ? 'sticky' : '') . '" />';
     867       
     868    echo '</div>';
    847869}
    848870
     
    875897function _post_row($a_post, $pending_comments, $mode) {
    876898    global $post;
    877     static $class;
     899    static $rowclass;
    878900
    879901    $global_post = $post;
     
    881903    setup_postdata($post);
    882904
    883     $class = 'alternate' == $class ? '' : 'alternate';
     905    $rowclass = 'alternate' == $rowclass ? '' : 'alternate';
    884906    global $current_user;
    885907    $post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
     
    889911        $title = __('(no title)');
    890912?>
    891     <tr id='post-<?php echo $post->ID; ?>' class='<?php echo trim( $class . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top">
     913    <tr id='post-<?php echo $post->ID; ?>' class='<?php echo trim( $rowclass . ' author-' . $post_owner . ' status-' . $post->post_status ); ?> iedit' valign="top">
    892914<?php
    893915    $posts_columns = wp_manage_posts_columns();
     
    935957            }
    936958
    937             if ( 'excerpt' == $mode ) { ?>
    938         <td <?php echo $attributes ?>><?php echo apply_filters('post_date_column_time', $t_time, $post, $column_name, $mode) ?></td>
    939         <?php } else { ?>
    940         <td <?php echo $attributes ?>><abbr title="<?php echo $t_time ?>"><?php echo apply_filters('post_date_column_time', $h_time, $post, $column_name, $mode) ?></abbr></td>
    941         <?php }
     959            echo '<td ' . $attributes . '>';
     960            if ( 'excerpt' == $mode )
     961                echo apply_filters('post_date_column_time', $t_time, $post, $column_name, $mode);
     962            else
     963                echo '<abbr title="' . $t_time . '">' . apply_filters('post_date_column_time', $h_time, $post, $column_name, $mode) . '</abbr>';
     964           
     965            echo '</td>';
    942966        break;
    943967
     
    955979            $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
    956980            $actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>';
    957             $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
     981            $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
    958982            if ( in_array($post->post_status, array('pending', 'draft')) )
    959983                $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . attribute_escape(sprintf(__('Preview "%s"'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
     
    967991                echo "<span class='$action'>$link$sep</span>";
    968992            }
     993
     994            get_inline_data($post);
    969995        ?>
    970996        </td>
     
    10891115function display_page_row( $page, $level = 0 ) {
    10901116    global $post;
    1091     static $class;
     1117    static $rowclass;
    10921118
    10931119    $post = $page;
     
    10971123    $pad = str_repeat( '&#8212; ', $level );
    10981124    $id = (int) $page->ID;
    1099     $class = ('alternate' == $class ) ? '' : 'alternate';
     1125    $rowclass = 'alternate' == $rowclass ? '' : 'alternate';
    11001126    $posts_columns = wp_manage_pages_columns();
    11011127    $hidden = (array) get_user_option( 'manage-page-columns-hidden' );
     
    11041130        $title = __('(no title)');
    11051131?>
    1106   <tr id='page-<?php echo $id; ?>' class='<?php echo $class; ?>'>
    1107 
    1108 
    1109  <?php
     1132<tr id="page-<?php echo $id; ?>" class="<?php echo $rowclass; ?> iedit">
     1133<?php
    11101134
    11111135foreach ($posts_columns as $column_name=>$column_display_name) {
     
    11641188        $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
    11651189        $actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>';
    1166         $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("page.php?action=delete&amp;post=$page->ID", 'delete-page_' . $page->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
     1190        $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("page.php?action=delete&amp;post=$page->ID", 'delete-page_' . $page->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
    11671191        if ( in_array($post->post_status, array('pending', 'draft')) )
    11681192            $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . attribute_escape(sprintf(__('Preview "%s"'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
     
    11761200            echo "<span class='$action'>$link$sep</span>";
    11771201        }
    1178         ?>
    1179         </td>
    1180         <?php
     1202       
     1203        get_inline_data($post);
     1204        echo '</td>';
    11811205        break;
    11821206
     
    12371261    }
    12381262}
    1239  ?>
    1240 
    1241    </tr>
     1263?>
     1264
     1265</tr>
    12421266
    12431267<?php
     
    12661290     * If searching, ignore hierarchy and treat everything as top level
    12671291     */
    1268     if ( empty($_GET['s']) )  {
     1292    if ( empty($_GET['s']) ) {
    12691293
    12701294        $top_level_pages = array();
    1271         $children_pages  = array();
     1295        $children_pages = array();
    12721296
    12731297        foreach ( $pages as $page ) {
     
    13801404        $short_url = substr( $short_url, 0, -1 );
    13811405    if ( strlen( $short_url ) > 35 )
    1382         $short_url =  substr( $short_url, 0, 32 ).'...';
     1406        $short_url = substr( $short_url, 0, 32 ).'...';
    13831407    $numposts = get_usernumposts( $user_object->ID );
    13841408    if ( current_user_can( 'edit_user', $user_object->ID ) ) {
     
    13911415        $actions = array();
    13921416        $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
    1393         $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("users.php?action=delete&amp;user=$user_object->ID", 'bulk-users') . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this user '%s'\n  'Cancel' to stop, 'OK' to delete."), $user_object->user_login )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
     1417        $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("users.php?action=delete&amp;user=$user_object->ID", 'bulk-users') . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this user '%s'\n 'Cancel' to stop, 'OK' to delete."), $user_object->user_login )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
    13941418        $action_count = count($actions);
    13951419        $i = 0;
     
    15121536        $ptime = mysql2date(__('Y/m/d \a\t g:i A'), $comment->comment_date );
    15131537
    1514     $delete_url    = clean_url( wp_nonce_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
    1515     $approve_url   = clean_url( wp_nonce_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) );
     1538    $delete_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
     1539    $approve_url = clean_url( wp_nonce_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) );
    15161540    $unapprove_url = clean_url( wp_nonce_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "unapprove-comment_$comment->comment_ID" ) );
    1517     $spam_url      = clean_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
     1541    $spam_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
    15181542
    15191543?>
    1520   <tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $the_comment_status; ?>'>
     1544<tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $the_comment_status; ?>'>
    15211545<?php if ( $checkbox ) : ?>
    1522     <td class="check-column"><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td>
     1546    <td class="check-column"><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td>
    15231547<?php endif; ?>
    1524     <td class="comment-column">
    1525     <?php if ( 'detail' == $mode || 'single' == $mode ) comment_text(); ?>
    1526    
     1548    <td class="comment-column">
     1549    <?php if ( 'detail' == $mode || 'single' == $mode ) comment_text(); ?>
     1550
    15271551<?php
    15281552    $actions = array();
    15291553
    15301554    if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
    1531         $actions['approve']   = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
     1555        $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
    15321556        $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
    15331557        if ( $comment_status ) { // not looking at all comments
     
    15411565        }
    15421566        if ( 'spam' != $the_comment_status )
    1543             $actions['spam']      = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a>';
     1567            $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a>';
    15441568        $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>';
    15451569        $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>';
     
    15651589    }
    15661590    ?>
    1567     </td>
     1591    </td>
    15681592    <td class="author-column">
    15691593        <strong><?php comment_author(); ?></strong><br />
    1570         <?php if ( !empty($author_url) ) : ?>
    1571         <a href="<?php echo $author_url ?>"><?php echo $author_url_display; ?></a><br />
    1572         <?php endif; ?>
    1573         <?php if ( current_user_can( 'edit_post', $post->ID ) ) : ?>
    1574         <?php if ( !empty($comment->comment_author_email) ): ?>
    1575         <?php comment_author_email_link() ?><br />
    1576         <?php endif; ?>
    1577         <a href="edit-comments.php?s=<?php comment_author_IP() ?>&amp;mode=detail"><?php comment_author_IP() ?></a>
    1578         <?php endif; //current_user_can?>   
     1594        <?php if ( !empty($author_url) ) : ?>
     1595        <a href="<?php echo $author_url ?>"><?php echo $author_url_display; ?></a><br />
     1596        <?php endif; ?>
     1597        <?php if ( current_user_can( 'edit_post', $post->ID ) ) : ?>
     1598        <?php if ( !empty($comment->comment_author_email) ): ?>
     1599        <?php comment_author_email_link() ?><br />
     1600        <?php endif; ?>
     1601        <a href="edit-comments.php?s=<?php comment_author_IP() ?>&amp;mode=detail"><?php comment_author_IP() ?></a>
     1602        <?php endif; //current_user_can?>
    15791603    </td>
    1580     <td class="date-column"><?php comment_date(__('Y/m/d \a\t g:ia')); ?></td>
     1604    <td class="date-column"><?php comment_date(__('Y/m/d \a\t g:ia')); ?></td>
    15811605<?php if ( 'single' !== $mode ) : ?>
    1582     <td class="response-column">
    1583     "<?php echo $post_link ?>" <?php echo sprintf('(%s comments)', $post->comment_count); ?><br />
    1584     <?php echo get_the_time(__('Y/m/d \a\t g:ia')); ?>
    1585     </td>
     1606    <td class="response-column">
     1607    "<?php echo $post_link ?>" <?php echo sprintf('(%s comments)', $post->comment_count); ?><br />
     1608    <?php echo get_the_time(__('Y/m/d \a\t g:ia')); ?>
     1609    </td>
    15861610<?php endif; ?>
    1587   </tr>
     1611</tr>
    15881612    <?php
    15891613}
     
    15941618    // allow plugin to replace the popup content
    15951619    $content = apply_filters( 'wp_comment_reply', '', array('position'=>$position, 'checkbox'=>$checkbox, 'mode'=>$mode) );
    1596    
     1620
    15971621    if ( ! empty($content) ) {
    15981622        echo $content;
     
    16071631    <button id="back-button" onclick="commentReply.back();" class="button"><?php _e('Go back'); ?></button></p>
    16081632    </div>
    1609    
     1633
    16101634    <div id="replydiv" style="display:none;">
    16111635    <p id="replyhandle"><?php _e('Reply'); ?></p>
     
    17001724    }
    17011725
    1702     $entry['meta_key']   = attribute_escape($entry['meta_key']);
     1726    $entry['meta_key'] = attribute_escape($entry['meta_key']);
    17031727    $entry['meta_value'] = htmlspecialchars($entry['meta_value']); // using a <textarea />
    17041728    $entry['meta_id'] = (int) $entry['meta_id'];
     
    17931817    $month .= '</select>';
    17941818
    1795     $day = '<input type="text" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off"  />';
    1796     $year = '<input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="5"' . $tab_index_attribute . ' autocomplete="off"  />';
    1797     $hour = '<input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off"  />';
    1798     $minute = '<input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off"  />';
     1819    $day = '<input type="text" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
     1820    $year = '<input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="5"' . $tab_index_attribute . ' autocomplete="off" />';
     1821    $hour = '<input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
     1822    $minute = '<input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    17991823    printf(_c('%1$s%2$s, %3$s @ %4$s : %5$s|1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input'), $month, $day, $year, $hour, $minute);
    18001824
    18011825    if ( $multi ) return;
    1802    
     1826
    18031827    echo "\n\n";
    18041828    foreach ( array('mm', 'jj', 'aa', 'hh', 'mn') as $timeunit )
     
    18921916    <tr>
    18931917        <th scope="row"><?php _e( 'Link to file' ) ?></th>
    1894         <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo wp_get_attachment_url(); ?>" class="attachmentlink"><?php echo basename( wp_get_attachment_url() );  ?></a></textarea></td>
     1918        <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo wp_get_attachment_url(); ?>" class="attachmentlink"><?php echo basename( wp_get_attachment_url() ); ?></a></textarea></td>
    18951919    </tr>
    18961920    <tr>
     
    19782002 * @param string $id String for use in the 'id' attribute of tags.
    19792003 * @param string $title Title of the meta box
    1980  * @param string $callback Function that fills the box with the desired content.  The function should echo its output.
     2004 * @param string $callback Function that fills the box with the desired content. The function should echo its output.
    19812005 * @param string $page The type of edit page on which to show the box (post, page, link)
    19822006 * @param string $context The context within the page where the boxes should show ('normal', 'advanced')
     
    19862010    global $wp_meta_boxes;
    19872011
    1988     if  ( !isset($wp_meta_boxes) )
     2012    if ( !isset($wp_meta_boxes) )
    19892013        $wp_meta_boxes = array();
    19902014    if ( !isset($wp_meta_boxes[$page]) )
     
    20132037        if ( empty($priority) ) {
    20142038            $priority = $a_priority;
    2015         // else if we're adding to the sorted priortiy, we don't know the title or callback.  Glab them from the previously added context/priority.
     2039        // else if we're adding to the sorted priortiy, we don't know the title or callback. Glab them from the previously added context/priority.
    20162040        } elseif ( 'sorted' == $priority ) {
    20172041            $title = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['title'];
     
    20442068
    20452069    $i = 0;
    2046     do { 
    2047         // Grab the ones the user has manually sorted.  Pull them out of their previous context/priority and into the one the user chose
     2070    do {
     2071        // Grab the ones the user has manually sorted. Pull them out of their previous context/priority and into the one the user chose
    20482072        if ( !$already_sorted && $sorted = get_user_option( "meta-box-order_$page" ) ) {
    20492073            foreach ( $sorted as $box_context => $ids )
     
    20952119    global $wp_meta_boxes;
    20962120
    2097     if  ( !isset($wp_meta_boxes) )
     2121    if ( !isset($wp_meta_boxes) )
    20982122        $wp_meta_boxes = array();
    20992123    if ( !isset($wp_meta_boxes[$page]) )
     
    21382162 * @param string $id String for use in the 'id' attribute of tags.
    21392163 * @param string $title Title of the section
    2140  * @param string $callback Function that fills the section with the desired content.  The function should echo its output.
     2164 * @param string $callback Function that fills the section with the desired content. The function should echo its output.
    21412165 * @param string $page The type of settings page on which to show the section (general, reading, writing, ...)
    21422166 */
     
    21442168    global $wp_settings_sections;
    21452169
    2146     if  ( !isset($wp_settings_sections) )
     2170    if ( !isset($wp_settings_sections) )
    21472171        $wp_settings_sections = array();
    21482172    if ( !isset($wp_settings_sections[$page]) )
     
    21612185 * @param string $id String for use in the 'id' attribute of tags.
    21622186 * @param string $title Title of the field
    2163  * @param string $callback Function that fills the field with the desired content.  The function should echo its output.
     2187 * @param string $callback Function that fills the field with the desired content. The function should echo its output.
    21642188 * @param string $page The type of settings page on which to show the field (general, reading, writing, ...)
    21652189 * @param string $section The section of the settingss page in which to show the box (default, ...)
     
    21692193    global $wp_settings_fields;
    21702194
    2171     if  ( !isset($wp_settings_fields) )
     2195    if ( !isset($wp_settings_fields) )
    21722196        $wp_settings_fields = array();
    21732197    if ( !isset($wp_settings_fields[$page]) )
     
    22122236        echo '</td>';
    22132237        echo '</tr>';
    2214     }   
     2238    }
    22152239}
    22162240
     
    22452269                    <input type="hidden" name="found_action" value="<?php echo $found_action; ?>" />
    22462270                <?php } ?>
    2247                
     2271
    22482272                <input type="hidden" name="affected" id="affected" value="" />
    22492273                <?php wp_nonce_field( 'find-posts', '_ajax_nonce', false ); ?>
     
    22802304                    minWidth: 280
    22812305                }).css({'top':st+'px','left':'50%','marginLeft':'-200px'});
    2282                
     2306
    22832307                $('.ui-resizable-handle').css({
    22842308                    'backgroundColor': '#e5e5e5'
    22852309                });
    2286                
     2310
    22872311                $('.ui-resizable-se').css({
    22882312                    'border': '0 none',
     
    22912315                    'background': 'transparent url(images/se.png) no-repeat scroll 0 0'
    22922316                });
    2293                
     2317
    22942318                $('#find-posts-input').focus().keyup(function(e){
    22952319                    if (e.which == 27) findPosts.close(); // close on Escape
    22962320                });
    2297                
     2321
    22982322                return false;
    22992323            },
    2300            
     2324
    23012325            close : function() {
    23022326                $('#find-posts-response').html('');
    23032327                $('#find-posts').draggable('destroy').resizable('destroy').hide();
    23042328            },
    2305            
     2329
    23062330            send : function() {
    23072331                var post = {};
     
    23102334                post['action'] = 'find_posts';
    23112335                post['_ajax_nonce'] = $('#_ajax_nonce').val();
    2312                
     2336
    23132337                if ( $('#find-posts-pages:checked').val() )
    23142338                    post['pages'] = 1;
    23152339                else
    23162340                    post['posts'] = 1;
    2317        
     2341
    23182342                $.ajax({
    23192343                    type : 'POST',
     
    23242348                });
    23252349            },
    2326            
     2350
    23272351            show : function(x) {
    23282352
     
    23362360                if ( r.errors )
    23372361                    this.error({'responseText': wpAjax.broken});
    2338        
     2362
    23392363                r = r.responses[0];
    23402364                $('#find-posts-response').html(r.data);
    23412365            },
    2342            
     2366
    23432367            error : function(r) {
    23442368                var er = r.statusText;
     
    23462370                if ( r.responseText )
    23472371                    er = r.responseText.replace( /<.[^<>]*?>/g, '' );
    2348        
     2372
    23492373                if ( er )
    23502374                    $('#find-posts-response').html(er);
    23512375            }
    23522376        };
    2353        
     2377
    23542378        $(document).ready(function(){
    23552379            $('#find-posts-submit').click(function(e) {
Note: See TracChangeset for help on using the changeset viewer.