aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2012-02-01 17:36:20 -0200
committerSilvio <silvio@devlet.com.br>2012-02-01 17:36:20 -0200
commit3339a456cc9a88ba054cfe3f9ebc66ba1e5cc8c7 (patch)
tree481f5a980b45c2b19dff34e46030d3066609606f
parentc57547d2f576836d6452d79d12770d52fc01bedd (diff)
downloadjquery_drawer-3339a456cc9a88ba054cfe3f9ebc66ba1e5cc8c7.tar.gz
jquery_drawer-3339a456cc9a88ba054cfe3f9ebc66ba1e5cc8c7.tar.bz2
Syncing with svn
-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