From 4ac4b9abc82abeadd65130323e523fe03c31d42d Mon Sep 17 00:00:00 2001 From: Silvio Date: Tue, 23 Sep 2014 10:51:37 -0300 Subject: Print default text only if there's no child content --- jquery_drawer.module | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jquery_drawer.module b/jquery_drawer.module index 169a74b..c0481e0 100644 --- a/jquery_drawer.module +++ b/jquery_drawer.module @@ -229,6 +229,7 @@ function jquery_drawer_page($tid = NULL) { static $cache = array(); if (!isset($cache[$tid])) { + $found = NULL; $output = ''; $nodes = jquery_drawer_select_nodes($tid); $base = variable_get('jquery_drawer_link', 'node'); @@ -238,6 +239,7 @@ function jquery_drawer_page($tid = NULL) { // First render all nodes whose parent is $term while ($node = db_fetch_object($nodes)) { path_nodeapi($node,'load',''); + $found = TRUE; $link['title'] = $node->title; $link['href'] = ($node->path?$node->path:"$base/". $node->nid); $output .= theme('jquery_drawer_link', $link); @@ -246,10 +248,12 @@ function jquery_drawer_page($tid = NULL) { // Add other nodes if (is_array($tree) && !empty($tree)) { foreach ($tree as $term) { + $found = TRUE; $output .= theme('taxonomy_node_tree_list', $term, 'jquery_drawer', 'hidden', $base); } } - else { + + if ($found == NULL) { $output .= t('No content exists for this topic yet.'); } -- cgit v1.2.3