// }}}
// {{{ get_main_nav()
- function get_main_nav()
+ function get_main_nav($topParent)
{
$query = "select id,category
from bus_category
where parent = 0
- and id not in (".HOME_ID.",".MEMBERS_CATEGORY.",7,8,9)
+ and id not in (".HOME_ID.",".MEMBERS_CATEGORY.")
and active = 't'
order by pos";
if ($data = $this->DB->pgsql_select( $query ) ){
- $out = '<ul id="nav">';
+ $out = '<ul>';
foreach( $data as $row ){
- $out .= '<li><a href="'.$this->get_seo_url( $row['id'] ).'">'.$row['category'].'</a></li>';
+ $out .= '<li><a ';
+ if ($row['id'] == $topParent) {
+ $out .= ' class="active"';
+ }
+ $out .= 'href="'.$this->get_seo_url( $row['id'] ).'">'.$row['category'].'</a></li>';
}
$out .= '</ul>';
}
$isPage = $this->catid == $row['id'];
if ($hasSubs && ($isSubId || $isPage)) {
- $ret2 = $this->make_ul_menu($row['id']);
+ $ret2 = $this->get_side_nav($row['id']);
$return .= $ret2;
}
$return .= '</li>';
}
$main_cats = $this->get_main_cats();
- if ($main_cats[$parent]) {
- $return = '<h2>'.$this->get_catheader($parent, &$this->DB).'</h2>
- <ul>'.$return.'</ul>';
- $this->cache->save($return, $this->catid, 'Nav');
- return $return;
+ if ($return) {
+ if ($main_cats[$parent]) {
+ $return = '
+ <ul id="sublevel">'.$return.'</ul>';
+ $this->cache->save($return, $this->catid, 'Nav');
+ return $return;
+ } else {
+ $return = "\n<ul>$return</ul>\n";
+ return $return;
+ }
} else {
- $return = "\n<ul>$return</ul>\n";
- return $return;
+ return false;
}
}
}