From 7e7b67548e6a4b5823aded4293017eb42591bbca Mon Sep 17 00:00:00 2001 From: martimiz Date: Thu, 8 Nov 2012 17:20:55 +0100 Subject: [PATCH] Mark submenu items with children as folders Add an arrow to submenuitems that have undelying pages --- code/DocumentationService.php | 4 ++++ code/models/DocumentationPage.php | 18 ++++++++++++++++++ css/DocumentationViewer.css | 5 ++++- templates/Includes/DocInThisModule.ss | 4 +++- 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/code/DocumentationService.php b/code/DocumentationService.php index 4b334d4..da9d027 100755 --- a/code/DocumentationService.php +++ b/code/DocumentationService.php @@ -494,6 +494,10 @@ class DocumentationService { $page->setVersion($version); $page->setLang($lang); + // does this page act as a folder? + $path = $page->getPath(); + if (is_dir($path)) { $page->setIsFolder(true); } + $output->push($page); } } diff --git a/code/models/DocumentationPage.php b/code/models/DocumentationPage.php index 6e8f3e6..390cdf2 100755 --- a/code/models/DocumentationPage.php +++ b/code/models/DocumentationPage.php @@ -37,6 +37,24 @@ class DocumentationPage extends ViewableData { */ protected $version; + /** + * @var Boolean + */ + protected $IsFolder = false; + + /** + * @param Boolean + */ + function setIsFolder($isFolder = false) { + $this->IsFolder = $isFolder; + } + + /** + * @return Boolean + */ + function getIsFolder($isFolder = false) { + return $this->IsFolder; + } /** * @return DocumentationEntity diff --git a/css/DocumentationViewer.css b/css/DocumentationViewer.css index fdcf45e..e9db69f 100644 --- a/css/DocumentationViewer.css +++ b/css/DocumentationViewer.css @@ -276,4 +276,7 @@ fieldset { border: none; } background: -ms-linear-gradient(top, #599BDC 1%,#3072B3 100%); /* IE10+ */ background: linear-gradient(to bottom, #599BDC 1%,#3072B3 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#599BDC', endColorstr='#3072B3',GradientType=0 ); /* IE6-9 */ - } \ No newline at end of file + } + +/* contains the arrow that marks a folder */ +span.is-folder {float: right;} \ No newline at end of file diff --git a/templates/Includes/DocInThisModule.ss b/templates/Includes/DocInThisModule.ss index 4167d3c..5151b65 100755 --- a/templates/Includes/DocInThisModule.ss +++ b/templates/Includes/DocInThisModule.ss @@ -8,7 +8,9 @@ <% if Children %>