diff options
-rw-r--r-- | jquery_drawer.module | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/jquery_drawer.module b/jquery_drawer.module index 7283fcd..682e506 100644 --- a/jquery_drawer.module +++ b/jquery_drawer.module @@ -147,6 +147,12 @@ function theme_jquery_drawer($menu) { * Render all nodes whose terms are children of $tid. */ function jquery_drawer_get_children($tid = NULL) { + static $cache = array(); + + if (isset($cache[$tid])) { + return $cache[$tid]; + } + $vid = variable_get('jquery_drawer', '1'); $terms = taxonomy_node_tree_taxonomy_get_tree($vid, $tid); @@ -168,8 +174,11 @@ function jquery_drawer_get_children($tid = NULL) { $nodes = db_query(db_rewrite_sql($query), implode(',', $filter)); $tree = taxonomy_node_tree_build($nodes, $terms); + $cache[$tid] = $tree; return $tree; } + + $cache[$tid] = NULL; } /** |