From 7807842eb185f7c875a1957106f5764f32c2c487 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Tue, 21 Aug 2012 15:50:03 +1200 Subject: [PATCH] FIXED: Additional issue where the add-page ajax parameters wouldu incorrectly concatenate additional query parameters into the add action url. Resolved by moving URL concatenation from view to controller where Controller::join_links is available --- code/controllers/CMSMain.php | 8 ++++++-- templates/Includes/CMSMain_TreeView.ss | 2 +- .../Includes/CMSPagesController_ContentToolActions.ss | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index e01e0175..ef9ff9ec 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -202,8 +202,12 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr return $link; } - function LinkPageAdd() { - return singleton("CMSPageAddController")->Link(); + function LinkPageAdd($extraArguments = null) { + $link = singleton("CMSPageAddController")->Link(); + $this->extend('updateLinkPageAdd', $link); + if($extraArguments) + $link = Controller::join_links ($link, $extraArguments); + return $link; } /** diff --git a/templates/Includes/CMSMain_TreeView.ss b/templates/Includes/CMSMain_TreeView.ss index 9c54d888..141c5c46 100644 --- a/templates/Includes/CMSMain_TreeView.ss +++ b/templates/Includes/CMSMain_TreeView.ss @@ -22,7 +22,7 @@ $ExtraTreeTools <% end_if %> -
+
$SiteTreeAsUL
diff --git a/templates/Includes/CMSPagesController_ContentToolActions.ss b/templates/Includes/CMSPagesController_ContentToolActions.ss index 62052846..da3eba41 100644 --- a/templates/Includes/CMSPagesController_ContentToolActions.ss +++ b/templates/Includes/CMSPagesController_ContentToolActions.ss @@ -1,5 +1,5 @@
- <% _t('CMSMain.AddNewButton', 'Add new') %> + <% _t('CMSMain.AddNewButton', 'Add new') %>