/[drupal]/contributions/modules/taxonomy_block/taxonomy_block.module
ViewVC logotype

Diff of /contributions/modules/taxonomy_block/taxonomy_block.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.20, Tue Jun 23 17:56:53 2009 UTC revision 1.21, Tue Jun 23 19:16:37 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: taxonomy_block.module,v 1.19 2009/06/23 17:04:09 thenicespider Exp $  // $Id: taxonomy_block.module,v 1.20 2009/06/23 17:56:53 thenicespider Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 12  Line 12 
12  function taxonomy_block_help($section) {  function taxonomy_block_help($section) {
13    switch ($section) {    switch ($section) {
14      case 'admin/help#taxonomy_block':      case 'admin/help#taxonomy_block':
15        $output = "The taxonomy_block module used for displaying taxonomy in a block with 18n/multi-languages support";        $output = "The taxonomy_block module used for displaying taxonomy in a block with i18n/multi-languages support";
16          return $output;          return $output;
17      case 'admin/modules#description':      case 'admin/modules#description':
18        return 'The taxonomy_block module used for displaying taxonomy in a block with 18n/multi-languages support';        return 'The taxonomy_block module used for displaying taxonomy in a block with i18n/multi-languages support';
19    }    }
20  }  }
21    
# Line 34  function taxonomy_block_menu() { Line 34  function taxonomy_block_menu() {
34    $items = array();    $items = array();
35    
36    $items['admin/settings/taxonomy_block'] = array(    $items['admin/settings/taxonomy_block'] = array(
37      'title' => 'Taxonomy Block i18n',      'title' => 'Taxonomy Block',
38      'description' => 'Show taxonomy in block with i18n support',      'description' => 'Show taxonomy in a block with i18n support',
39      'access arguments' => array('administer taxonomy_block'),      'access arguments' => array('administer taxonomy_block'),
40      'page callback' => 'drupal_get_form',      'page callback' => 'drupal_get_form',
41      'page arguments' => array('taxonomy_block_admin_settings'),      'page arguments' => array('taxonomy_block_admin_settings'),
# Line 53  function taxonomy_block_menu() { Line 53  function taxonomy_block_menu() {
53  function taxonomy_block_block($op = 'list', $delta = 0) {  function taxonomy_block_block($op = 'list', $delta = 0) {
54    if ($op == 'list')    if ($op == 'list')
55    {    {
56      $blocks[0]['info'] = 'Taxonomy Block i18n';      $blocks[0]['info'] = 'Taxonomy Block';
57          return $blocks;          return $blocks;
58    }    }
59    
# Line 65  function taxonomy_block_block($op = 'lis Line 65  function taxonomy_block_block($op = 'lis
65    
66      switch($delta) {      switch($delta) {
67        case 0:        case 0:
68          $block['subject'] = 'Taxonomy Block i18n';          $block['subject'] = 'Taxonomy Block';
69    
70          $output  = '';          $output  = '';
71    
# Line 85  function taxonomy_block_block($op = 'lis Line 85  function taxonomy_block_block($op = 'lis
85          $output .= "<li>";          $output .= "<li>";
86          $output .= l(tt("taxonomy:term:$tid_parent:name", $name_parent), "taxonomy/term/$tid_parent");          $output .= l(tt("taxonomy:term:$tid_parent:name", $name_parent), "taxonomy/term/$tid_parent");
87          if ($node_count) {          if ($node_count) {
88            $count = db_result(db_query("SELECT COUNT(nid) FROM {term_node} WHERE tid = %d", $tid_parent));            $total_parent = db_result(db_query("SELECT COUNT(nid) FROM {term_node} WHERE tid = %d", $tid_parent));
89            $output .= " ($count)";            $output .= " ($total_parent)";
90          }          }
91          $output .= "</li>";          $output .= "</li>";
92    
# Line 108  function taxonomy_block_block($op = 'lis Line 108  function taxonomy_block_block($op = 'lis
108    
109              $output .= "<li>";              $output .= "<li>";
110              $output .= l(tt("taxonomy:term:$tid_child:name", $name_child), "taxonomy/term/$tid_child");              $output .= l(tt("taxonomy:term:$tid_child:name", $name_child), "taxonomy/term/$tid_child");
111                if ($node_count) {
112                  $total_child = db_result(db_query("SELECT COUNT(nid) FROM {term_node} WHERE tid = %d", $tid_child));
113                  $output .= " ($total_child)";
114                }
115              $output .= "</li>";              $output .= "</li>";
116            }            }
117            $output .= "</ul>";            $output .= "</ul>";

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

  ViewVC Help
Powered by ViewVC 1.1.2