'Approving' a comment makes more sense than 'accepting' a comment

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@39878 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2007-08-12 22:19:06 +00:00
parent 6b4cdc6dbb
commit d7ea506562
8 changed files with 29 additions and 29 deletions

View File

@ -76,7 +76,7 @@ class CommentTableField extends ComplexTableField {
} }
} }
function accept() { function approve() {
if(!Permission::check('ADMIN')) { if(!Permission::check('ADMIN')) {
return false; return false;
} }
@ -96,10 +96,10 @@ class CommentTableField extends ComplexTableField {
} }
function HasSpamButton() { function HasSpamButton() {
return $this->mode == 'accepted' || $this->mode == 'unmoderated'; return $this->mode == 'approved' || $this->mode == 'unmoderated';
} }
function HasAcceptButton() { function HasApproveButton() {
return $this->mode == 'unmoderated'; return $this->mode == 'unmoderated';
} }
@ -131,8 +131,8 @@ class CommentTableField_Item extends ComplexTableField_Item {
return $this->parent()->HasSpamButton(); return $this->parent()->HasSpamButton();
} }
function HasAcceptButton() { function HasApproveButton() {
return $this->parent()->HasAcceptButton(); return $this->parent()->HasApproveButton();
} }
function HasHamButton() { function HasHamButton() {
@ -147,8 +147,8 @@ class CommentTableField_Item extends ComplexTableField_Item {
return $this->BaseLink() . "&methodName=ham"; return $this->BaseLink() . "&methodName=ham";
} }
function AcceptLink() { function ApproveLink() {
return $this->BaseLink() . "&methodName=accept"; return $this->BaseLink() . "&methodName=approve";
} }
} }

View File

