Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ENHANCEMENT Splitting up CMSMain into CMSPageEditController and CMSPa…

…geSettingsController
  • Loading branch information...
commit 2e2e312da9e11322ff8bf62a7545cb09bd6da531 1 parent 8af9c54
@chillu chillu authored
View
6 _config.php
@@ -28,4 +28,8 @@
*/
ShortcodeParser::get('default')->register('sitetree_link', array('SiteTree', 'link_shortcode_handler'));
-Object::add_extension('File', 'SiteTreeFileExtension');
+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
13 code/controller/CMSPageEditController.php
@@ -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
13 code/controller/CMSPageSettingsController.php
@@ -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);
+ }
+
+}
Please sign in to comment.
Something went wrong with that request. Please try again.