protected function _getCategoryList($categories, $depth = 3, $current = 1, $count = false, $options = array())
{
if ($depth < $current) {
return '';
}
if ($categories) {
$out = '<ul class="depth-' . $current . '">';
$current++;
foreach ($categories as $category) {
if ($count && isset($category['BlogCategory']['count'])) {
$category['BlogCategory']['title'] .= '(' . $category['BlogCategory']['count'] . ')';
}
$url = $this->getCategoryUrl($category['BlogCategory']['id']);
$url = preg_replace('/^\\//', '', $url);
if ($this->_View->request->url == $url) {
$class = ' class="current"';
} elseif (!empty($this->_View->params['named']['category']) && $this->_View->params['named']['category'] == $category['BlogCategory']['name']) {
$class = ' class="selected"';
} else {
$class = '';
}
$out .= '<li' . $class . '>' . $this->getCategory($category, $options);
if (!empty($category['BlogCategory']['children'])) {
$out .= $this->_getCategoryList($category['BlogCategory']['children'], $depth, $current, $count, $options);
}
$out .= '</li>';
}
$out .= '</ul>';
return $out;
} else {
return '';
}
}