mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
f454f481f2
Ideally we could do this without session, but pragmatically we still need it, because of the inflexible routing system, and because of performance considerations. Example: The tree is lazy loaded via a generic URL (admin/pages/treeview). While we could add ?ID=<currentpage> to make the view (more or less) stateless, it would trigger a full tree reload on every tree navigation action. Instead, we assume that all "reachable" nodes are already cached, and simply mark a different one as current. For this to work, we need shared session state between CMS controllers. See http://open.silverstripe.org/ticket/7815 for detail.
21 lines
513 B
PHP
21 lines
513 B
PHP
<?php
|
|
|
|
/**
|
|
* @package cms
|
|
*/
|
|
class CMSPageSettingsController extends CMSMain {
|
|
|
|
static $url_segment = 'pages/settings';
|
|
static $url_rule = '/$Action/$ID/$OtherID';
|
|
static $url_priority = 42;
|
|
static $required_permission_codes = 'CMS_ACCESS_CMSMain';
|
|
static $session_namespace = 'CMSMain';
|
|
|
|
function getEditForm($id = null, $fields = null) {
|
|
$record = $this->getRecord($id ? $id : $this->currentPageID());
|
|
|
|
return parent::getEditForm($record, ($record) ? $record->getSettingsFields() : null);
|
|
}
|
|
|
|
}
|