2011-12-20 15:57:02 +01:00
|
|
|
<?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';
|
2012-03-05 16:07:53 +01:00
|
|
|
static $required_permission_codes = 'CMS_ACCESS_CMSMain';
|
2011-12-20 15:57:02 +01:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|