Index: faq.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/faq/faq.css,v
retrieving revision 1.1.2.7
diff -u -r1.1.2.7 faq.css
--- faq.css 2 Oct 2007 10:34:59 -0000 1.1.2.7
+++ faq.css 2 Nov 2007 14:25:23 -0000
@@ -30,3 +30,8 @@
.faq_dl_hide_answer {
padding-bottom: 15px;
}
+
+img.faq_tax_image {
+ float: left;
+ padding: 0px 3px 0px 3px;
+}
Index: faq.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/faq/faq.module,v
retrieving revision 1.1.4.63.2.2
diff -u -r1.1.4.63.2.2 faq.module
--- faq.module 30 Oct 2007 15:28:00 -0000 1.1.4.63.2.2
+++ faq.module 2 Nov 2007 14:25:27 -0000
@@ -881,32 +881,38 @@
}
}
+ // get taxonomy image
+ $term_img = '';
+ if (module_exists('taxonomy_image') && user_access('access taxonomy images')) {
+ $term_img = taxonomy_image_display($term->tid, 'class="faq_tax_image"');
+ }
+
// configure header
$hdr = "h5";
if ($term->depth > 0) $hdr = "h6";
+ $header = "<$hdr class=\"faq_header\">";
+ $header .= $term_img;
if ($display_vars['category_display'] == 'hide_qa') {
- $header = "<$hdr class=\"faq_header\">";
$header .= l($term->name, "faq/$term->tid");
- if ($display_vars['faq_count']) $header .= " (%%FAQ_COUNT%%)";
- $header .= "$hdr>\n";
- $ans_hdr = "<$hdr class=\"faq_header\">";
- $ans_hdr .= check_plain($term->name) ."$hdr>\n";
}
else {
- $header = "<$hdr class=\"faq_header\">";
$header .= check_plain($term->name);
- if ($display_vars['faq_count']) $header .= " (%%FAQ_COUNT%%)";
- $header .= "$hdr>\n";
- $ans_hdr = "<$hdr class=\"faq_header\">";
- $ans_hdr .= check_plain($term->name) ."$hdr>\n";
}
+ if ($display_vars['faq_count']) $header .= " (%%FAQ_COUNT%%)";
+ $header .= "$hdr>\n";
+ $ans_hdr = "<$hdr class=\"faq_header\">";
+ $ans_hdr .= $term_img;
+ $ans_hdr .= check_plain($term->name) ."$hdr>\n";
+ $ans_hdr .= '
';
+ // configure category description
$answer_category_name = variable_get('faq_answer_category_name', FALSE);
$desc = '';
if (!empty($term->description)) {
$desc = '';
$desc .= $term->description ."
\n";
}
+ $desc .= '';
// get list of sub-categories if necessary
$sub_cats = '';
@@ -917,19 +923,32 @@
foreach ($list as $tid => $sub_term) {
$sub_count = taxonomy_term_count_nodes($sub_term->tid, 'faq');
if ($sub_count) {
+
+ // configure sub cat description
$sub_cat_desc = '';
if (!empty($sub_term->description)) {
$sub_cat_desc = '';
$sub_cat_desc .= $sub_term->description ."
";
}
- // get number of questions, and account for hidden sub-cats
+
+ // get taxonomy image
+ $sub_term_img = '';
+ if (module_exists('taxonomy_image') && user_access('access taxonomy images')) {
+ $sub_term_img = taxonomy_image_display($sub_term->tid, 'class="faq_tax_image"');
+ }
+
+ // configure sub cat header
if ($display_vars['faq_count']) {
- $scats[] = l($sub_term->name, "faq/$sub_term->tid")
+ $scats_hdr = $sub_term_img . l($sub_term->name, "faq/$sub_term->tid")
." ($sub_count) $sub_cat_desc";
+ $scats_hdr .= '';
}
else {
- $scats[] = l($sub_term->name, "faq/$sub_term->tid") . $sub_cat_desc;
+ $scats_hdr = $sub_term_img . l($sub_term->name, "faq/$sub_term->tid") . $sub_cat_desc;
+ $scats_hdr .= '';
}
+
+ $scats[] = $scats_hdr;
}
}
$list_style = variable_get('faq_category_listing', 'ul');
@@ -942,7 +961,7 @@
$output .= '\n";
}
else {
- $output .= '\n";
+ $output .= '\n";
}
$output .= $sub_cats;
$sub_cats = '';
@@ -1127,27 +1146,34 @@
}
}
+ // get taxonomy image
+ $term_img = '';
+ if (module_exists('taxonomy_image') && user_access('access taxonomy images')) {
+ $term_img = taxonomy_image_display($term->tid, 'class="faq_tax_image"');
+ }
+
// configure header
$hdr = "h5";
if ($term->depth > 0) $hdr = "h6";
+ $header = "<$hdr class=\"faq_header\">";
+ $header .= $term_img;
if ($display_vars['category_display'] == 'hide_qa') {
- $header = "<$hdr class=\"faq_header\">";
$header .= l($term->name, "faq/$term->tid");
- if ($display_vars['faq_count']) $header .= " (%%FAQ_COUNT%%)";
- $header .= "$hdr>\n";
}
else {
- $header = "<$hdr class=\"faq_header\">";
$header .= check_plain($term->name);
- if ($display_vars['faq_count']) $header .= " (%%FAQ_COUNT%%)";
- $header .= "$hdr>\n";
}
+ if ($display_vars['faq_count']) $header .= " (%%FAQ_COUNT%%)";
+ $header .= "$hdr>\n";
+
+ // configure category description
$desc = '';
if (!empty($term->description)) {
$desc = '';
$desc .= $term->description ."
\n";
}
+ $desc .= '';
// get list of sub-categories if necessary
$sub_cats = '';
@@ -1158,18 +1184,31 @@
foreach ($list as $tid => $sub_term) {
$sub_count = taxonomy_term_count_nodes($sub_term->tid, 'faq');
if ($sub_count) {
+
+ // configure sub cat description
$sub_cat_desc = '';
if (!empty($sub_term->description)) {
$sub_cat_desc = '';
$sub_cat_desc .= $sub_term->description ."
";
}
+
+ // get taxonomy image
+ $sub_term_img = '';
+ if (module_exists('taxonomy_image') && user_access('access taxonomy images')) {
+ $sub_term_img = taxonomy_image_display($sub_term->tid, 'class="faq_tax_image"');
+ }
+
+ // configure sub cat header
if ($display_vars['faq_count']) {
- $scats[] = l($sub_term->name, "faq/$sub_term->tid")
- ." ($sub_count) $sub_cat_desc";
+ $scats_hdr = $sub_term_img . l($sub_term->name, "faq/$sub_term->tid") ." ($sub_count) $sub_cat_desc";
+ $scats_hdr .= '';
}
else {
- $scats[] = l($sub_term->name, "faq/$sub_term->tid") . $sub_cat_desc;
+ $scats_hdr = $sub_term_img . l($sub_term->name, "faq/$sub_term->tid") . $sub_cat_desc;
+ $scats_hdr .= '';
}
+
+ $scats[] = $scats_hdr;
}
}
$list_style = variable_get('faq_category_listing', 'ul');
@@ -1182,7 +1221,7 @@
$output .= '\n";
}
else {
- $output .= '\n";
+ $output .= '\n";
}
$output .= $sub_cats;
$sub_cats = '';
@@ -1330,21 +1369,25 @@
}
}
+ // get taxonomy image
+ $term_img = '';
+ if (module_exists('taxonomy_image') && user_access('access taxonomy images')) {
+ $term_img = taxonomy_image_display($term->tid, 'class="faq_tax_image"');
+ }
+
// configure header
$hdr = "h5";
if ($term->depth > 0) $hdr = "h6";
+ $header = "<$hdr class=\"faq_header\">";
+ $header .= $term_img;
if ($display_vars['category_display'] == 'hide_qa') {
- $header = "<$hdr class=\"faq_header\">";
$header .= l($term->name, "faq/$term->tid");
- if ($display_vars['faq_count']) $header .= " (%%FAQ_COUNT%%)";
- $header .= "$hdr>\n";
}
else {
- $header = "<$hdr class=\"faq_header\">";
$header .= check_plain($term->name);
- if ($display_vars['faq_count']) $header .= " (%%FAQ_COUNT%%)";
- $header .= "$hdr>\n";
}
+ if ($display_vars['faq_count']) $header .= " (%%FAQ_COUNT%%)";
+ $header .= "$hdr>\n";
// configure category description
$desc = '';
@@ -1352,6 +1395,7 @@
$desc = '';
$desc .= $term->description ."
\n";
}
+ $desc .= '';
// get list of sub-categories if necessary
@@ -1363,18 +1407,30 @@
foreach ($list as $tid => $sub_term) {
$sub_count = taxonomy_term_count_nodes($sub_term->tid, 'faq');
if ($sub_count) {
+ // configure sub cat description
$sub_cat_desc = '';
if (!empty($sub_term->description)) {
$sub_cat_desc = '';
$sub_cat_desc .= $sub_term->description ."
";
}
+
+ // get taxonomy image
+ $sub_term_img = '';
+ if (module_exists('taxonomy_image') && user_access('access taxonomy images')) {
+ $sub_term_img = taxonomy_image_display($sub_term->tid, 'class="faq_tax_image"');
+ }
+
+ // configure sub cat header
if ($display_vars['faq_count']) {
- $scats[] = l($sub_term->name, "faq/$sub_term->tid")
- ." ($sub_count) $sub_cat_desc";
+ $scats_hdr = $sub_term_img . l($sub_term->name, "faq/$sub_term->tid") ." ($sub_count) $sub_cat_desc";
+ $scats_hdr .= '';
}
else {
- $scats[] = l($sub_term->name, "faq/$sub_term->tid") . $sub_cat_desc;
+ $scats_hdr = $sub_term_img . l($sub_term->name, "faq/$sub_term->tid") . $sub_cat_desc;
+ $scats_hdr .= '';
}
+
+ $scats[] = $scats_hdr;
}
}
$list_style = variable_get('faq_category_listing', 'ul');
@@ -1388,7 +1444,7 @@
$output .= '\n";
}
else {
- $output .= '\n";
+ $output .= '\n";
}
$output .= $sub_cats;
$sub_cats = '';
@@ -1488,27 +1544,33 @@
}
}
+ // get taxonomy image
+ $term_img = '';
+ if (module_exists('taxonomy_image') && user_access('access taxonomy images')) {
+ $term_img = taxonomy_image_display($term->tid, 'class="faq_tax_image"');
+ }
+
// configure header
$hdr = "h5";
if ($term->depth > 0) $hdr = "h6";
+ $header = "<$hdr class=\"faq_header\">";
+ $header .= $term_img;
if ($display_vars['category_display'] == 'hide_qa') {
- $header = "<$hdr class=\"faq_header\">";
$header .= l($term->name, "faq/$term->tid");
- if ($display_vars['faq_count']) $header .= " (%%FAQ_COUNT%%)";
- $header .= "$hdr>\n";
}
else {
- $header = "<$hdr class=\"faq_header\">";
$header .= check_plain($term->name);
- if ($display_vars['faq_count']) $header .= " (%%FAQ_COUNT%%)";
- $header .= "$hdr>\n";
}
+ if ($display_vars['faq_count']) $header .= " (%%FAQ_COUNT%%)";
+ $header .= "$hdr>\n";
+ // configure category description
$desc = '';
if (!empty($term->description)) {
$desc = '';
$desc .= $term->description ."
\n";
}
+ $desc .= '';
// get list of sub-categories if necessary
$sub_cats = '';
@@ -1519,18 +1581,31 @@
foreach ($list as $tid => $sub_term) {
$sub_count = taxonomy_term_count_nodes($sub_term->tid, 'faq');
if ($sub_count) {
+
+ // configure sub cat description
$sub_cat_desc = '';
if (!empty($sub_term->description)) {
$sub_cat_desc = '';
$sub_cat_desc .= $sub_term->description ."
";
}
+
+ // get taxonomy image
+ $sub_term_img = '';
+ if (module_exists('taxonomy_image') && user_access('access taxonomy images')) {
+ $sub_term_img = taxonomy_image_display($sub_term->tid, 'class="faq_tax_image"');
+ }
+
+ // configure sub cat header
if ($display_vars['faq_count']) {
- $scats[] = l($sub_term->name, "faq/$sub_term->tid")
- ." ($sub_count) $sub_cat_desc";
+ $scats_hdr = $sub_term_img . l($sub_term->name, "faq/$sub_term->tid") ." ($sub_count) $sub_cat_desc";
+ $scats_hdr .= '';
}
else {
- $scats[] = l($sub_term->name, "faq/$sub_term->tid") . $sub_cat_desc;
+ $scats_hdr = $sub_term_img . l($sub_term->name, "faq/$sub_term->tid") . $sub_cat_desc;
+ $scats_hdr .= '';
}
+
+ $scats[] = $scats_hdr;
}
}
$list_style = variable_get('faq_category_listing', 'ul');
@@ -1543,7 +1618,7 @@
$output .= '\n";
}
else {
- $output .= '\n";
+ $output .= '\n";
}
$output .= $sub_cats;
$sub_cats = '';
@@ -1738,6 +1813,12 @@
$tree_count = taxonomy_term_count_nodes($term->tid, 'faq');
if ($tree_count) {
+ // get taxonomy image
+ $term_img = '';
+ if (module_exists('taxonomy_image') && user_access('access taxonomy images')) {
+ $term_img = taxonomy_image_display($term->tid, 'class="faq_tax_image"');
+ }
+
// get term description
$desc = '';
if (!empty($term->description)) {
@@ -1755,15 +1836,16 @@
if ($display_vars['hide_sub_categories']) {
$count = $tree_count;
}
- $cur_item = l($term->name, "faq/$term->tid") ." ($count) ". $desc;
+ $cur_item = $term_img . l($term->name, "faq/$term->tid") ." ($count) ". $desc;
}
else {
- $cur_item = l($term->name, "faq/$term->tid") . $desc;
+ $cur_item = $term_img . l($term->name, "faq/$term->tid") . $desc;
}
}
else {
- $cur_item = check_plain($term->name) . $desc;
+ $cur_item = $term_img . check_plain($term->name) . $desc;
}
+ $cur_item .= '';
if (!$display_vars['hide_sub_categories']) {
$term_items = _get_indented_faq_terms($vid, $term->tid, $display_vars);