From: Steve Sutton Date: Wed, 10 Feb 2010 16:48:35 +0000 (+0000) Subject: put the main nav into cache X-Git-Tag: v1.0.0~79 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=77c8398c2b037e3bb954001cd27a7e3283cbec78;p=web%2FTroutCreek.git put the main nav into cache --- diff --git a/admin/Toolbox/list_bus_category.phtml b/admin/Toolbox/list_bus_category.phtml index e0f927e..49a8e18 100755 --- a/admin/Toolbox/list_bus_category.phtml +++ b/admin/Toolbox/list_bus_category.phtml @@ -28,6 +28,7 @@ if(isset($active)) { $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"; diff --git a/admin/Toolbox/update_bus_category.phtml b/admin/Toolbox/update_bus_category.phtml index be87eb5..89df1c8 100755 --- a/admin/Toolbox/update_bus_category.phtml +++ b/admin/Toolbox/update_bus_category.phtml @@ -308,6 +308,7 @@ if ($REQUEST_METHOD == "POST" || $Command == "Move") { } // 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(); diff --git a/classes/class_template.inc b/classes/class_template.inc index 48a249a..ee71a56 100644 --- a/classes/class_template.inc +++ b/classes/class_template.inc @@ -997,27 +997,32 @@ class GLM_TEMPLATE } // }}} - // {{{ 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 = ''; + } + $this->cache->save($out, $topParent, 'MainNav'); + return $out; + } } // }}}