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

Diff of /contributions/modules/related_terms/related_terms.module

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

revision 1.1, Wed Aug 6 11:54:39 2008 UTC revision 1.1.4.1, Mon Jan 19 15:12:59 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2    // $Id$
3    
4  /**  /**
5   * Implementation of hook_block().   * Implementation of hook_block().
# Line 6  Line 7 
7  function related_terms_block($op = 'list', $delta = 0, $edit = array()) {  function related_terms_block($op = 'list', $delta = 0, $edit = array()) {
8    
9    $blocks = array(    $blocks = array(
10      array('info' => t('Related terms'))      array(
11          'info' => t('Related terms'),
12          'cache' => BLOCK_CACHE_PER_PAGE
13        )
14    );    );
15    
16    switch ($op) {    switch ($op) {
# Line 88  function related_terms_block($op = 'list Line 92  function related_terms_block($op = 'list
92    }    }
93  }  }
94    
95  function theme_related_terms_block($terms) {  /**
96     * Implementation of hook_theme().
97     */
98    function related_terms_theme($existing, $type, $theme, $path) {
99      return array(
100        'related_terms_block' => array(
101          'arguments' => array('terms' => array())
102        ),
103      );
104    }
105    
106    function theme_related_terms_block($terms = array()) {
107    $output = '';    $output = '';
108    foreach($terms as $term) {    foreach($terms as $term) {
109      $output .= sprintf(      $output .= sprintf(
# Line 105  function theme_related_terms_block($term Line 120  function theme_related_terms_block($term
120    
121  // $sort can be name, shuffle, frequence  // $sort can be name, shuffle, frequence
122  function related_terms_get_related_terms($tid, $limit = 0, $sort = 'name', $vids = array()) {  function related_terms_get_related_terms($tid, $limit = 0, $sort = 'name', $vids = array()) {
123    
124    $restrict_vids = '';    $restrict_vids = '';
125    if(count($vids) > 0) {    if(count($vids) > 0) {
126      $restrict_vids = ' AND td2.vid IN (' . implode(',',$vids) . ') ';      $restrict_vids = ' AND td2.vid IN (' . implode(',',$vids) . ') ';

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.4.1

  ViewVC Help
Powered by ViewVC 1.1.2