aboutsummaryrefslogtreecommitdiff
path: root/jquery_drawer.module
diff options
context:
space:
mode:
Diffstat (limited to 'jquery_drawer.module')
-rw-r--r--jquery_drawer.module18
1 files changed, 13 insertions, 5 deletions
diff --git a/jquery_drawer.module b/jquery_drawer.module
index dc292a3..a01897a 100644
--- a/jquery_drawer.module
+++ b/jquery_drawer.module
@@ -122,6 +122,8 @@ function theme_jquery_drawer($menu) {
$output = '<ul id="drw_tabs">';
$output .= implode((array) module_invoke_all('jquery_drawer'));
+
+ $menu = i18ntaxonomy_localize_terms($menu);
foreach ($menu as $item) {
$link['title'] = $item->name;
@@ -152,8 +154,10 @@ function jquery_drawer_page($tid = NULL) {
// First render all nodes whose parent is $term
while ($node = db_fetch_object($nodes)) {
+ path_nodeapi($node,'load','');
$link['title'] = $node->title;
- $link['href'] = "$base/". $node->nid;
+ $link['href'] = ($node->path?$node->path:"$base/". $node->nid);
+ //$output .= print_r($node,1);
$output .= theme('jquery_drawer_link', $link);
}
@@ -167,11 +171,15 @@ function jquery_drawer_page($tid = NULL) {
if (isset($filter) && !empty($filter)) {
// Then render all nodes whose terms are children of $term
- $query = 'SELECT node.nid, node.title, term_node.tid FROM {node} LEFT JOIN
- {term_node} ON term_node.nid = node.nid WHERE term_node.tid IN (%s)
- AND node.status = "1"';
-
+ $query = 'SELECT n.nid, n.title, term_node.tid FROM {node} n LEFT JOIN
+ {term_node} ON term_node.nid = n.nid WHERE term_node.tid IN (%s)
+ AND n.status = "1" ORDER BY term_node.weight_in_tid ASC';
+
+ $query2 = db_rewrite_sql($query);
+
+
$nodes = db_query(db_rewrite_sql($query), implode(',', $filter));
+
$tree = taxonomy_node_tree_build($nodes, $terms);
// format output