ENHANCEMENT Splitting up CMSMain into CMSPageEditController and CMSPageSettingsController

This commit is contained in:
Ingo Schommer 2011-04-16 17:54:52 +12:00
parent 8af9c546cf
commit 2e2e312da9
3 changed files with 31 additions and 1 deletions

View File

@ -29,3 +29,7 @@ else SS_Report::register('ReportAdmin', 'BrokenLinksReport',-20);
ShortcodeParser::get('default')->register('sitetree_link', array('SiteTree', 'link_shortcode_handler'));
Object::add_extension('File', 'SiteTreeFileExtension');
// TODO Remove once we can configure CMSMenu through static, nested configuration files
CMSMenu::remove_menu_item('CMSPageEditController');
CMSMenu::remove_menu_item('CMSPageSettingsController');

View File

@ -0,0 +1,13 @@
<?php
class CMSPageEditController extends CMSMain {
static $url_segment = 'page/edit';
static $url_rule = '/$Action/$ID/$OtherID';
static $url_priority = 41;
function getEditForm($id = null, $fields = null) {
$record = $this->getRecord($id ? $id : $this->currentPageID());
return parent::getEditForm($record, ($record) ? $record->getCMSFields() : null);
}
}

View File

@ -0,0 +1,13 @@
<?php
class CMSPageSettingsController extends CMSMain {
static $url_segment = 'page/settings';
static $url_rule = '/$Action/$ID/$OtherID';
static $url_priority = 42;
function getEditForm($id = null, $fields = null) {
$record = $this->getRecord($id ? $id : $this->currentPageID());
return parent::getEditForm($record, ($record) ? $record->getSettingsFields() : null);
}
}