Mark submenu items with children as folders

Add an arrow to submenuitems that have undelying pages
This commit is contained in:
martimiz 2012-11-08 17:20:55 +01:00 committed by Will Rossiter
parent 5a29f0c9ba
commit 7e7b67548e
4 changed files with 29 additions and 2 deletions

View File

@ -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);
}
}

View File

@ -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

View File

@ -277,3 +277,6 @@ fieldset { border: none; }
background: linear-gradient(to bottom, #599BDC 1%,#3072B3 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#599BDC', endColorstr='#3072B3',GradientType=0 ); /* IE6-9 */
}
/* contains the arrow that marks a folder */
span.is-folder {float: right;}

View File

@ -8,7 +8,9 @@
<% if Children %>
<ul>
<% control Children %>
<li><a href="$Link" class="$LinkingMode">$Title</a>
<li><a href="$Link" class="$LinkingMode">
$Title <% if IsFolder %><span class="is-folder">&#9658;</span><% end_if %>
</a>
<% if Children %>
<ul>
<% control Children %>