From 08c22fbbf26f547ac5bd2cbdfe5716e4f7175dab Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 13 Nov 2008 21:39:53 +0000 Subject: [PATCH] Added test demonstrating how to make a CMS section that exposes only a sub-tree --- code/control/CMSSubTreeAdmin.php | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 code/control/CMSSubTreeAdmin.php diff --git a/code/control/CMSSubTreeAdmin.php b/code/control/CMSSubTreeAdmin.php new file mode 100644 index 0000000..62d692d --- /dev/null +++ b/code/control/CMSSubTreeAdmin.php @@ -0,0 +1,34 @@ +write(); + } + + // This code is what you will need to do to make a subtree version of CMSMain + $this->generateDataTreeHints(); + $this->generateTreeStylingJS(); + + // blogRoot->ID is your root node + $siteTree = $this->getSiteTreeFor("SiteTree", $blogRoot->ID); + + // This code is copied from getSiteTreeFor(), because getSiteTreeFor has it hard-coded to only generate if rootID = 0 + $rootLink = $this->Link() . '0'; + if($this->hasMethod('getCMSTreeTitle')) $treeTitle = $this->getCMSTreeTitle(); + else $treeTitle = _t('LeftAndMain.SITECONTENTLEFT',"Site Content",PR_HIGH,'Root node on left'); + $siteTree = ""; + + return $siteTree; + } +} + +?> \ No newline at end of file