mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
ENHANCEMENT: Add 'Cancel' button to 'Add Page' form
This commit is contained in:
parent
e444b359ec
commit
95d9257b1b
@ -10,6 +10,7 @@ class CMSPageAddController extends CMSPageEditController {
|
||||
private static $allowed_actions = array(
|
||||
'AddForm',
|
||||
'doAdd',
|
||||
'doCancel'
|
||||
);
|
||||
|
||||
/**
|
||||
@ -108,9 +109,11 @@ class CMSPageAddController extends CMSPageEditController {
|
||||
}
|
||||
|
||||
$actions = new FieldList(
|
||||
// $resetAction = new ResetFormAction('doCancel', _t('CMSMain.Cancel', 'Cancel')),
|
||||
FormAction::create("doAdd", _t('CMSMain.Create',"Create"))
|
||||
->addExtraClass('ss-ui-action-constructive')->setAttribute('data-icon', 'accept')
|
||||
->setUseButtonTag(true),
|
||||
FormAction::create("doCancel", _t('CMSMain.Cancel',"Cancel"))
|
||||
->addExtraClass('ss-ui-action-destructive')
|
||||
->setUseButtonTag(true)
|
||||
);
|
||||
|
||||
@ -174,4 +177,8 @@ class CMSPageAddController extends CMSPageEditController {
|
||||
return $this->redirect(Controller::join_links(singleton('CMSPageEditController')->Link('show'), $record->ID));
|
||||
}
|
||||
|
||||
public function doCancel($data, $form) {
|
||||
return $this->redirect(singleton('CMSMain')->Link());
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user