Ticket #2552: 2552-debug.diff
File 2552-debug.diff, 6.8 KB (added by , 18 years ago) |
---|
-
wp-admin/list-manipulation.php
65 65 die('1'); 66 66 else die('0'); 67 67 break; 68 case 'dim-comment' : 69 if ( !$comment = get_comment( $id ) ) 70 die('0'); 71 if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) 72 die('-1'); 73 if ( !current_user_can( 'moderate_comments' ) ) 74 die('-1'); 75 76 if ( 'unapproved' == wp_get_comment_status($comment->comment_ID) ) { 77 if ( wp_set_comment_status( $comment->comment_ID, 'approve' ) ) 78 die('1'); 79 } else { 80 if ( wp_set_comment_status( $comment->comment_ID, 'hold' ) ) 81 die('1'); 82 } 83 die('0'); 84 break; 68 85 endswitch; 69 86 ?> -
wp-admin/wp-admin.css
326 326 color: #009ef0; 327 327 } 328 328 329 .approve { 330 display: none; 331 } 332 333 .unapproved .approve { 334 display: inline; 335 } 336 337 .unapproved .unapprove { 338 display: none; 339 } 340 329 341 .updated { 330 342 background: #CFEBF7 url(images/notice.gif) no-repeat 1em ; 331 343 border: 1px solid #2580B2; … … 951 963 #jaxcat { 952 964 margin: 0; 953 965 padding: 0; 954 } 955 No newline at end of file 966 } -
wp-admin/edit.php
114 114 <br style="clear:both;" /> 115 115 116 116 <?php 117 118 117 // define the columns to display, the syntax is 'internal name' => 'display name' 119 118 $posts_columns = array( 120 119 'id' => __('ID'), … … 246 245 if ($comments) { 247 246 ?> 248 247 <h3><?php _e('Comments') ?></h3> 249 <ol id=" comments">248 <ol id="the-list"> 250 249 <?php 250 $i = 0; 251 251 foreach ($comments as $comment) { 252 $comment_status = wp_get_comment_status($comment->comment_ID); 252 $class = ( ++$i % 2 ) ? array('alternate') : array(); 253 if ( 'unapproved' == $comment_status = wp_get_comment_status($comment->comment_ID) ) 254 $class[] = 'unapproved'; 253 255 ?> 254 256 255 <li <?php if ("unapproved" == $comment_status) echo "class='unapproved'"; ?>>257 <li id='comment-<?php echo $comment->comment_ID; ?>'<?php if ( $class ) echo " class='" . join(' ', $class) . "'"; ?>> 256 258 <?php comment_date('Y-n-j') ?> 257 259 @ 258 260 <?php comment_time('g:m:s a') ?> 259 261 <?php 260 262 if ( current_user_can('edit_post', $post->ID) ) { 261 echo "[ <a href= \"post.php?action=editcomment&comment=".$comment->comment_ID."\">" . __('Edit') . "</a>";262 echo " - <a href=\"post.php?action=deletecomment&p=".$post->ID."&comment=".$comment->comment_ID."\" onclick=\"return confirm('" . sprintf(__("You are about to delete this comment by \'%s\'\\n \'OK\' to delete, \'Cancel\' to stop."), $comment->comment_author) . "')\">" . __('Delete') . "</a> ";263 echo "[ <a href='post.php?action=editcomment&comment=".$comment->comment_ID."\'>" . __('Edit') . '</a>'; 264 echo ' - <a href="post.php?action=deletecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), wp_specialchars($comment->comment_author, 1)) . "' );\">" . __('Delete') . '</a> '; 263 265 if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) { 264 if ('approved' == wp_get_comment_status($comment->comment_ID)) { 265 echo " - <a href=\"post.php?action=unapprovecomment&p=".$post->ID."&comment=".$comment->comment_ID."\">" . __('Unapprove') . "</a> "; 266 } else { 267 echo " - <a href=\"post.php?action=approvecomment&p=".$post->ID."&comment=".$comment->comment_ID."\">" . __('Approve') . "</a> "; 268 } 266 echo '<span class="unapprove"> - <a href="comment.php?action=unapprovecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ' );">' . __('Unapprove') . '</a> </span>'; 267 echo '<span class="approve"> - <a href="comment.php?action=approvecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ' );">' . __('Approve') . '</a> </span>'; 269 268 } 270 269 echo "]"; 271 270 } // end if any comments to show -
wp-admin/list-manipulation.js
14 14 } 15 15 } 16 16 17 function dimSomething( what, id ) { 18 return ajaxDelete( 'dim-' + what, id ); 19 } 20 17 21 function getResponseElement() { 18 22 var p = document.getElementById('ajax-response-p'); 19 23 if (!p) { … … 33 37 ajaxDel.onLoaded = function() { ajaxDel.myResponseElement.innerHTML = 'Data Sent...'; }; 34 38 ajaxDel.onInteractive = function() { ajaxDel.myResponseElement.innerHTML = 'Processing Data...'; }; 35 39 ajaxDel.onCompletion = function() { removeThisItem( what.replace('-as-spam', '') + '-' + id ); }; 36 ajaxDel.runAJAX('action=delete-' + what + '&id=' + id); 40 ajaxAction = what.match('dim-') ? '' : 'delete-'; 41 ajaxDel.runAJAX('action=' +ajaxAction + what + '&id=' + id); 37 42 return false; 38 43 } 39 44 40 45 function removeThisItem(id) { 46 alert('removeThisItem'); 47 dimming = false; 48 if ( id.match('dim-') ) { dimming = true; id = id.replace('dim-', ''); } 49 alert('dimming: ' + dimming); 41 50 var response = ajaxDel.response; 42 51 if ( isNaN(response) ) { alert(response); } 43 52 response = parseInt(response, 10); 53 alert('response: ' + response); 44 54 if ( -1 == response ) { ajaxDel.myResponseElement.innerHTML = "You don't have permission to do that."; } 45 55 else if ( 0 == response ) { ajaxDel.myResponseElement.interHTML = "Something odd happened. Try refreshing the page? Either that or what you tried to delete never existed in the first place."; } 46 56 else if ( 1 == response ) { 47 57 theItem = document.getElementById(id); 48 Fat.fade_element(id,null,700,'#FF3333'); 49 setTimeout('theItem.parentNode.removeChild(theItem)', 705); 50 var pos = getListPos(id); 51 listItems.splice(pos,1); 52 recolorList(pos); 58 alert('theItem'); 59 if ( dimming ) { 60 alert(theItem.className); 61 if ( theItem.className.match('unapproved') ) { 62 Fat.fade_element(id,null,700,null); 63 alert('fade'); 64 theItem.className = theItem.className.replace('unapproved', ''); 65 } else { 66 Fat.fade_element(id,null,700,'#FF3333'); 67 alert('fade'); 68 theItem.className = theItem.className + ' unapproved'; 69 } 70 } else { 71 Fat.fade_element(id,null,700,'#FF3333'); 72 setTimeout('theItem.parentNode.removeChild(theItem)', 705); 73 var pos = getListPos(id); 74 listItems.splice(pos,1); 75 recolorList(pos); 76 } 77 alert(theItem.className); 53 78 ajaxDel.myResponseElement.parentNode.removeChild(ajaxDel.myResponseElement); 54 79 alert('del0rted'); 55 80 } 56 81 } 57 82