mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
27 lines
728 B
PHP
27 lines
728 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';
|
||
|
|
||
|
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;
|
||
|
}
|
||
|
|
||
|
}
|