diff --git a/code/admin/CommentAdmin.php b/code/admin/CommentAdmin.php index ed27113..b27d2ef 100644 --- a/code/admin/CommentAdmin.php +++ b/code/admin/CommentAdmin.php @@ -52,7 +52,7 @@ class CommentAdmin extends LeftAndMain implements PermissionProvider { $newGrid = new GridField( 'NewComments', - _t('CommentsAdmin.NewComments', 'Unmoderated'), + _t('CommentsAdmin.NewComments', 'New'), $newComments, $commentsConfig ); @@ -61,7 +61,7 @@ class CommentAdmin extends LeftAndMain implements PermissionProvider { $approvedGrid = new GridField( 'ApprovedComments', - _t('CommentsAdmin.ApprovedComments', 'Displayed'), + _t('CommentsAdmin.ApprovedComments', 'Approved'), $approvedComments, $commentsConfig ); @@ -82,10 +82,10 @@ class CommentAdmin extends LeftAndMain implements PermissionProvider { $fields = new FieldList( $root = new TabSet( 'Root', - new Tab('NewComments', _t('CommentAdmin.NewComments', 'Unmoderated') . ' ' . $newCount, + new Tab('NewComments', _t('CommentAdmin.NewComments', 'New') . ' ' . $newCount, $newGrid ), - new Tab('ApprovedComments', _t('CommentAdmin.ApprovedComments', 'Displayed') . ' ' . $approvedCount, + new Tab('ApprovedComments', _t('CommentAdmin.ApprovedComments', 'Approved') . ' ' . $approvedCount, $approvedGrid ), new Tab('SpamComments', _t('CommentAdmin.SpamComments', 'Spam') . ' ' . $spamCount, diff --git a/code/admin/CommentsGridFieldAction.php b/code/admin/CommentsGridFieldAction.php index 6e1c98f..0043555 100644 --- a/code/admin/CommentsGridFieldAction.php +++ b/code/admin/CommentsGridFieldAction.php @@ -44,7 +44,7 @@ class CommentsGridFieldAction implements GridField_ColumnProvider, GridField_Act $field .= GridField_FormAction::create( $gridField, 'CustomAction' . $record->ID, - 'Mark As Spam', + 'Spam', 'spam', array('RecordID' => $record->ID) )->Field(); @@ -52,8 +52,8 @@ class CommentsGridFieldAction implements GridField_ColumnProvider, GridField_Act $field .= GridField_FormAction::create( $gridField, 'CustomAction' . $record->ID, - 'Mark As Not Spam', - 'not_spam', + 'Approve', + 'approve', array('RecordID' => $record->ID) )->Field(); @@ -64,7 +64,7 @@ class CommentsGridFieldAction implements GridField_ColumnProvider, GridField_Act * {@inheritdoc} */ public function getActions($gridField) { - return array('spam', 'not_spam'); + return array('spam', 'approve'); } /** @@ -85,7 +85,7 @@ class CommentsGridFieldAction implements GridField_ColumnProvider, GridField_Act ); } - if($actionName == 'not_spam') { + if($actionName == 'approve') { $comment = Comment::get()->byID($arguments["RecordID"]); $comment->Moderated = true; @@ -95,7 +95,7 @@ class CommentsGridFieldAction implements GridField_ColumnProvider, GridField_Act // output a success message to the user Controller::curr()->getResponse()->setStatusCode( 200, - 'Comment marked as not spam.' + 'Comment approved.' ); } } diff --git a/code/admin/CommentsGridFieldBulkAction.php b/code/admin/CommentsGridFieldBulkAction.php index 92ad1b8..47611cd 100644 --- a/code/admin/CommentsGridFieldBulkAction.php +++ b/code/admin/CommentsGridFieldBulkAction.php @@ -4,7 +4,7 @@ * @package comments */ class CommentsGridFieldBulkAction extends GridFieldBulkActionHandler { - + } /** @@ -13,22 +13,22 @@ class CommentsGridFieldBulkAction extends GridFieldBulkActionHandler { * @package comments */ class CommentsGridFieldBulkAction_Handlers extends CommentsGridFieldBulkAction { - + private static $allowed_actions = array( - 'markAsSpam', - 'markAsNotSpam', + 'spam', + 'approve', ); private static $url_handlers = array( - 'markAsSpam' => 'markAsSpam', - 'markAsNotSpam' => 'markAsNotSpam', + 'spam' => 'spam', + 'approve' => 'approve', ); - public function markAsSpam(SS_HTTPRequest $request) { + public function spam(SS_HTTPRequest $request) { $ids = array(); - - foreach($this->getRecords() as $record) { + + foreach($this->getRecords() as $record) { array_push($ids, $record->ID); $record->Moderated = 1; @@ -43,11 +43,11 @@ class CommentsGridFieldBulkAction_Handlers extends CommentsGridFieldBulkAction { $response->addHeader('Content-Type', 'text/json'); - return $response; + return $response; } - public function markAsNotSpam(SS_HTTPRequest $request) { + public function approve(SS_HTTPRequest $request) { $ids = array(); foreach($this->getRecords() as $record) { diff --git a/code/admin/CommentsGridFieldConfig.php b/code/admin/CommentsGridFieldConfig.php index ab7a9e5..a4910b3 100644 --- a/code/admin/CommentsGridFieldConfig.php +++ b/code/admin/CommentsGridFieldConfig.php @@ -24,7 +24,7 @@ class CommentsGridFieldConfig extends GridFieldConfig_RecordEditor { $manager = new GridFieldBulkManager(); $manager->addBulkAction( - 'markAsSpam', 'Mark as spam', 'CommentsGridFieldBulkAction_Handlers', + 'spam', 'Spam', 'CommentsGridFieldBulkAction_Handlers', array( 'isAjax' => true, 'icon' => 'cross', @@ -33,7 +33,7 @@ class CommentsGridFieldConfig extends GridFieldConfig_RecordEditor { ); $manager->addBulkAction( - 'markAsNotSpam', 'Mark as not spam', 'CommentsGridFieldBulkAction_Handlers', + 'approve', 'Approve', 'CommentsGridFieldBulkAction_Handlers', array( 'isAjax' => true, 'icon' => 'cross', diff --git a/code/extensions/CommentsExtension.php b/code/extensions/CommentsExtension.php index c668307..21e240a 100644 --- a/code/extensions/CommentsExtension.php +++ b/code/extensions/CommentsExtension.php @@ -463,7 +463,7 @@ class CommentsExtension extends DataExtension { $newGrid = new GridField( 'NewComments', - _t('CommentsAdmin.NewComments', 'Unmoderated'), + _t('CommentsAdmin.NewComments', 'New'), $newComments, $commentsConfig ); @@ -472,7 +472,7 @@ class CommentsExtension extends DataExtension { $approvedGrid = new GridField( 'ApprovedComments', - _t('CommentsAdmin.Comments', 'Displayed'), + _t('CommentsAdmin.Comments', 'Approved'), $approvedComments, $commentsConfig ); @@ -493,10 +493,10 @@ class CommentsExtension extends DataExtension { if($fields->hasTabSet()) { $tabs = new TabSet( 'Comments', - new Tab('CommentsNewCommentsTab', _t('CommentAdmin.NewComments', 'Unmoderated') . ' ' . $newCount, + new Tab('CommentsNewCommentsTab', _t('CommentAdmin.NewComments', 'New') . ' ' . $newCount, $newGrid ), - new Tab('CommentsCommentsTab', _t('CommentAdmin.Comments', 'Displayed') . ' ' . $approvedCount, + new Tab('CommentsCommentsTab', _t('CommentAdmin.Comments', 'Approved') . ' ' . $approvedCount, $approvedGrid ), new Tab('CommentsSpamCommentsTab', _t('CommentAdmin.SpamComments', 'Spam') . ' ' . $spamCount,