2011-04-16 17:54:52 +12:00
|
|
|
<?php
|
2011-08-19 12:32:31 +12:00
|
|
|
|
2016-07-22 11:32:32 +12:00
|
|
|
namespace SilverStripe\CMS\Controllers;
|
|
|
|
|
2024-10-17 12:49:24 +13:00
|
|
|
use SilverStripe\Forms\Form;
|
2024-09-23 14:37:02 +12:00
|
|
|
use SilverStripe\Model\ArrayData;
|
2017-08-24 17:09:34 +12:00
|
|
|
|
2017-01-26 09:59:25 +13:00
|
|
|
class CMSPageSettingsController extends CMSMain
|
|
|
|
{
|
2011-04-16 17:54:52 +12:00
|
|
|
|
2017-01-26 09:59:25 +13:00
|
|
|
private static $url_segment = 'pages/settings';
|
2016-08-10 16:08:39 +12:00
|
|
|
|
2017-01-26 09:59:25 +13:00
|
|
|
private static $url_rule = '/$Action/$ID/$OtherID';
|
2016-08-10 16:08:39 +12:00
|
|
|
|
2017-01-26 09:59:25 +13:00
|
|
|
private static $url_priority = 42;
|
2016-08-10 16:08:39 +12:00
|
|
|
|
2017-01-26 09:59:25 +13:00
|
|
|
private static $required_permission_codes = 'CMS_ACCESS_CMSMain';
|
2015-09-29 17:18:03 +13:00
|
|
|
|
2024-10-17 12:49:24 +13:00
|
|
|
public function getEditForm($id = null, $fields = null): Form
|
2017-01-26 09:59:25 +13:00
|
|
|
{
|
2024-10-17 12:49:24 +13:00
|
|
|
$record = $this->getRecord($id ?: $this->currentRecordID());
|
|
|
|
|
|
|
|
// @TODO ideally settings isn't its own special thing...
|
|
|
|
// can we refactor this so it's just another tab in the main form? And just have it lazyload or something?
|
|
|
|
// At the very least this tab must NOT appear if there are no fields for it.
|
|
|
|
if ($record && $record->hasMethod('getSettingsFields')) {
|
|
|
|
$fields = $record->getSettingsFields();
|
|
|
|
} else {
|
|
|
|
$fields = null;
|
|
|
|
}
|
|
|
|
return parent::getEditForm($id, $fields);
|
2017-01-26 09:59:25 +13:00
|
|
|
}
|
2012-11-29 14:43:05 +01:00
|
|
|
|
2017-07-18 13:19:04 +12:00
|
|
|
public function getTabIdentifier()
|
|
|
|
{
|
|
|
|
return 'settings';
|
|
|
|
}
|
2012-04-12 19:23:20 +12:00
|
|
|
}
|