Changeset 1125
- Timestamp:
- 10/23/07 18:28:40 (1 year ago)
- Files:
-
- trunk/wp-admin/admin-ajax.php (modified) (16 diffs)
- trunk/wp-admin/categories.php (modified) (1 diff)
- trunk/wp-admin/edit-category-form.php (modified) (2 diffs)
- trunk/wp-admin/edit-comments.php (modified) (5 diffs)
- trunk/wp-admin/edit-form-advanced.php (modified) (1 diff)
- trunk/wp-admin/edit-link-form.php (modified) (1 diff)
- trunk/wp-admin/edit-pages.php (modified) (3 diffs)
- trunk/wp-admin/edit-post-rows.php (modified) (3 diffs)
- trunk/wp-admin/edit.php (modified) (4 diffs)
- trunk/wp-admin/export.php (modified) (1 diff)
- trunk/wp-admin/images/wordpress-logo.png (modified) (previous)
- trunk/wp-admin/import/utw.php (modified) (1 diff)
- trunk/wp-admin/import/wp-cat2tag.php (modified) (4 diffs)
- trunk/wp-admin/includes/plugin.php (modified) (1 diff)
- trunk/wp-admin/includes/post.php (modified) (4 diffs)
- trunk/wp-admin/includes/schema.php (modified) (2 diffs)
- trunk/wp-admin/includes/template.php (modified) (10 diffs)
- trunk/wp-admin/includes/upgrade.php (modified) (6 diffs)
- trunk/wp-admin/includes/upload.php (modified) (2 diffs)
- trunk/wp-admin/includes/user.php (modified) (3 diffs)
- trunk/wp-admin/js/cat.js (modified) (1 diff)
- trunk/wp-admin/js/categories.js (modified) (1 diff)
- trunk/wp-admin/js/custom-fields.js (modified) (1 diff)
- trunk/wp-admin/js/edit-comments.js (modified) (1 diff)
- trunk/wp-admin/js/edit-posts.js (added)
- trunk/wp-admin/js/link-cat.js (modified) (1 diff)
- trunk/wp-admin/js/users.js (modified) (1 diff)
- trunk/wp-admin/link-add.php (modified) (1 diff)
- trunk/wp-admin/link-import.php (modified) (3 diffs)
- trunk/wp-admin/link-manager.php (modified) (5 diffs)
- trunk/wp-admin/link.php (modified) (8 diffs)
- trunk/wp-admin/page.php (modified) (1 diff)
- trunk/wp-admin/plugins.php (modified) (4 diffs)
- trunk/wp-admin/post.php (modified) (1 diff)
- trunk/wp-admin/setup-config.php (modified) (2 diffs)
- trunk/wp-admin/users.php (modified) (1 diff)
- trunk/wp-admin/wp-admin.css (modified) (1 diff)
- trunk/wp-app.php (modified) (8 diffs)
- trunk/wp-content/themes/classic/header.php (modified) (2 diffs)
- trunk/wp-content/themes/default/header.php (modified) (1 diff)
- trunk/wp-includes/bookmark.php (modified) (2 diffs)
- trunk/wp-includes/cache.php (modified) (3 diffs)
- trunk/wp-includes/canonical.php (modified) (2 diffs)
- trunk/wp-includes/category-template.php (modified) (1 diff)
- trunk/wp-includes/classes.php (modified) (3 diffs)
- trunk/wp-includes/comment-template.php (modified) (1 diff)
- trunk/wp-includes/comment.php (modified) (7 diffs)
- trunk/wp-includes/default-filters.php (modified) (2 diffs)
- trunk/wp-includes/feed-atom-comments.php (modified) (1 diff)
- trunk/wp-includes/feed-atom.php (modified) (3 diffs)
- trunk/wp-includes/feed-rdf.php (modified) (2 diffs)
- trunk/wp-includes/feed-rss.php (modified) (1 diff)
- trunk/wp-includes/feed-rss2-comments.php (modified) (2 diffs)
- trunk/wp-includes/feed-rss2.php (modified) (2 diffs)
- trunk/wp-includes/feed.php (modified) (1 diff)
- trunk/wp-includes/formatting.php (modified) (3 diffs)
- trunk/wp-includes/functions.php (modified) (44 diffs)
- trunk/wp-includes/general-template.php (modified) (5 diffs)
- trunk/wp-includes/images/wlw (added)
- trunk/wp-includes/images/wlw/wp-comments.png (added)
- trunk/wp-includes/images/wlw/wp-icon.png (added)
- trunk/wp-includes/images/wlw/wp-watermark.png (added)
- trunk/wp-includes/js/jquery/jquery.js (modified) (1 diff)
- trunk/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js (modified) (1 diff)
- trunk/wp-includes/js/wp-lists.js (added)
- trunk/wp-includes/link-template.php (modified) (4 diffs)
- trunk/wp-includes/pluggable.php (modified) (15 diffs)
- trunk/wp-includes/plugin.php (modified) (20 diffs)
- trunk/wp-includes/post-template.php (modified) (2 diffs)
- trunk/wp-includes/post.php (modified) (48 diffs)
- trunk/wp-includes/query.php (modified) (7 diffs)
- trunk/wp-includes/registration.php (modified) (3 diffs)
- trunk/wp-includes/rss.php (modified) (1 diff)
- trunk/wp-includes/script-loader.php (modified) (4 diffs)
- trunk/wp-includes/taxonomy.php (modified) (53 diffs)
- trunk/wp-includes/user.php (modified) (1 diff)
- trunk/wp-includes/version.php (modified) (1 diff)
- trunk/wp-includes/widgets.php (modified) (5 diffs)
- trunk/wp-includes/wlwmanifest.xml (added)
- trunk/wp-includes/wp-db.php (modified) (2 diffs)
- trunk/wp-links-opml.php (modified) (1 diff)
- trunk/wp-login.php (modified) (1 diff)
- trunk/wp-mail.php (modified) (1 diff)
- trunk/wp-settings.php (modified) (3 diffs)
- trunk/xmlrpc.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/admin-ajax.php
r1069 r1125 5 5 define('DOING_AJAX', true); 6 6 7 check_ajax_referer();8 7 if ( !is_user_logged_in() ) 9 8 die('-1'); … … 12 11 add_action( 'shutdown', 'get_out_now', -1 ); 13 12 14 function wp_ajax_meta_row( $pid, $mid, $key, $value ) {15 $value = attribute_escape($value);16 $key_js = addslashes(wp_specialchars($key, 'double'));17 $key = attribute_escape($key);18 $r .= "<tr id='meta-$mid'><td valign='top'>";19 $r .= "<input name='meta[$mid][key]' tabindex='6' onkeypress='return killSubmit(\"theList.ajaxUpdater('meta','meta-$mid');\",event);' type='text' size='20' value='$key' />";20 $r .= "</td><td><textarea name='meta[$mid][value]' tabindex='6' rows='2' cols='30'>$value</textarea></td><td align='center'>";21 $r .= "<input name='updatemeta' type='button' class='updatemeta' tabindex='6' value='".attribute_escape(__('Update'))."' onclick='return theList.ajaxUpdater('meta','meta-$mid');' /><br />";22 $r .= "<input name='deletemeta[$mid]' type='submit' onclick=\"return deleteSomething( 'meta', $mid, '";23 $r .= js_escape(sprintf(__("You are about to delete the '%s' custom field on this post.\n'OK' to delete, 'Cancel' to stop."), $key_js));24 $r .= "' );\" class='deletemeta' tabindex='6' value='".attribute_escape(__('Delete'))."' /></td></tr>";25 return $r;26 }27 28 13 $id = (int) $_POST['id']; 29 switch ( $_POST['action'] ) : 14 switch ( $action = $_POST['action'] ) : 15 case 'add-post' : 16 check_ajax_referer( 'add-post' ); 17 add_filter( 'post_limits', $limit_filter = create_function( '$a', '$b = split(" ",$a); if ( !isset($b[2]) ) return $a; $start = intval(trim($b[1])) / 20 * 15; if ( !is_int($start) ) return $a; $start += intval(trim($b[2])) - 1; return "LIMIT $start, 1";' ) ); 18 wp_edit_posts_query( '_POST' ); 19 $posts_columns = wp_manage_posts_columns(); 20 ob_start(); 21 include( 'edit-post-rows.php' ); 22 $data = ob_get_contents(); 23 ob_end_clean(); 24 if ( !preg_match('|<tbody.+?>(.+)</tbody>|s', $data, $matches) ) 25 my_dump($data); 26 $data = trim($matches[1]); 27 $x = new WP_Ajax_Response( array( 'what' => 'post', 'id' => $id, 'data' => $data ) ); 28 $x->send(); 29 break; 30 30 case 'delete-comment' : 31 check_ajax_referer( "delete-comment_$id" ); 31 32 if ( !$comment = get_comment( $id ) ) 32 33 die('0'); … … 34 35 die('-1'); 35 36 36 if ( wp_delete_comment( $comment->comment_ID ) ) 37 if ( isset($_POST['spam']) && 1 == $_POST['spam'] ) 38 $r = wp_set_comment_status( $comment->comment_ID, 'spam' ); 39 else 40 $r = wp_delete_comment( $comment->comment_ID ); 41 42 die( $r ? '1' : '0' ); 43 break; 44 case 'delete-cat' : 45 check_ajax_referer( "delete-category_$id" ); 46 if ( !current_user_can( 'manage_categories' ) ) 47 die('-1'); 48 49 if ( wp_delete_category( $id ) ) 37 50 die('1'); 38 51 else die('0'); 39 52 break; 40 case 'delete-comment-as-spam' : 41 if ( !$comment = get_comment( $id ) ) 42 die('0'); 43 if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) 44 die('-1'); 45 46 if ( wp_set_comment_status( $comment->comment_ID, 'spam' ) ) 53 case 'delete-link' : 54 check_ajax_referer( "delete-bookmark_$id" ); 55 if ( !current_user_can( 'manage_links' ) ) 56 die('-1'); 57 58 if ( wp_delete_link( $id ) ) 47 59 die('1'); 48 60 else die('0'); 49 61 break; 50 case 'delete-cat' :51 if ( !current_user_can( 'manage_categories' ) )52 die('-1');53 54 if ( wp_delete_category( $id ) )55 die('1');56 else die('0');57 break;58 case 'delete-link' :59 if ( !current_user_can( 'manage_links' ) )60 die('-1');61 62 if ( wp_delete_link( $id ) )63 die('1');64 else die('0');65 break;66 62 case 'delete-meta' : 63 check_ajax_referer( 'change_meta' ); 67 64 if ( !$meta = get_post_meta_by_id( $id ) ) 68 65 die('0'); … … 74 71 break; 75 72 case 'delete-post' : 73 check_ajax_referer( "{$action}_$id" ); 76 74 if ( !current_user_can( 'delete_post', $id ) ) 77 75 die('-1'); … … 79 77 if ( wp_delete_post( $id ) ) 80 78 die('1'); 81 else die('0'); 79 else 80 die('0'); 82 81 break; 83 82 case 'delete-page' : 83 check_ajax_referer( "{$action}_$id" ); 84 84 if ( !current_user_can( 'delete_page', $id ) ) 85 85 die('-1'); … … 98 98 99 99 if ( 'unapproved' == wp_get_comment_status($comment->comment_ID) ) { 100 check_ajax_referer( "approve-comment_$id" ); 100 101 if ( wp_set_comment_status( $comment->comment_ID, 'approve' ) ) 101 102 die('1'); 102 103 } else { 104 check_ajax_referer( "unapprove-comment_$id" ); 103 105 if ( wp_set_comment_status( $comment->comment_ID, 'hold' ) ) 104 106 die('1'); … … 107 109 break; 108 110 case 'add-category' : // On the Fly 111 check_ajax_referer( $action ); 109 112 if ( !current_user_can( 'manage_categories' ) ) 110 113 die('-1'); … … 121 124 'what' => 'category', 122 125 'id' => $cat_id, 123 'data' => "<li id='category-$cat_id'><label for='in-category-$cat_id' class='selectit'><input value='$cat_id' type='checkbox' checked='checked' name='post_category[]' id='in-category-$cat_id'/> $cat_name</label></li>" 126 'data' => "<li id='category-$cat_id'><label for='in-category-$cat_id' class='selectit'><input value='$cat_id' type='checkbox' checked='checked' name='post_category[]' id='in-category-$cat_id'/> $cat_name</label></li>", 127 'position' => -1 124 128 ) ); 125 129 } … … 127 131 break; 128 132 case 'add-link-category' : // On the Fly 133 check_ajax_referer( $action ); 129 134 if ( !current_user_can( 'manage_categories' ) ) 130 135 die('-1'); … … 137 142 if ( !$cat_id = is_term( $cat_name, 'link_category' ) ) { 138 143 $cat_id = wp_insert_term( $cat_name, 'link_category' ); 139 $cat_id = $cat_id['term_id'];140 144 } 145 $cat_id = $cat_id['term_id']; 141 146 $cat_name = wp_specialchars(stripslashes($cat_name)); 142 147 $x->add( array( 143 148 'what' => 'link-category', 144 149 'id' => $cat_id, 145 'data' => "<li id='link-category-$cat_id'><label for='in-link-category-$cat_id' class='selectit'><input value='$cat_id' type='checkbox' checked='checked' name='link_category[]' id='in-link-category-$cat_id'/> $cat_name</label></li>" 150 'data' => "<li id='link-category-$cat_id'><label for='in-link-category-$cat_id' class='selectit'><input value='$cat_id' type='checkbox' checked='checked' name='link_category[]' id='in-link-category-$cat_id'/> $cat_name</label></li>", 151 'position' => -1 146 152 ) ); 147 153 } … … 149 155 break; 150 156 case 'add-cat' : // From Manage->Categories 157 check_ajax_referer( 'add-category' ); 151 158 if ( !current_user_can( 'manage_categories' ) ) 152 159 die('-1'); … … 156 163 die('0'); 157 164 $level = 0; 158 $cat_full_name = $cat-> cat_name;165 $cat_full_name = $cat->name; 159 166 $_cat = $cat; 160 while ( $_cat-> category_parent ) {161 $_cat = get_category( $_cat-> category_parent );162 $cat_full_name = $_cat-> cat_name . ' — ' . $cat_full_name;167 while ( $_cat->parent ) { 168 $_cat = get_category( $_cat->parent ); 169 $cat_full_name = $_cat->name . ' — ' . $cat_full_name; 163 170 $level++; 164 171 } … … 167 174 $x = new WP_Ajax_Response( array( 168 175 'what' => 'cat', 169 'id' => $cat-> cat_ID,176 'id' => $cat->term_id, 170 177 'data' => _cat_row( $cat, $level, $cat_full_name ), 171 'supplemental' => array('name' => $cat_full_name, 'show-link' => sprintf(__( 'Category <a href="#%s">%s</a> added' ), "cat-$cat-> cat_ID", $cat_full_name))178 'supplemental' => array('name' => $cat_full_name, 'show-link' => sprintf(__( 'Category <a href="#%s">%s</a> added' ), "cat-$cat->term_id", $cat_full_name)) 172 179 ) ); 173 180 $x->send(); 174 181 break; 175 182 case 'add-comment' : 183 check_ajax_referer( $action ); 176 184 if ( !current_user_can( 'edit_post', $id ) ) 177 185 die('-1'); 178 186 $search = isset($_POST['s']) ? $_POST['s'] : false; 179 $start = isset($_POST['page']) ? intval($_POST['page']) * 25 : 25;187 $start = isset($_POST['page']) ? intval($_POST['page']) * 25 - 1: 24; 180 188 181 189 list($comments, $total) = _wp_get_comment_list( $search, $start, 1 ); … … 199 207 break; 200 208 case 'add-meta' : 201 if ( !current_user_can( 'edit_post', $id ) ) 202 die('-1'); 203 if ( $id < 0 ) { 204 $now = current_time('timestamp', 1); 205 if ( $pid = wp_insert_post( array( 206 'post_title' => sprintf('Draft created on %s at %s', date(get_option('date_format'), $now), date(get_option('time_format'), $now)) 207 ) ) ) { 208 if ( is_wp_error( $pid ) ) 209 return $pid; 210 $mid = add_meta( $pid ); 209 check_ajax_referer( 'change_meta' ); 210 $c = 0; 211 $pid = (int) $_POST['post_id']; 212 if ( isset($_POST['addmeta']) ) { 213 if ( !current_user_can( 'edit_post', $pid ) ) 214 die('-1'); 215 if ( $pid < 0 ) { 216 $now = current_time('timestamp', 1); 217 if ( $pid = wp_insert_post( array( 218 'post_title' => sprintf('Draft created on %s at %s', date(get_option('date_format'), $now), date(get_option('time_format'), $now)) 219 ) ) ) { 220 if ( is_wp_error( $pid ) ) { 221 $x = new WP_Ajax_Response( array( 222 'what' => 'meta', 223 'data' => $pid 224 ) ); 225 $x->send(); 226 } 227 $mid = add_meta( $pid ); 228 } else { 229 die('0'); 230 } 231 } else if ( !$mid = add_meta( $pid ) ) { 232 die('0'); 211 233 } 212 else 213 die('0'); 214 } else if ( !$mid = add_meta( $id ) ) { 215 die('0'); 216 } 217 218 $meta = get_post_meta_by_id( $mid ); 219 $key = $meta->meta_key; 220 $value = $meta->meta_value; 221 $pid = (int) $meta->post_id; 222 223 $x = new WP_Ajax_Response( array( 224 'what' => 'meta', 225 'id' => $mid, 226 'data' => wp_ajax_meta_row( $pid, $mid, $key, $value ), 227 'supplemental' => array('postid' => $pid) 228 ) ); 229 $x->send(); 230 break; 231 case 'update-meta' : 232 $mid = (int) array_pop(array_keys($_POST['meta'])); 233 $key = $_POST['meta'][$mid]['key']; 234 $value = $_POST['meta'][$mid]['value']; 235 if ( !$meta = get_post_meta_by_id( $mid ) ) 236 die('0'); // if meta doesn't exist 237 if ( !current_user_can( 'edit_post', $meta->post_id ) ) 238 die('-1'); 239 if ( $u = update_meta( $mid, $key, $value ) ) { 234 235 $meta = get_post_meta_by_id( $mid ); 236 $pid = (int) $meta->post_id; 237 $meta = get_object_vars( $meta ); 238 $x = new WP_Ajax_Response( array( 239 'what' => 'meta', 240 'id' => $mid, 241 'data' => _list_meta_row( $meta, $c ), 242 'position' => 1, 243 'supplemental' => array('postid' => $pid) 244 ) ); 245 } else { 246 $mid = (int) array_pop(array_keys($_POST['meta'])); 247 $key = $_POST['meta'][$mid]['key']; 248 $value = $_POST['meta'][$mid]['value']; 249 if ( !$meta = get_post_meta_by_id( $mid ) ) 250 die('0'); // if meta doesn't exist 251 if ( !current_user_can( 'edit_post', $meta->post_id ) ) 252 die('-1'); 253 if ( !$u = update_meta( $mid, $key, $value ) ) 254 die('1'); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems). 240 255 $key = stripslashes($key); 241 256 $value = stripslashes($value); 242 257 $x = new WP_Ajax_Response( array( 243 258 'what' => 'meta', 244 'id' => $mid, 245 'data' => wp_ajax_meta_row( $meta->post_id, $mid, $key, $value ), 259 'id' => $mid, 'old_id' => $mid, 260 'data' => _list_meta_row( array( 261 'meta_key' => $key, 262 'meta_value' => $value, 263 'meta_id' => $mid 264 ), $c ), 265 'position' => 0, 246 266 'supplemental' => array('postid' => $meta->post_id) 247 267 ) ); 248 $x->send(); 249 } 250 die('1'); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems). 268 } 269 $x->send(); 251 270 break; 252 271 case 'add-user' : 272 check_ajax_referer( $action ); 253 273 if ( !current_user_can('edit_users') ) 254 274 die('-1'); … … 262 282 } 263 283 $user_object = new WP_User( $user_id ); 284 264 285 $x = new WP_Ajax_Response( array( 265 286 'what' => 'user', 266 287 'id' => $user_id, 267 288 'data' => user_row( $user_object ), 268 'supplemental' => array('show-link' => sprintf(__( 'User <a href="#%s">%s</a> added' ), "user-$user_id", $user_object->user_login)) 289 'supplemental' => array( 290 'show-link' => sprintf(__( 'User <a href="#%s">%s</a> added' ), "user-$user_id", $user_object->user_login), 291 'role' => $user_object->roles[0] 292 ) 269 293 ) ); 270 294 $x->send(); 271 295 break; 272 296 case 'autosave' : // The name of this action is hardcoded in edit_post() 297 check_ajax_referer( $action ); 273 298 $_POST['post_content'] = $_POST['content']; 274 299 $_POST['post_excerpt'] = $_POST['excerpt']; … … 301 326 break; 302 327 case 'autosave-generate-nonces' : 328 check_ajax_referer( $action ); 303 329 $ID = (int) $_POST['post_ID']; 304 330 if($_POST['post_type'] == 'post') { trunk/wp-admin/categories.php
r1069 r1125 103 103 </tr> 104 104 </thead> 105 <tbody id="the-list" >105 <tbody id="the-list" class="list:cat"> 106 106 <?php 107 107 cat_rows(); trunk/wp-admin/edit-category-form.php
r1069 r1125 10 10 $heading = __('Add Category'); 11 11 $submit_text = __('Add Category »'); 12 $form = '<form name="addcat" id="addcat" method="post" action="categories.php" >';12 $form = '<form name="addcat" id="addcat" method="post" action="categories.php" class="add:the-list:">'; 13 13 $action = 'addcat'; 14 14 $nonce_action = 'add-category'; … … 40 40 </tr> 41 41 </table> 42 <p class="submit"><input type="submit" name="submit" value="<?php echo $submit_text ?>" /></p>42 <p class="submit"><input type="submit" class="add:the-list:cat:addcat" name="submit" value="<?php echo $submit_text ?>" /></p> 43 43 <?php do_action('edit_category_form', $category); ?> 44 44 </form> trunk/wp-admin/edit-comments.php
r1069 r1125 103 103 $start = " start='$offset'"; 104 104 105 echo "<ol id='the-comment-list' class=' commentlist' $start>\n";105 echo "<ol id='the-comment-list' class='list:comment commentlist' $start>\n"; 106 106 $i = 0; 107 107 foreach ( $comments as $comment ) { 108 get_comment( $comment ); // Cache it109 108 _wp_comment_list_item( $comment->comment_ID, ++$i ); 110 109 } … … 113 112 if ( $extra_comments ) : ?> 114 113 <div id="extra-comments" style="display:none"> 115 < ul id="the-extra-comment-list" class="commentlist">114 <ol id="the-extra-comment-list" class="list:comment commentlist" style="color:red"> 116 115 <?php 117 116 foreach ( $extra_comments as $comment ) { 118 117 get_comment( $comment ); // Cache it 119 _wp_comment_list_item( $comment->comment_ID, ++$i ); 120 } 121 ?> 122 </ul> 118 _wp_comment_list_item( $comment->comment_ID, 0 ); 119 } 120 ?> 121 </ol> 122 <form action="" method="get" id="get-extra-comments" class="add:the-extra-comment-list:"> 123 <input type="hidden" name="page" value="<?php echo $page; ?>" /> 124 <input type="hidden" name="s" value="<?php echo attribute_escape(@$_GET['s']); ?>" /> 125 <?php wp_nonce_field( 'add-comment', '_ajax_nonce', false ); ?> 123 126 </div> 124 127 <?php endif; // $extra_comments ?> … … 150 153 <th scope="col" colspan="3" style="text-align: center">' . __('Actions') . '</th> 151 154 </tr> 152 </thead>'; 155 </thead> 156 <tbody id="the-comment-list" class="list:comment">'; 153 157 foreach ($comments as $comment) { 154 158 $post = get_post($comment->comment_post_ID); … … 160 164 <tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $class; ?>'> 161 165 <td style="text-align: center"><?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> 162 <td ><?php comment_author_link() ?></td>166 <td class="comment-author"><?php comment_author_link() ?></td> 163 167 <td><?php comment_author_email_link() ?></td> 164 168 <td><a href="edit-comments.php?s=<?php comment_author_IP() ?>&mode=edit"><?php comment_author_IP() ?></a></td> … … 174 178 echo "<a href='comment.php?action=editcomment&c=$comment->comment_ID' class='edit'>" . __('Edit') . "</a>"; } ?></td> 175 179 <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 176 echo "<a href=\"comment.php?action=deletecomment&p=".$comment->comment_post_ID."&c=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to delete this comment by '%s'. \n 'Cancel' to stop, 'OK' to delete."), $comment->comment_author )) . "', theCommentList );\" class='delete'>" . __('Delete') . "</a> "; 180 $url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); 181 echo "<a href='$url' class='delete:the-comment-list:comment-$comment->comment_ID delete'>" . __('Delete') . "</a> "; 177 182 } ?></td> 178 183 </tr> 179 184 <?php 180 185 } // end foreach 181 ?></table> 186 ?></tbody> 187 </table> 182 188 <p class="submit"><input type="submit" name="delete_button" class="delete" value="<?php _e('Delete Checked Comments »') ?>" onclick="var numchecked = getNumChecked(document.getElementById('deletecomments')); if(numchecked < 1) { alert('<?php echo js_escape(__("Please select some comments to delete")); ?>'); return false } return confirm('<?php echo sprintf(js_escape(__("You are about to delete %s comments permanently \n 'Cancel' to stop, 'OK' to delete.")), "' + numchecked + '"); ?>')" /> 183 189 <input type="submit" name="spam_button" value="<?php _e('Mark Checked Comments as Spam »') ?>" onclick="var numchecked = getNumChecked(document.getElementById('deletecomments')); if(numchecked < 1) { alert('<?php echo js_escape(__("Please select some comments to mark as spam")); ?>'); return false } return confirm('<?php echo sprintf(js_escape(__("You are about to mark %s comments as spam \n 'Cancel' to stop, 'OK' to mark as spam.")), "' + numchecked + '"); ?>')" /></p> trunk/wp-admin/edit-form-advanced.php
r1069 r1125 75 75 <h3 class="dbx-handle"><?php _e('Categories') ?></h3> 76 76 <div class="dbx-content"> 77 <p id="jaxcat">< /p>78 <ul id="categorychecklist" ><?php dropdown_categories(); ?></ul></div>77 <p id="jaxcat"><?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?></p> 78 <ul id="categorychecklist" class="list:category"><?php dropdown_categories(); ?></ul></div> 79 79 </fieldset> 80 80 trunk/wp-admin/edit-link-form.php
r1069 r1125 43 43 <h3 class="dbx-handle"><?php _e('Categories') ?></h3> 44 44 <div class="dbx-content"> 45 <p id="jaxcat">< /p>46 <ul id=" linkcategorychecklist"><?php dropdown_link_categories(get_option('default_link_category')); ?></ul>45 <p id="jaxcat"><?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?></p> 46 <ul id="categorychecklist" class="list:link-category"><?php dropdown_link_categories(get_option('default_link_category')); ?></ul> 47 47 </div> 48 48 </fieldset> trunk/wp-admin/edit-pages.php
r1069 r1125 3 3 $title = __('Pages'); 4 4 $parent_file = 'edit.php'; 5 wp_enqueue_script( ' listman' );5 wp_enqueue_script( 'wp-lists' ); 6 6 require_once('admin-header.php'); 7 7 … … 21 21 22 22 ?> 23 23 <script> 24 /* <![CDATA[ */ 25 jQuery(function($){$('#the-list').wpList();}); 26 /* ]]> */ 27 </script> 24 28 <div class="wrap"> 25 26 29 <h2><?php 27 30 // Use $_GET instead of is_ since they can override each other … … 82 85 </tr> 83 86 </thead> 84 <tbody id="the-list" >87 <tbody id="the-list" class="list:page"> 85 88 <?php page_rows(0, 0, $posts, $all); ?> 86 89 </tbody> trunk/wp-admin/edit-post-rows.php
r1069 r1125 1 <?php if ( ! defined('ABSPATH') ) die(); ?> 1 2 <table class="widefat"> 2 3 <thead> … … 9 10 </tr> 10 11 </thead> 11 <tbody id="the-list" >12 <tbody id="the-list" class="list:post"> 12 13 <?php 14 $i_post = 0; 13 15 if ( have_posts() ) { 14 16 $bgcolor = ''; 15 17 add_filter('the_title','wp_specialchars'); 16 while (have_posts()) : the_post(); 17 $class = ('alternate' == $class) ? '' : 'alternate'; 18 while (have_posts()) : the_post(); $i_post++; 19 if ( 16 == $i_post ) 20 echo "\t</tbody>\n\t<tbody id='the-extra-list' class='list:post' style='display: none'>\n"; // Hack! 21 $class = ( $i_post > 15 || 'alternate' == $class) ? '' : 'alternate'; 18 22 global $current_user; 19 23 $post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' ); … … 91 95 case 'control_delete': 92 96 ?> 93 <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 ' onclick=\"return deleteSomething( 'post', " . $id . ", '" . js_escape(sprintf(__("You are about to delete this post '%s'.\n'OK' to delete, 'Cancel' to stop."), get_the_title())) . "' );\">" . __('Delete') . "</a>"; } ?></td>97 <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:the-list:post-$post->ID delete'>" . __('Delete') . "</a>"; } ?></td> 94 98 <?php 95 99 break; trunk/wp-admin/edit.php
r1069 r1125 4 4 $title = __('Posts'); 5 5 $parent_file = 'edit.php'; 6 wp_enqueue_script( 1 == $_GET['c'] ? 'admin-comments' : 'listman' ); 6 wp_enqueue_script( 'admin-posts' ); 7 if ( 1 == $_GET['c'] ) 8 wp_enqueue_script( 'admin-comments' ); 7 9 require_once('admin-header.php'); 8 10 9 $_GET['m'] = (int) $_GET['m']; 10 $_GET['cat'] = (int) $_GET['cat']; 11 $post_stati = array( // array( adj, noun ) 12 'publish' => array(__('Published'), __('Published posts')), 13 'future' => array(__('Scheduled'), __('Scheduled posts')), 14 'pending' => array(__('Pending Review'), __('Pending posts')), 15 'draft' => array(__('Draft'), _c('Drafts|manage posts header')), 16 'private' => array(__('Private'), __('Private posts')) 17 ); 18 19 $avail_post_stati = $wpdb->get_col("SELECT DISTINCT post_status FROM $wpdb->posts WHERE post_type = 'post'"); 20 21 $post_status_q = ''; 22 $post_status_label = __('Posts'); 23 if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) { 24 $post_status_label = $post_stati[$_GET['post_status']][1]; 25 $post_status_q = '&post_status=' . $_GET['post_status']; 26 } 11 add_filter( 'post_limits', $limit_filter = create_function( '$a', '$b = split(" ",$a); if ( !isset($b[2]) ) return $a; $start = intval(trim($b[1])) / 20 * 15; if ( !is_int($start) ) return $a; return "LIMIT $start, 20";' ) ); 12 list($post_stati, $avail_post_stati) = wp_edit_posts_query(); 13 $wp_query->max_num_pages = ceil( $wp_query->found_posts / 15 ); // We grab 20 but only show 15 ( 5 more for ajax extra ) 27 14 ?> 28 15 … … 31 18 <?php 32 19 33 if ( 'pending' === $_GET['post_status'] ) { 34 $order = 'ASC'; 35 $orderby = 'modified'; 36 } elseif ( 'draft' === $_GET['post_status'] ) { 37 $order = 'DESC'; 38 $orderby = 'modified'; 39 } else { 40 $order = 'DESC'; 41 $orderby = 'date'; 42 } 43 44 wp("what_to_show=posts$post_status_q&posts_per_page=15&order=$order&orderby=$orderby"); 45 46 // define the columns to display, the syntax is 'internal name' => 'display name' 47 $posts_columns = array(); 48 $posts_columns['id'] = '<div style="text-align: center">' . __('ID') . '</div>'; 49 if ( 'draft' === $_GET['post_status'] ) 50 $posts_columns['modified'] = __('Modified'); 51 elseif ( 'pending' === $_GET['post_status'] ) 52 $posts_columns['modified'] = __('Submitted'); 53 else 54 $posts_columns['date'] = __('When'); 55 $posts_columns['title'] = __('Title'); 56 $posts_columns['categories'] = __('Categories'); 57 if ( !in_array($_GET['post_status'], array('pending', 'draft', 'future')) ) 58 $posts_columns['comments'] = '<div style="text-align: center">' . __('Comments') . '</div>'; 59 $posts_columns['author'] = __('Author'); 60 61 $posts_columns = apply_filters('manage_posts_columns', $posts_columns); 62 63 // you can not edit these at the moment 64 $posts_columns['control_view'] = ''; 65 $posts_columns['control_edit'] = ''; 66 $posts_columns['control_delete'] = ''; 20 $posts_columns = wp_manage_posts_columns(); 67 21 68 22 ?> … … 155 109 </fieldset> 156 110 <input type="submit" id="post-query-submit" value="<?php _e('Filter »'); ?>" class="button" /> 111 <?php wp_nonce_field( 'add-post', '_ajax_nonce', false ); ?> 112 <input type="button" id="get-extra-button" class="add:the-extra-list:searchform" style="display:none" /> 157 113 </form> 158 114 … … 176 132 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date"); 177 133 if ($comments) { 134 // Make sure comments, post, and post_author are cached 178 135 update_comment_cache($comments); 136 $post = get_post($id); 137 $authordata = get_userdata($post->post_author); 179 138 ?> 180 139 <h3 id="comments"><?php _e('Comments') ?></h3> 181 <ol id="the-comment-list" class=" commentlist">140 <ol id="the-comment-list" class="list:comment commentlist"> 182 141 <?php 183 $i = 0; 184 foreach ($comments as $comment) { 185 186 ++$i; $class = ''; 187 $post = get_post($comment->comment_post_ID); 188 $authordata = get_userdata($post->post_author); 189 $comment_status = wp_get_comment_status($comment->comment_ID); 190 if ('unapproved' == $comment_status) 191 $class .= ' unapproved'; 192 if ($i % 2) 193 $class .= ' alternate'; 194 echo "<li id='comment-$comment->comment_ID' class='$class'>"; 142 $i = 0; 143 foreach ( $comments as $comment ) { 144 _wp_comment_list_item( $comment->comment_ID, ++$i ); 145 } 146 echo '</ol>'; 147 } // end if comments 195 148 ?> 196 <p><strong><?php comment_author() ?></strong> <?php if ($comment->comment_author_email) { ?>| <?php comment_author_email_link() ?> <?php } if ($comment->comment_author_url && 'http://' != $comment->comment_author_url) { ?> | <?php comment_author_url_link() ?> <?php } ?>| <?php _e('IP:') ?> <a href="edit-comments.php?s=<?php comment_author_IP() ?>&mode=edit"><?php comment_author_IP() ?></a></p>197 198 <?php comment_text() ?>199 200 <p><?php comment_date(__('M j, g:i A')); ?> — [201 <?php202 if ( current_user_can('edit_post', $comment->comment_post_ID) ) {203 echo " <a href='comment.php?action=editcomment&c=".$comment->comment_ID."'>" . __('Edit') . '</a>';204 echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . js_escape(sprintf(__("You are about to delete this comment by '%s'.\n'Cancel' to stop, 'OK' to delete."), $comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> ';205 if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) {206 echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>';207 echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>';208 }209 echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&dt=spam&p=" . $comment->comment_post_ID . "&c=" . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to mark as spam this comment by '%s'.\n'Cancel' to stop, 'OK' to mark as spam."), $comment->comment_author)) . "', theCommentList );\">" . __('Spam') . "</a> ";210 }211 ?> ]212 </p>213 </li>214 215 <?php //end of the loop, don't delete216 } // end foreach217 echo '</ol>';218 }//end if comments219 ?>220 149 <?php } ?> 221 150 </div> trunk/wp-admin/export.php
r1069 r1125 183 183 <!-- contained in this file into your blog --> 184 184 185 < !-- generator="wordpress/<?php bloginfo_rss('version') ?>" created="<?php echo date('Y-m-d H:i'); ?>"-->185 <?php the_generator('export');?> 186 186 <rss version="2.0" 187 187
