From c4a99dfc095d85ec639d7e9523a2cf683c6cbcbb Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 4 Jul 2011 16:09:07 +0200 Subject: [PATCH] MINOR Redirecting page links in CMSPagesController to CMSPageEditController (admin/pages/show/99 to admin/page/show/99) --- code/controller/CMSPagesController.php | 9 +++++++++ javascript/CMSPagesController.Tree.js | 7 ------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/code/controller/CMSPagesController.php b/code/controller/CMSPagesController.php index 60db51bb..db7e66b0 100644 --- a/code/controller/CMSPagesController.php +++ b/code/controller/CMSPagesController.php @@ -21,4 +21,13 @@ class CMSPagesController extends CMSMain { } } + function Link($action = null) { + // Special case: All show links should redirect to the page edit interface instead (mostly from tree nodes) + if(preg_match('/^show/', $action)) { + return singleton('CMSPageEditController')->Link($action); + } else { + return parent::Link($action); + } + } + } \ No newline at end of file diff --git a/javascript/CMSPagesController.Tree.js b/javascript/CMSPagesController.Tree.js index 3aeca1d9..e69de29b 100644 --- a/javascript/CMSPagesController.Tree.js +++ b/javascript/CMSPagesController.Tree.js @@ -1,7 +0,0 @@ -(function($) { - $('.cms-tree').bind('select_node.jstree', function(e, data) { - var node = data.rslt.obj, url = $(node).find('a:first').attr('href'); - if(url && url != '#') document.location.href = url; - return false; - }); -}(jQuery)); \ No newline at end of file