$reg = sprintf('#^%s#i', $category->getFullPath()); if ($current && preg_match($reg, $current->getFullPath())) { $children = true; $classes[] = 'children'; } ?> <li class="<?php echo implode(' ', $classes); ?> "> <?php echo $link; // display sub categories? if ($children) { $subCategories = new Object_ProductCategory_List(); $subCategories->setCondition('o_parentId = ?', $category->getId()); $printCategories($subCategories, $level + 1); } ?> </li> <?php } ?> </ul> <?php }; // print root categorys $printCategories(Website_ShopCategory::getTopLevelCategories(), 0); ?> </div>
if ($shopDocument) { ?> <li> <a href="<?php echo $shopDocument; ?> "><?php echo $shopDocument->getName(); ?> </a> <ul> <?php foreach (Website_ShopCategory::getTopLevelCategories() as $category) { ?> <li> <a href="<?php echo $this->url(array("country" => $this->language, "name" => $category->getNavigationPath(), "category" => $category->getId()), "shop-category-listing"); ?> "> <?php echo $category->getName(); ?> </a> </li> <?php } ?> </ul>