From b7acdffff26794f6daf5e3d9db699e83341c742c Mon Sep 17 00:00:00 2001 From: scott1702 Date: Fri, 30 Oct 2015 17:30:18 +1300 Subject: [PATCH] Change text of reviewed content button Added description to review notes --- code/extensions/ContentReviewCMSExtension.php | 10 ++++++---- code/extensions/SiteTreeContentReview.php | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/code/extensions/ContentReviewCMSExtension.php b/code/extensions/ContentReviewCMSExtension.php index e1f1751..dc421a0 100644 --- a/code/extensions/ContentReviewCMSExtension.php +++ b/code/extensions/ContentReviewCMSExtension.php @@ -26,7 +26,7 @@ class ContentReviewCMSExtension extends LeftAndMainExtension public function reviewed($data, Form $form) { if (!isset($data["ID"])) { - throw new SS_HTTPResponse_Exception('No record ID', 404); + throw new SS_HTTPResponse_Exception("No record ID", 404); } $id = (int) $data["ID"]; @@ -40,12 +40,14 @@ class ContentReviewCMSExtension extends LeftAndMainExtension return Security::permissionFailure($this->owner); } - $fields = new FieldList(); + $reviewNotes = TextareaField::create("ReviewNotes", _t("ContentReview.REVIEWNOTES", "Review notes")); + $reviewNotes->setDescription(_t("ContentReview.REVIEWNOTESDESCRIPTION ", "Add comments for the content of this page.")); + $fields = new FieldList(); $fields->push(HiddenField::create("ID", "ID", $id)); - $fields->push(TextareaField::create("ReviewNotes", "Review notes")); + $fields->push($reviewNotes); $actions = new FieldList( - FormAction::create("save_review", "Save") + FormAction::create("save_review", _t("ContentReview.SAVE", "Save")) ); $form = CMSForm::create($this->owner, "EditForm", $fields, $actions)->setHTMLID("Form_EditForm"); diff --git a/code/extensions/SiteTreeContentReview.php b/code/extensions/SiteTreeContentReview.php index 7d053cb..65ee758 100644 --- a/code/extensions/SiteTreeContentReview.php +++ b/code/extensions/SiteTreeContentReview.php @@ -119,9 +119,9 @@ class SiteTreeContentReview extends DataExtension implements PermissionProvider public function updateCMSActions(FieldList $actions) { if ($this->canBeReviewedBy(Member::currentUser())) { - $reviewAction = FormAction::create("reviewed", _t("ContentReview.BUTTONREVIEWED", "Content reviewed")) + $reviewAction = FormAction::create("reviewed", _t("ContentReview.BUTTONREVIEWED", "Review content")) ->setAttribute("data-icon", "pencil") - ->setAttribute("data-text-alternate", _t("ContentReview.BUTTONREVIEWED", "Content reviewed")); + ->setAttribute("data-text-alternate", _t("ContentReview.BUTTONREVIEWED", "Review content")); $actions->push($reviewAction); }