$DB->db_exec($query);
GLM_TOOLBOX::create_sitemap();
$toolbox->cache->clean('Nav');
+ $toolbox->cache->clean('MainNav');
}
$toolbox_nav["Edit Positions"] = "list_bus_category.phtml?show_pos=1";
$toolbox_nav["Expand All"] = "list_bus_category.phtml?expand_all=1";
}
// remove the cache for this paragraphs
// cach_Toolbox_page-$ID
+$toolbox->cache->clean('MainNav');
$toolbox->cache->remove('page-' . $id, 'Toolbox');
$toolbox->cache->remove('paragraphs-' . $id, 'Toolbox');
//GLM_TOOLBOX::create_sitemap();
}
// }}}
- // {{{ get_main_nav()
+ // {{{ get_main_nav(
function get_main_nav($topParent)
{
- $query = "select id,category
- from bus_category
- where parent = 0
- and active = 't'
- order by pos";
- if ($data = $this->DB->pgsql_select( $query ) ){
- $out = '<ul>';
- foreach( $data as $row ){
- $out .= '<li><a ';
- if ($row['id'] == $topParent) {
- $out .= ' class="active"';
+ if ($navContent = $this->cache->get($topParent, 'MainNav')) {
+ return $navContent;
+ } else {
+ $query = "select id,category
+ from bus_category
+ where parent = 0
+ and active = 't'
+ order by pos";
+ if ($data = $this->DB->pgsql_select( $query ) ){
+ $out = '<ul>';
+ foreach( $data as $row ){
+ $out .= '<li><a ';
+ if ($row['id'] == $topParent) {
+ $out .= ' class="active"';
+ }
+ $out .= 'href="'.$this->get_seo_url( $row['id'] ).'">'.$row['category'].'</a></li>';
}
- $out .= 'href="'.$this->get_seo_url( $row['id'] ).'">'.$row['category'].'</a></li>';
- }
- $out .= '</ul>';
- }
- return $out;
+ $out .= '</ul>';
+ }
+ $this->cache->save($out, $topParent, 'MainNav');
+ return $out;
+ }
}
// }}}