mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
28 lines
787 B
PHP
28 lines
787 B
PHP
<?php
|
|
class CMSPageAddController extends CMSMain {
|
|
|
|
static $url_segment = 'page/add';
|
|
static $url_rule = '/$Action/$ID/$OtherID';
|
|
static $url_priority = 42;
|
|
static $menu_title = 'Add page';
|
|
static $required_permission_codes = 'CMS_ACCESS_CMSMain';
|
|
|
|
function AddForm() {
|
|
$form = parent::AddForm();
|
|
|
|
$form->addExtraClass('cms-content center cms-edit-form ' . $this->BaseCSSClasses());
|
|
$form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
|
|
if($parentID = $this->request->getVar('ParentID')) {
|
|
$form->Fields()->dataFieldByName('ParentID')->setValue((int)$parentID);
|
|
}
|
|
|
|
return $form;
|
|
}
|
|
|
|
function doAdd($data, $form) {
|
|
$return = parent::doAdd($data, $form);
|
|
$this->getResponse()->addHeader('X-Controller', 'CMSPageEditController');
|
|
return $return;
|
|
}
|
|
|
|
} |