Change text of reviewed content button

Added description to review notes
This commit is contained in:
scott1702 2015-10-30 17:30:18 +13:00
parent c50fa30a27
commit b7acdffff2
2 changed files with 8 additions and 6 deletions

View File

@ -26,7 +26,7 @@ class ContentReviewCMSExtension extends LeftAndMainExtension
public function reviewed($data, Form $form) public function reviewed($data, Form $form)
{ {
if (!isset($data["ID"])) { 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"]; $id = (int) $data["ID"];
@ -40,12 +40,14 @@ class ContentReviewCMSExtension extends LeftAndMainExtension
return Security::permissionFailure($this->owner); return Security::permissionFailure($this->owner);
} }
$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 = new FieldList();
$fields->push(HiddenField::create("ID", "ID", $id)); $fields->push(HiddenField::create("ID", "ID", $id));
$fields->push(TextareaField::create("ReviewNotes", "Review notes")); $fields->push($reviewNotes);
$actions = new FieldList( $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"); $form = CMSForm::create($this->owner, "EditForm", $fields, $actions)->setHTMLID("Form_EditForm");

View File

@ -119,9 +119,9 @@ class SiteTreeContentReview extends DataExtension implements PermissionProvider
public function updateCMSActions(FieldList $actions) public function updateCMSActions(FieldList $actions)
{ {
if ($this->canBeReviewedBy(Member::currentUser())) { 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-icon", "pencil")
->setAttribute("data-text-alternate", _t("ContentReview.BUTTONREVIEWED", "Content reviewed")); ->setAttribute("data-text-alternate", _t("ContentReview.BUTTONREVIEWED", "Review content"));
$actions->push($reviewAction); $actions->push($reviewAction);
} }