Changeset 8943 for trunk/wp-admin/includes/template.php
- Timestamp:
- 09/21/2008 07:45:45 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r8940 r8943 87 87 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; 88 88 if ( $default_cat_id != $category->term_id ) 89 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("categories.php?action=delete&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 89 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("categories.php?action=delete&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>"; 90 90 $action_count = count($actions); 91 91 $i = 0; … … 158 158 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; 159 159 if ( $default_cat_id != $category->term_id ) 160 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("link-category.php?action=delete&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 160 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("link-category.php?action=delete&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>"; 161 161 $action_count = count($actions); 162 162 $i = 0; … … 188 188 switch ($column_name) { 189 189 case 'cb': 190 191 192 193 194 195 196 197 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 .= " "; 195 } 196 $output .= "</th>"; 197 break; 198 198 case 'name': 199 199 $output .= "<td $attributes>$edit</td>"; … … 250 250 251 251 $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>'; 253 253 } 254 254 … … 316 316 317 317 <li id="<?php echo $id; ?>" class="popular-category"> 318 <label class="selectit" for="in-<?php echo $id; ?>">318 <label class="selectit"> 319 319 <input id="in-<?php echo $id; ?>" type="checkbox" value="<?php echo (int) $category->term_id; ?>" /> 320 320 <?php echo wp_specialchars( apply_filters( 'the_category', $category->name ) ); ?> … … 370 370 371 371 $name = apply_filters( 'term_name', $tag->name ); 372 $edit_link = "edit-tags.php?action=edit&tag_ID=$tag->term_id"; 372 $edit_link = "edit-tags.php?action=edit&tag_ID=$tag->term_id"; 373 373 $out = ''; 374 374 $out .= '<tr id="tag-' . $tag->term_id . '"' . $class . '>'; … … 389 389 break; 390 390 case 'name': 391 $out .= '<td ' . 391 $out .= '<td ' . $attributes . '><strong><a class="row-title" href="' . $edit_link . '" title="' . attribute_escape(sprintf(__('Edit "%s"'), $name)) . '">' . $name . '</a></strong><br />'; 392 392 $actions = array(); 393 393 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; 394 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("edit-tags.php?action=delete&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 394 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("edit-tags.php?action=delete&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>"; 395 395 $action_count = count($actions); 396 396 $i = 0; … … 572 572 573 573 function print_column_headers( $type ) { 574 $columns = get_column_headers( $type ); 574 $columns = get_column_headers( $type ); 575 575 $hidden = (array) get_user_option( "manage-$type-columns-hidden" ); 576 576 $styles = array(); … … 603 603 $style = ' style="' . $style . '"'; 604 604 ?> 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> 606 606 <?php } 607 607 } 608 608 609 609 function inline_edit_row( $type ) { 610 global $current_user ;611 612 if ( 'post' == $type )613 $post = get_default_post_to_edit();614 else615 $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(); 619 619 $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 620 626 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\""; 622 628 623 629 $style = ''; … … 628 634 629 635 switch($column_name) { 630 631 case 'cb': ?> 632 <th class="check-column"></th> 633 <?php 634 break; 636 case 'cb': 637 break; 635 638 636 639 case 'modified': 637 640 case 'date': 638 $attributes = 'class="date column-date"' . $style;639 641 ?> 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"> 641 645 <?php touch_time(1, 1, 4, 1); ?> 642 </td> 646 </div> 647 </div> 643 648 <?php 644 649 break; 645 650 646 651 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> 654 659 </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> 667 669 </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> 671 678 </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 ?>" /> 687 684 </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> 689 699 <?php 690 700 break; 691 701 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> 698 709 <?php 699 710 break; 700 711 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> 705 723 <?php 706 724 break; 707 725 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> 715 745 <?php 716 746 break; 717 747 718 case 'author': ?>719 <td <?php echo $attributes ?>>720 <?php721 $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM722 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 <?php730 break;731 732 748 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"> 734 752 <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" ?> 736 754 <option value='publish'><?php _e('Published') ?></option> 737 755 <option value='future'><?php _e('Scheduled') ?></option> 738 <?php endif;?>756 <?php } ?> 739 757 <option value='pending'><?php _e('Pending Review') ?></option> 740 758 <option value='draft'><?php _e('Unpublished') ?></option> 741 759 </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> 750 776 <?php 751 777 break; 752 778 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&post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></div> 755 781 <?php 756 782 break; 757 783 758 case 'control_ edit': ?>759 < td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='post.php?action=edit&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&post=$id", 'delete-post_' . $post->ID) . "' class='delete'>" . __('Delete') . "</a>"; } ?></div> 760 786 <?php 761 787 break; 762 788 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&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> 765 791 <?php 766 792 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 807 function inline_save_row( $data ) { 779 808 // get the original post content 780 809 $post = get_post( $data['post_ID'], ARRAY_A ); … … 782 811 783 812 // statuses 784 if ( 'p age' == $data['post_type'] && 'private' == $data['page_private'] )813 if ( 'private' == $data['keep_private'] ) 785 814 $data['post_status'] = 'private'; 786 if ( empty($data['comment_status']) ) 815 if ( empty($data['comment_status']) ) 787 816 $data['comment_status'] = 'closed'; 788 817 if ( empty($data['ping_status']) ) … … 800 829 } 801 830 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 832 function 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>'; 847 869 } 848 870 … … 875 897 function _post_row($a_post, $pending_comments, $mode) { 876 898 global $post; 877 static $ class;899 static $rowclass; 878 900 879 901 $global_post = $post; … … 881 903 setup_postdata($post); 882 904 883 $ class = 'alternate' == $class ? '' : 'alternate';905 $rowclass = 'alternate' == $rowclass ? '' : 'alternate'; 884 906 global $current_user; 885 907 $post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' ); … … 889 911 $title = __('(no title)'); 890 912 ?> 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"> 892 914 <?php 893 915 $posts_columns = wp_manage_posts_columns(); … … 935 957 } 936 958 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>'; 942 966 break; 943 967 … … 955 979 $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>'; 956 980 $actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>'; 957 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&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&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>"; 958 982 if ( in_array($post->post_status, array('pending', 'draft')) ) 959 983 $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . attribute_escape(sprintf(__('Preview "%s"'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; … … 967 991 echo "<span class='$action'>$link$sep</span>"; 968 992 } 993 994 get_inline_data($post); 969 995 ?> 970 996 </td> … … 1089 1115 function display_page_row( $page, $level = 0 ) { 1090 1116 global $post; 1091 static $ class;1117 static $rowclass; 1092 1118 1093 1119 $post = $page; … … 1097 1123 $pad = str_repeat( '— ', $level ); 1098 1124 $id = (int) $page->ID; 1099 $ class = ('alternate' == $class )? '' : 'alternate';1125 $rowclass = 'alternate' == $rowclass ? '' : 'alternate'; 1100 1126 $posts_columns = wp_manage_pages_columns(); 1101 1127 $hidden = (array) get_user_option( 'manage-page-columns-hidden' ); … … 1104 1130 $title = __('(no title)'); 1105 1131 ?> 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 1110 1134 1111 1135 foreach ($posts_columns as $column_name=>$column_display_name) { … … 1164 1188 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; 1165 1189 $actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>'; 1166 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("page.php?action=delete&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&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>"; 1167 1191 if ( in_array($post->post_status, array('pending', 'draft')) ) 1168 1192 $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . attribute_escape(sprintf(__('Preview "%s"'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; … … 1176 1200 echo "<span class='$action'>$link$sep</span>"; 1177 1201 } 1178 ?>1179 </td>1180 <?php1202 1203 get_inline_data($post); 1204 echo '</td>'; 1181 1205 break; 1182 1206 … … 1237 1261 } 1238 1262 } 1239 1240 1241 1263 ?> 1264 1265 </tr> 1242 1266 1243 1267 <?php … … 1266 1290 * If searching, ignore hierarchy and treat everything as top level 1267 1291 */ 1268 if ( empty($_GET['s']) ) 1292 if ( empty($_GET['s']) ) { 1269 1293 1270 1294 $top_level_pages = array(); 1271 $children_pages 1295 $children_pages = array(); 1272 1296 1273 1297 foreach ( $pages as $page ) { … … 1380 1404 $short_url = substr( $short_url, 0, -1 ); 1381 1405 if ( strlen( $short_url ) > 35 ) 1382 $short_url = 1406 $short_url = substr( $short_url, 0, 32 ).'...'; 1383 1407 $numposts = get_usernumposts( $user_object->ID ); 1384 1408 if ( current_user_can( 'edit_user', $user_object->ID ) ) { … … 1391 1415 $actions = array(); 1392 1416 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; 1393 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("users.php?action=delete&user=$user_object->ID", 'bulk-users') . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this user '%s'\n 1417 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("users.php?action=delete&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>"; 1394 1418 $action_count = count($actions); 1395 1419 $i = 0; … … 1512 1536 $ptime = mysql2date(__('Y/m/d \a\t g:i A'), $comment->comment_date ); 1513 1537 1514 $delete_url 1515 $approve_url 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" ) ); 1516 1540 $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 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" ) ); 1518 1542 1519 1543 ?> 1520 1544 <tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $the_comment_status; ?>'> 1521 1545 <?php if ( $checkbox ) : ?> 1522 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> 1523 1547 <?php endif; ?> 1524 1525 1526 1548 <td class="comment-column"> 1549 <?php if ( 'detail' == $mode || 'single' == $mode ) comment_text(); ?> 1550 1527 1551 <?php 1528 1552 $actions = array(); 1529 1553 1530 1554 if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 1531 $actions['approve'] 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>'; 1532 1556 $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>'; 1533 1557 if ( $comment_status ) { // not looking at all comments … … 1541 1565 } 1542 1566 if ( 'spam' != $the_comment_status ) 1543 $actions['spam'] 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>'; 1544 1568 $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>'; 1545 1569 $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>'; … … 1565 1589 } 1566 1590 ?> 1567 1591 </td> 1568 1592 <td class="author-column"> 1569 1593 <strong><?php comment_author(); ?></strong><br /> 1570 1571 1572 1573 1574 1575 1576 1577 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() ?>&mode=detail"><?php comment_author_IP() ?></a> 1602 <?php endif; //current_user_can?> 1579 1603 </td> 1580 1604 <td class="date-column"><?php comment_date(__('Y/m/d \a\t g:ia')); ?></td> 1581 1605 <?php if ( 'single' !== $mode ) : ?> 1582 1583 1584 1585 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> 1586 1610 <?php endif; ?> 1587 1611 </tr> 1588 1612 <?php 1589 1613 } … … 1594 1618 // allow plugin to replace the popup content 1595 1619 $content = apply_filters( 'wp_comment_reply', '', array('position'=>$position, 'checkbox'=>$checkbox, 'mode'=>$mode) ); 1596 1620 1597 1621 if ( ! empty($content) ) { 1598 1622 echo $content; … … 1607 1631 <button id="back-button" onclick="commentReply.back();" class="button"><?php _e('Go back'); ?></button></p> 1608 1632 </div> 1609 1633 1610 1634 <div id="replydiv" style="display:none;"> 1611 1635 <p id="replyhandle"><?php _e('Reply'); ?></p> … … 1700 1724 } 1701 1725 1702 $entry['meta_key'] 1726 $entry['meta_key'] = attribute_escape($entry['meta_key']); 1703 1727 $entry['meta_value'] = htmlspecialchars($entry['meta_value']); // using a <textarea /> 1704 1728 $entry['meta_id'] = (int) $entry['meta_id']; … … 1793 1817 $month .= '</select>'; 1794 1818 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" />'; 1799 1823 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); 1800 1824 1801 1825 if ( $multi ) return; 1802 1826 1803 1827 echo "\n\n"; 1804 1828 foreach ( array('mm', 'jj', 'aa', 'hh', 'mn') as $timeunit ) … … 1892 1916 <tr> 1893 1917 <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() ); 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> 1895 1919 </tr> 1896 1920 <tr> … … 1978 2002 * @param string $id String for use in the 'id' attribute of tags. 1979 2003 * @param string $title Title of the meta box 1980 * @param string $callback Function that fills the box with the desired content. 2004 * @param string $callback Function that fills the box with the desired content. The function should echo its output. 1981 2005 * @param string $page The type of edit page on which to show the box (post, page, link) 1982 2006 * @param string $context The context within the page where the boxes should show ('normal', 'advanced') … … 1986 2010 global $wp_meta_boxes; 1987 2011 1988 if 2012 if ( !isset($wp_meta_boxes) ) 1989 2013 $wp_meta_boxes = array(); 1990 2014 if ( !isset($wp_meta_boxes[$page]) ) … … 2013 2037 if ( empty($priority) ) { 2014 2038 $priority = $a_priority; 2015 // else if we're adding to the sorted priortiy, we don't know the title or callback. 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. 2016 2040 } elseif ( 'sorted' == $priority ) { 2017 2041 $title = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['title']; … … 2044 2068 2045 2069 $i = 0; 2046 do { 2047 // Grab the ones the user has manually sorted. 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 2048 2072 if ( !$already_sorted && $sorted = get_user_option( "meta-box-order_$page" ) ) { 2049 2073 foreach ( $sorted as $box_context => $ids ) … … 2095 2119 global $wp_meta_boxes; 2096 2120 2097 if 2121 if ( !isset($wp_meta_boxes) ) 2098 2122 $wp_meta_boxes = array(); 2099 2123 if ( !isset($wp_meta_boxes[$page]) ) … … 2138 2162 * @param string $id String for use in the 'id' attribute of tags. 2139 2163 * @param string $title Title of the section 2140 * @param string $callback Function that fills the section with the desired content. 2164 * @param string $callback Function that fills the section with the desired content. The function should echo its output. 2141 2165 * @param string $page The type of settings page on which to show the section (general, reading, writing, ...) 2142 2166 */ … … 2144 2168 global $wp_settings_sections; 2145 2169 2146 if 2170 if ( !isset($wp_settings_sections) ) 2147 2171 $wp_settings_sections = array(); 2148 2172 if ( !isset($wp_settings_sections[$page]) ) … … 2161 2185 * @param string $id String for use in the 'id' attribute of tags. 2162 2186 * @param string $title Title of the field 2163 * @param string $callback Function that fills the field with the desired content. 2187 * @param string $callback Function that fills the field with the desired content. The function should echo its output. 2164 2188 * @param string $page The type of settings page on which to show the field (general, reading, writing, ...) 2165 2189 * @param string $section The section of the settingss page in which to show the box (default, ...) … … 2169 2193 global $wp_settings_fields; 2170 2194 2171 if 2195 if ( !isset($wp_settings_fields) ) 2172 2196 $wp_settings_fields = array(); 2173 2197 if ( !isset($wp_settings_fields[$page]) ) … … 2212 2236 echo '</td>'; 2213 2237 echo '</tr>'; 2214 } 2238 } 2215 2239 } 2216 2240 … … 2245 2269 <input type="hidden" name="found_action" value="<?php echo $found_action; ?>" /> 2246 2270 <?php } ?> 2247 2271 2248 2272 <input type="hidden" name="affected" id="affected" value="" /> 2249 2273 <?php wp_nonce_field( 'find-posts', '_ajax_nonce', false ); ?> … … 2280 2304 minWidth: 280 2281 2305 }).css({'top':st+'px','left':'50%','marginLeft':'-200px'}); 2282 2306 2283 2307 $('.ui-resizable-handle').css({ 2284 2308 'backgroundColor': '#e5e5e5' 2285 2309 }); 2286 2310 2287 2311 $('.ui-resizable-se').css({ 2288 2312 'border': '0 none', … … 2291 2315 'background': 'transparent url(images/se.png) no-repeat scroll 0 0' 2292 2316 }); 2293 2317 2294 2318 $('#find-posts-input').focus().keyup(function(e){ 2295 2319 if (e.which == 27) findPosts.close(); // close on Escape 2296 2320 }); 2297 2321 2298 2322 return false; 2299 2323 }, 2300 2324 2301 2325 close : function() { 2302 2326 $('#find-posts-response').html(''); 2303 2327 $('#find-posts').draggable('destroy').resizable('destroy').hide(); 2304 2328 }, 2305 2329 2306 2330 send : function() { 2307 2331 var post = {}; … … 2310 2334 post['action'] = 'find_posts'; 2311 2335 post['_ajax_nonce'] = $('#_ajax_nonce').val(); 2312 2336 2313 2337 if ( $('#find-posts-pages:checked').val() ) 2314 2338 post['pages'] = 1; 2315 2339 else 2316 2340 post['posts'] = 1; 2317 2341 2318 2342 $.ajax({ 2319 2343 type : 'POST', … … 2324 2348 }); 2325 2349 }, 2326 2350 2327 2351 show : function(x) { 2328 2352 … … 2336 2360 if ( r.errors ) 2337 2361 this.error({'responseText': wpAjax.broken}); 2338 2362 2339 2363 r = r.responses[0]; 2340 2364 $('#find-posts-response').html(r.data); 2341 2365 }, 2342 2366 2343 2367 error : function(r) { 2344 2368 var er = r.statusText; … … 2346 2370 if ( r.responseText ) 2347 2371 er = r.responseText.replace( /<.[^<>]*?>/g, '' ); 2348 2372 2349 2373 if ( er ) 2350 2374 $('#find-posts-response').html(er); 2351 2375 } 2352 2376 }; 2353 2377 2354 2378 $(document).ready(function(){ 2355 2379 $('#find-posts-submit').click(function(e) {
Note: See TracChangeset
for help on using the changeset viewer.