@ -23,8 +23,8 @@ class FeedbackAdmin extends LeftAndMain {
} }
$section = substr($url, strrpos($url, '/') + 1); $section = substr($url, strrpos($url, '/') + 1);
if($section != 'accepted' && $section != 'unmoderated' && $section != 'spam') { if($section != 'approved' && $section != 'unmoderated' && $section != 'spam') {
$section = 'accepted'; $section = 'approved';
} }
return $section; return $section;
@ -33,9 +33,9 @@ class FeedbackAdmin extends LeftAndMain {
public function EditForm() { public function EditForm() {
$section = $this->Section(); $section = $this->Section();
if($section == 'accepted') { if($section == 'approved') {
$filter = 'IsSpam=0 AND NeedsModeration=0'; $filter = 'IsSpam=0 AND NeedsModeration=0';
$title = "<h2>Accepted Comments</h2>"; $title = "<h2>Approved Comments</h2>";
} else if($section == 'unmoderated') { } else if($section == 'unmoderated') {
$filter = 'NeedsModeration=1'; $filter = 'NeedsModeration=1';
$title = "<h2>Comments Awaiting Moderation</h2>"; $title = "<h2>Comments Awaiting Moderation</h2>";
@ -159,7 +159,7 @@ JS;
JS; JS;
} }
function acceptmarked() { function approvemarked() {
$numComments = 0; $numComments = 0;
$folderID = 0; $folderID = 0;
$deleteList = ''; $deleteList = '';

View File

@ -63,9 +63,9 @@ class PageComment extends DataObject {
} }
} }
function AcceptLink() { function ApproveLink() {
if(Permission::check('CMS_ACCESS_CMSMain') && $this->getField('NeedsModeration')) { if(Permission::check('CMS_ACCESS_CMSMain') && $this->getField('NeedsModeration')) {
return "PageComment/accept/$this->ID"; return "PageComment/approve/$this->ID";
} }
} }
@ -77,7 +77,7 @@ class PageComment extends DataObject {
} }
} }
function accept() { function approve() {
if(Permission::check('CMS_ACCESS_CMSMain')) { if(Permission::check('CMS_ACCESS_CMSMain')) {
$comment = DataObject::get_by_id("PageComment", $this->urlParams['ID']); $comment = DataObject::get_by_id("PageComment", $this->urlParams['ID']);
$comment->NeedsModeration = false; $comment->NeedsModeration = false;

View File

@ -7,7 +7,7 @@ CommentTableField.prototype = {
onclick: this.removeRowAfterAjax.bind(this) onclick: this.removeRowAfterAjax.bind(this)
}; };
rules['#'+this.id+' table.data a.acceptlink'] = { rules['#'+this.id+' table.data a.approvelink'] = {
onclick: this.removeRowAfterAjax.bind(this) onclick: this.removeRowAfterAjax.bind(this)
}; };

View File

@ -20,8 +20,8 @@ PageCommentInterface.prototype = {
'#PageComments a.hamlink' : { '#PageComments a.hamlink' : {
onclick : this.reportHam onclick : this.reportHam
}, },
'#PageComments a.acceptlink' : { '#PageComments a.approvelink' : {
onclick : this.acceptComment onclick : this.approveComment
} }
}); });
}, },
@ -188,10 +188,10 @@ PageCommentInterface.prototype = {
/** /**
* Ajax handler of ham reporting * Ajax handler of ham reporting
*/ */
acceptComment: function() { approveComment: function() {
var __comment = this.parentNode.parentNode.parentNode; var __comment = this.parentNode.parentNode.parentNode;
__comment.getElementsByTagName('span')[0].innerHTML = "Marking comment as accepted..."; __comment.getElementsByTagName('span')[0].innerHTML = "Marking comment as approved...";
new Ajax.Request(this.href + '?ajax=1', { new Ajax.Request(this.href + '?ajax=1', {
onSuccess : function(response) { onSuccess : function(response) {

View File

@ -13,7 +13,7 @@
</th> </th>
<% end_control %> <% end_control %>
<% if Can(edit) %><th width="18">&nbsp;</th><% end_if %> <% if Can(edit) %><th width="18">&nbsp;</th><% end_if %>
<% if HasAcceptButton %><th width="18">&nbsp;</th><% end_if %> <% if HasApproveButton %><th width="18">&nbsp;</th><% end_if %>
<% if HasSpamButton %><th width="18">&nbsp;</th><% end_if %> <% if HasSpamButton %><th width="18">&nbsp;</th><% end_if %>
<% if HasHamButton %><th width="18">&nbsp;</th><% end_if %> <% if HasHamButton %><th width="18">&nbsp;</th><% end_if %>
<% if Can(delete) %><th width="18">&nbsp;</th><% end_if %> <% if Can(delete) %><th width="18">&nbsp;</th><% end_if %>
@ -28,7 +28,7 @@
<td<% if Function %> class="$Function"<% end_if %>>&nbsp;</td> <td<% if Function %> class="$Function"<% end_if %>>&nbsp;</td>
<% end_control %> <% end_control %>
<% if Can(edit) %><th width="18">&nbsp;</th><% end_if %> <% if Can(edit) %><th width="18">&nbsp;</th><% end_if %>
<% if HasAcceptButton %><th width="18">&nbsp;</th><% end_if %> <% if HasApproveButton %><th width="18">&nbsp;</th><% end_if %>
<% if HasSpamButton %><th width="18">&nbsp;</th><% end_if %> <% if HasSpamButton %><th width="18">&nbsp;</th><% end_if %>
<% if HasHamButtom %><th width="18">&nbsp;</th><% end_if %> <% if HasHamButtom %><th width="18">&nbsp;</th><% end_if %>
<% if Can(delete) %><th width="18">&nbsp;</th><% end_if %> <% if Can(delete) %><th width="18">&nbsp;</th><% end_if %>
@ -46,8 +46,8 @@
<% if Can(edit) %> <% if Can(edit) %>
<td width="18"><a class="popuplink editlink" href="$EditLink" target="_blank"><img src="cms/images/edit.gif" alt="edit" /></a></td> <td width="18"><a class="popuplink editlink" href="$EditLink" target="_blank"><img src="cms/images/edit.gif" alt="edit" /></a></td>
<% end_if %> <% end_if %>
<% if HasAcceptButton %> <% if HasApproveButton %>
<td width="18"><a class="acceptlink" href="$AcceptLink" title="Accept this comment"><img src="cms/images/approvecomment.png" alt="accept" /></a></td> <td width="18"><a class="approvelink" href="$ApproveLink" title="Approve this comment"><img src="cms/images/approvecomment.png" alt="approve" /></a></td>
<% end_if %> <% end_if %>
<% if HasSpamButton %> <% if HasSpamButton %>
<td width="18"><a class="spamlink" href="$SpamLink" title="Mark this comment as spam"><img src="cms/images/declinecomment.png" alt="spam" /></a></td> <td width="18"><a class="spamlink" href="$SpamLink" title="Mark this comment as spam"><img src="cms/images/declinecomment.png" alt="spam" /></a></td>
@ -65,7 +65,7 @@
<% if Markable %><th width="18">&nbsp;</th><% end_if %> <% if Markable %><th width="18">&nbsp;</th><% end_if %>
<td colspan="$Headings.Count"><i>No items found</i></td> <td colspan="$Headings.Count"><i>No items found</i></td>
<% if Can(edit) %><th width="18">&nbsp;</th><% end_if %> <% if Can(edit) %><th width="18">&nbsp;</th><% end_if %>
<% if HasAcceptButton %><th width="18">&nbsp;</th><% end_if %> <% if HasApproveButton %><th width="18">&nbsp;</th><% end_if %>
<% if HasSpamButton %><th width="18">&nbsp;</th><% end_if %> <% if HasSpamButton %><th width="18">&nbsp;</th><% end_if %>
<% if HasHamButtom %><th width="18">&nbsp;</th><% end_if %> <% if HasHamButtom %><th width="18">&nbsp;</th><% end_if %>
<% if Can(delete) %><th width="18">&nbsp;</th><% end_if %> <% if Can(delete) %><th width="18">&nbsp;</th><% end_if %>

View File

@ -1,8 +1,8 @@
<ul id="sitetree" class="tree unformatted"> <ul id="sitetree" class="tree unformatted">
<li id="$ID" class="Root"><a>Comments</a> <li id="$ID" class="Root"><a>Comments</a>
<ul> <ul>
<li id="record-comments" <% if Section=accepted %>class="current"<% end_if %>> <li id="record-approved" <% if Section=approved %>class="current"<% end_if %>>
<a href="$baseURL/admin/feedback/showtable/accepted" title="Accepted">Accepted</a> <a href="$baseURL/admin/feedback/showtable/approved" title="Approved">Approved</a>
</li> </li>
<li id="record-unmoderated" <% if Section=unmoderated %>class="current"<% end_if %>> <li id="record-unmoderated" <% if Section=unmoderated %>class="current"<% end_if %>>
<a href="$baseURL/admin/feedback/showtable/unmoderated" title="Awaiting Moderation">Awaiting Moderation</a> <a href="$baseURL/admin/feedback/showtable/unmoderated" title="Awaiting Moderation">Awaiting Moderation</a>

View File

@ -8,8 +8,8 @@
<span>Posted by $Name.XML, $Created.Nice ($Created.Ago)</span> <span>Posted by $Name.XML, $Created.Nice ($Created.Ago)</span>
<br /> <br />
<ul class="actionLinks"> <ul class="actionLinks">
<% if AcceptLink %> <% if ApproveLink %>
<li><a href="$AcceptLink" class="acceptlink">accept this comment</a></li> <li><a href="$ApproveLink" class="approvelink">approve this comment</a></li>
<% end_if %> <% end_if %>
<% if SpamLink %> <% if SpamLink %>
<li><a href="$SpamLink" class="spamlink">this comment is spam</a></li> <li><a href="$SpamLink" class="spamlink">this comment is spam</a></li>