mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
'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:
parent
6b4cdc6dbb
commit
d7ea506562
@ -76,7 +76,7 @@ class CommentTableField extends ComplexTableField {
|
||||
}
|
||||
}
|
||||
|
||||
function accept() {
|
||||
function approve() {
|
||||
if(!Permission::check('ADMIN')) {
|
||||
return false;
|
||||
}
|
||||
@ -96,10 +96,10 @@ class CommentTableField extends ComplexTableField {
|
||||
}
|
||||
|
||||
function HasSpamButton() {
|
||||
return $this->mode == 'accepted' || $this->mode == 'unmoderated';
|
||||
return $this->mode == 'approved' || $this->mode == 'unmoderated';
|
||||
}
|
||||
|
||||
function HasAcceptButton() {
|
||||
function HasApproveButton() {
|
||||
return $this->mode == 'unmoderated';
|
||||
}
|
||||
|
||||
@ -131,8 +131,8 @@ class CommentTableField_Item extends ComplexTableField_Item {
|
||||
return $this->parent()->HasSpamButton();
|
||||
}
|
||||
|
||||
function HasAcceptButton() {
|
||||
return $this->parent()->HasAcceptButton();
|
||||
function HasApproveButton() {
|
||||
return $this->parent()->HasApproveButton();
|
||||
}
|
||||
|
||||
function HasHamButton() {
|
||||
@ -147,8 +147,8 @@ class CommentTableField_Item extends ComplexTableField_Item {
|
||||
return $this->BaseLink() . "&methodName=ham";
|
||||
}
|
||||
|
||||
function AcceptLink() {
|
||||
return $this->BaseLink() . "&methodName=accept";
|
||||
function ApproveLink() {
|
||||
return $this->BaseLink() . "&methodName=approve";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,8 +23,8 @@ class FeedbackAdmin extends LeftAndMain {
|
||||
}
|
||||
$section = substr($url, strrpos($url, '/') + 1);
|
||||
|
||||
if($section != 'accepted' && $section != 'unmoderated' && $section != 'spam') {
|
||||
$section = 'accepted';
|
||||
if($section != 'approved' && $section != 'unmoderated' && $section != 'spam') {
|
||||
$section = 'approved';
|
||||
}
|
||||
|
||||
return $section;
|
||||
@ -33,9 +33,9 @@ class FeedbackAdmin extends LeftAndMain {
|
||||
public function EditForm() {
|
||||
$section = $this->Section();
|
||||
|
||||
if($section == 'accepted') {
|
||||
if($section == 'approved') {
|
||||
$filter = 'IsSpam=0 AND NeedsModeration=0';
|
||||
$title = "<h2>Accepted Comments</h2>";
|
||||
$title = "<h2>Approved Comments</h2>";
|
||||
} else if($section == 'unmoderated') {
|
||||
$filter = 'NeedsModeration=1';
|
||||
$title = "<h2>Comments Awaiting Moderation</h2>";
|
||||
@ -159,7 +159,7 @@ JS;
|
||||
JS;
|
||||
}
|
||||
|
||||
function acceptmarked() {
|
||||
function approvemarked() {
|
||||
$numComments = 0;
|
||||
$folderID = 0;
|
||||
$deleteList = '';
|
||||
|
@ -63,9 +63,9 @@ class PageComment extends DataObject {
|
||||
}
|
||||
}
|
||||
|
||||
function AcceptLink() {
|
||||
function ApproveLink() {
|
||||
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')) {
|
||||
$comment = DataObject::get_by_id("PageComment", $this->urlParams['ID']);
|
||||
$comment->NeedsModeration = false;
|
||||
|
@ -7,7 +7,7 @@ CommentTableField.prototype = {
|
||||
onclick: this.removeRowAfterAjax.bind(this)
|
||||
};
|
||||
|
||||
rules['#'+this.id+' table.data a.acceptlink'] = {
|
||||
rules['#'+this.id+' table.data a.approvelink'] = {
|
||||
onclick: this.removeRowAfterAjax.bind(this)
|
||||
};
|
||||
|
||||
|
@ -20,8 +20,8 @@ PageCommentInterface.prototype = {
|
||||
'#PageComments a.hamlink' : {
|
||||
onclick : this.reportHam
|
||||
},
|
||||
'#PageComments a.acceptlink' : {
|
||||
onclick : this.acceptComment
|
||||
'#PageComments a.approvelink' : {
|
||||
onclick : this.approveComment
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -188,10 +188,10 @@ PageCommentInterface.prototype = {
|
||||
/**
|
||||
* Ajax handler of ham reporting
|
||||
*/
|
||||
acceptComment: function() {
|
||||
approveComment: function() {
|
||||
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', {
|
||||
onSuccess : function(response) {
|
||||
|
@ -13,7 +13,7 @@
|
||||
</th>
|
||||
<% end_control %>
|
||||
<% if Can(edit) %><th width="18"> </th><% end_if %>
|
||||
<% if HasAcceptButton %><th width="18"> </th><% end_if %>
|
||||
<% if HasApproveButton %><th width="18"> </th><% end_if %>
|
||||
<% if HasSpamButton %><th width="18"> </th><% end_if %>
|
||||
<% if HasHamButton %><th width="18"> </th><% end_if %>
|
||||
<% if Can(delete) %><th width="18"> </th><% end_if %>
|
||||
@ -28,7 +28,7 @@
|
||||
<td<% if Function %> class="$Function"<% end_if %>> </td>
|
||||
<% end_control %>
|
||||
<% if Can(edit) %><th width="18"> </th><% end_if %>
|
||||
<% if HasAcceptButton %><th width="18"> </th><% end_if %>
|
||||
<% if HasApproveButton %><th width="18"> </th><% end_if %>
|
||||
<% if HasSpamButton %><th width="18"> </th><% end_if %>
|
||||
<% if HasHamButtom %><th width="18"> </th><% end_if %>
|
||||
<% if Can(delete) %><th width="18"> </th><% end_if %>
|
||||
@ -46,8 +46,8 @@
|
||||
<% if Can(edit) %>
|
||||
<td width="18"><a class="popuplink editlink" href="$EditLink" target="_blank"><img src="cms/images/edit.gif" alt="edit" /></a></td>
|
||||
<% end_if %>
|
||||
<% if HasAcceptButton %>
|
||||
<td width="18"><a class="acceptlink" href="$AcceptLink" title="Accept this comment"><img src="cms/images/approvecomment.png" alt="accept" /></a></td>
|
||||
<% if HasApproveButton %>
|
||||
<td width="18"><a class="approvelink" href="$ApproveLink" title="Approve this comment"><img src="cms/images/approvecomment.png" alt="approve" /></a></td>
|
||||
<% end_if %>
|
||||
<% 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>
|
||||
@ -65,7 +65,7 @@
|
||||
<% if Markable %><th width="18"> </th><% end_if %>
|
||||
<td colspan="$Headings.Count"><i>No items found</i></td>
|
||||
<% if Can(edit) %><th width="18"> </th><% end_if %>
|
||||
<% if HasAcceptButton %><th width="18"> </th><% end_if %>
|
||||
<% if HasApproveButton %><th width="18"> </th><% end_if %>
|
||||
<% if HasSpamButton %><th width="18"> </th><% end_if %>
|
||||
<% if HasHamButtom %><th width="18"> </th><% end_if %>
|
||||
<% if Can(delete) %><th width="18"> </th><% end_if %>
|
||||
|
@ -1,8 +1,8 @@
|
||||
<ul id="sitetree" class="tree unformatted">
|
||||
<li id="$ID" class="Root"><a>Comments</a>
|
||||
<ul>
|
||||
<li id="record-comments" <% if Section=accepted %>class="current"<% end_if %>>
|
||||
<a href="$baseURL/admin/feedback/showtable/accepted" title="Accepted">Accepted</a>
|
||||
<li id="record-approved" <% if Section=approved %>class="current"<% end_if %>>
|
||||
<a href="$baseURL/admin/feedback/showtable/approved" title="Approved">Approved</a>
|
||||
</li>
|
||||
<li id="record-unmoderated" <% if Section=unmoderated %>class="current"<% end_if %>>
|
||||
<a href="$baseURL/admin/feedback/showtable/unmoderated" title="Awaiting Moderation">Awaiting Moderation</a>
|
||||
|
@ -8,8 +8,8 @@
|
||||
<span>Posted by $Name.XML, $Created.Nice ($Created.Ago)</span>
|
||||
<br />
|
||||
<ul class="actionLinks">
|
||||
<% if AcceptLink %>
|
||||
<li><a href="$AcceptLink" class="acceptlink">accept this comment</a></li>
|
||||
<% if ApproveLink %>
|
||||
<li><a href="$ApproveLink" class="approvelink">approve this comment</a></li>
|
||||
<% end_if %>
|
||||
<% if SpamLink %>
|
||||
<li><a href="$SpamLink" class="spamlink">this comment is spam</a></li>
|
||||
|
Loading…
Reference in New Issue
Block a user