public function getCurrentName(PageInfo $pageInfo) { $exampleList = CategoryInfo::getCategoryList($pageInfo->getCategory()); $currentExample = $pageInfo->getExample(); foreach ($exampleList as $exampleName => $exampleDefinition) { if (strcasecmp($currentExample, $exampleName) === 0) { return $exampleName; } } return null; }
public function renderVertical() { $output = "<ul class='nav nav-sidebar smallPadding' id='searchList'>"; $exampleList = CategoryInfo::getCategoryList($this->pageInfo->getCategory()); foreach ($exampleList as $exampleName => $exampleDefinition) { $imagickExample = $exampleName; //$imagickExampleOption->getName(); $active = ''; $activeLink = ''; if ($this->pageInfo->getExample() === $imagickExample) { $active = 'navActive'; $activeLink = 'navActiveLink'; } $name = $imagickExample; if (isset($exampleDefinition['name'])) { $name = $exampleDefinition['name']; } $output .= "<li class='navSpacer {$active}'>"; $output .= sprintf("<a class='smallPadding %s' href='/%s/%s'>%s</a>", $activeLink, $this->pageInfo->getCategory(), $imagickExample, $name); $output .= "</li>"; } $output .= "</ul>"; return $output; }