/[drupal]/contributions/modules/taxonomy_breadcrumb/taxonomy_breadcrumb.inc
ViewVC logotype

Diff of /contributions/modules/taxonomy_breadcrumb/taxonomy_breadcrumb.inc

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

revision 1.1, Mon Jan 12 02:19:26 2009 UTC revision 1.1.2.1, Fri Mar 13 16:46:03 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: $  // $Id: taxonomy_breadcrumb.inc,v 1.1 2009/01/12 02:19:26 mgn Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 15  Line 15 
15   */   */
16  function _taxonomy_breadcrumb_term_page($str_tids = '', $depth = 0, $op = 'page') {  function _taxonomy_breadcrumb_term_page($str_tids = '', $depth = 0, $op = 'page') {
17    // Include the .inc file with all helper functions    // Include the .inc file with all helper functions
18    require_once drupal_get_path('module', 'taxonomy') .'/taxonomy.pages.inc';    require_once(drupal_get_path('module', 'taxonomy') .'/taxonomy.pages.inc');
19    
20    // Call the core taxonomy_term_page function    // Call the core taxonomy_term_page function
21    $output = taxonomy_term_page($str_tids, $depth, $op);    $output = taxonomy_term_page($str_tids, $depth, $op);
# Line 84  function _taxonomy_breadcrumb_generate_b Line 84  function _taxonomy_breadcrumb_generate_b
84    $vocabulary_path = _taxonomy_breadcrumb_get_vocabulary_path($term->vid);    $vocabulary_path = _taxonomy_breadcrumb_get_vocabulary_path($term->vid);
85    if ($vocabulary_path != NULL) {    if ($vocabulary_path != NULL) {
86      $vocabulary = taxonomy_vocabulary_load($term->vid);      $vocabulary = taxonomy_vocabulary_load($term->vid);
87      $breadcrumb[] = l($vocabulary->name, $vocabulary_path);      $breadcrumb[] = l(_taxonomy_breadcrumb_tt("taxonomy:vocabulary:$term->tid:name", $vocabulary->name), $vocabulary_path);
88    }    }
89    
90    // TERM breadcrumb generation    // TERM breadcrumb generation
# Line 96  function _taxonomy_breadcrumb_generate_b Line 96  function _taxonomy_breadcrumb_generate_b
96      }      }
97      // Do not create links to own self if we are on a taxonomy/term page.      // Do not create links to own self if we are on a taxonomy/term page.
98      if ($is_term_page && $parent_term->tid == $tid) {      if ($is_term_page && $parent_term->tid == $tid) {
99        $breadcrumb[] = $parent_term->name;        $breadcrumb[] = _taxonomy_breadcrumb_tt("taxonomy:term:$parent_term->tid:name", $parent_term->name);
100      }      }
101      else {      else {
102        $breadcrumb[] = l($parent_term->name, $term_path);        $breadcrumb[] = l(_taxonomy_breadcrumb_tt("taxonomy:term:$parent_term->tid:name", $parent_term->name), $term_path);
103      }      }
104    }    }
105    
# Line 110  function _taxonomy_breadcrumb_generate_b Line 110  function _taxonomy_breadcrumb_generate_b
110    return $breadcrumb;    return $breadcrumb;
111    
112  }  }
113    
114    
115    /**
116     * Helper function for when i18ntaxonomy module is not installed.
117     */
118    
119    function _taxonomy_breadcrumb_tt($string_id, $default, $language = NULL) {
120    
121      return function_exists('tt') ? tt($string_id, $default, $language) : $default;
122    }

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

  ViewVC Help
Powered by ViewVC 1.1.2