2011-07-06 08:39:34 +02:00
|
|
|
<?php
|
|
|
|
class CMSSettingsController extends CMSMain {
|
|
|
|
|
|
|
|
static $url_segment = 'settings';
|
|
|
|
static $url_rule = '/$Action/$ID/$OtherID';
|
|
|
|
static $menu_priority = -1;
|
|
|
|
static $menu_title = 'Settings';
|
|
|
|
|
2012-03-08 18:19:38 +01:00
|
|
|
/**
|
|
|
|
* @return Form
|
|
|
|
*/
|
|
|
|
function getEditForm($id = null) {
|
|
|
|
$siteConfig = SiteConfig::current_site_config();
|
|
|
|
$fields = $siteConfig->getCMSFields();
|
|
|
|
|
|
|
|
$actions = $siteConfig->getCMSActions();
|
|
|
|
$form = new Form($this, 'EditForm', $fields, $actions);
|
|
|
|
$form->addExtraClass('root-form');
|
|
|
|
$form->addExtraClass('cms-edit-form');
|
|
|
|
// TODO Can't merge $FormAttributes in template at the moment
|
|
|
|
$form->addExtraClass('cms-content center ss-tabset');
|
|
|
|
if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
|
|
|
|
$form->setHTMLID('Form_EditForm');
|
|
|
|
$form->loadDataFrom($siteConfig);
|
|
|
|
$form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
|
|
|
|
|
|
|
|
// Use <button> to allow full jQuery UI styling
|
|
|
|
$actions = $actions->dataFields();
|
|
|
|
if($actions) foreach($actions as $action) $action->setUseButtonTag(true);
|
|
|
|
|
|
|
|
$this->extend('updateEditForm', $form);
|
|
|
|
|
|
|
|
return $form;
|
2011-07-06 08:39:34 +02:00
|
|
|
}
|
|
|
|
|
2011-10-29 19:13:19 +02:00
|
|
|
function PreviewLink() {
|
|
|
|
return false;
|
|
|
|
}
|
2012-03-02 20:45:44 +01:00
|
|
|
|
|
|
|
function Breadcrumbs() {
|
|
|
|
return new ArrayList(array(
|
|
|
|
new ArrayData(array(
|
|
|
|
'Title' => $this->SectionTitle(),
|
|
|
|
'Link' => false
|
|
|
|
))
|
|
|
|
));
|
|
|
|
}
|
2011-10-29 19:13:19 +02:00
|
|
|
|
2011-07-06 08:39:34 +02:00
|
|
|
}
|