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

Diff of /contributions/modules/taxonomy_hide/taxonomy_hide.inc

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

revision 1.1.2.3, Mon Oct 27 15:07:50 2008 UTC revision 1.1.2.4, Mon Oct 27 23:33:00 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: taxonomy_hide.inc,v 1.1.2.2 2008/10/27 14:32:21 brmassa Exp $  // $Id: taxonomy_hide.inc,v 1.1.2.3 2008/10/27 15:07:50 brmassa Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 43  function _taxonomy_hide_nodeapi(&$node, Line 43  function _taxonomy_hide_nodeapi(&$node,
43  function _taxonomy_hide_sort($a, $b) {  function _taxonomy_hide_sort($a, $b) {
44    // Cache the extra vocabulary information (we need the vocabulary weight)    // Cache the extra vocabulary information (we need the vocabulary weight)
45    static $vocs = array();    static $vocs = array();
46    if (!array_key_exists($a->vid, $vocs)) {    if (!empty($vocs[$a->vid])) {
47      $vocs[$a->vid] = taxonomy_vocabulary_load($a->vid);      $vocs[$a->vid] = taxonomy_vocabulary_load($a->vid);
48    }    }
49    if (!array_key_exists($b->vid, $vocs)) {    if (!empty($vocs[$b->vid])) {
50      $vocs[$b->vid] = taxonomy_vocabulary_load($b->vid);      $vocs[$b->vid] = taxonomy_vocabulary_load($b->vid);
51    }    }
52    
# Line 71  function _taxonomy_hide_sort($a, $b) { Line 71  function _taxonomy_hide_sort($a, $b) {
71    elseif ($a->weight > $b->weight) {    elseif ($a->weight > $b->weight) {
72      return 1;      return 1;
73    }    }
74    elseif (strcasecmp($a->name, $b->name)) {    elseif ($string = strcasecmp($a->name, $b->name)) {
75      return strcasecmp($a->name, $b->name);      return $string;
76    }    }
77    elseif ($a->tid < $b->tid) {    elseif ($a->tid < $b->tid) {
78      return -1;      return -1;

Legend:
Removed from v.1.1.2.3  
changed lines
  Added in v.1.1.2.4

  ViewVC Help
Powered by ViewVC 1.1.2