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

Diff of /contributions/modules/taxonomy_browser/taxonomy_browser.module

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

revision 1.19.2.11.2.19, Fri Jun 20 04:07:50 2008 UTC revision 1.19.2.11.2.20, Tue Jul 22 00:47:02 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: taxonomy_browser.module,v 1.19.2.11.2.18 2008/06/16 19:09:42 nancyw Exp $  // $Id: taxonomy_browser.module,v 1.19.2.11.2.19 2008/06/20 04:07:50 nancyw Exp $
3  // Original by Moshe Weitzman (weitzmna@tejasa.com)  // Original by Moshe Weitzman (weitzmna@tejasa.com)
4    
5  /**  /**
# Line 334  function taxonomy_browser_form() { Line 334  function taxonomy_browser_form() {
334      $voc = taxonomy_vocabulary_load($v);      $voc = taxonomy_vocabulary_load($v);
335    
336      $voc_node_types = array();      $voc_node_types = array();
337      foreach ($voc->nodes as $key => $type) {      if (isset($voc->nodes) && !empty($voc->nodes)) {
338        $voc_node_types[] = $node_types[$type];        foreach ($voc->nodes as $key => $type) {
339            $voc_node_types[] = $node_types[$type];
340          }
341        }
342        else {
343          drupal_set_message(t('The %name vocabulary does not appear to be associated with any content types.', array('%name' => $voc->name)), 'warning');
344      }      }
345    
346      $count_types = count($voc_node_types);      $count_types = count($voc_node_types);
347      if (count($voc_node_types) == 1) {      if (count($voc_node_types) == 1) {
348        $node_type_list = $voc_node_types[0];        $node_type_list = $voc_node_types[0];
# Line 366  function taxonomy_browser_form() { Line 372  function taxonomy_browser_form() {
372        }        }
373      }      }
374    
375      $vocname = filter_xss($voc->name);      $vocname = check_plain($voc->name);
376        $description = $voc->description ? decode_entities(check_markup($voc->description)) : null;
377        $description .= t('"!name" is used for: !types.', array('!name' => '<strong>'. $vocname .'</strong>', '!types' => (empty($node_type_list) ? '<em>'. t('nothing') .'</em>' : $node_type_list)));
378      if (!empty($term_opts)) {      if (!empty($term_opts)) {
379        $form['taxonomy'][$v] = array(        $form['taxonomy'][$v] = array(
380          '#type' => $select_type,          '#type' => $select_type,
381          '#title' => $vocname,          '#title' => $vocname,
382          '#options' => $term_opts,          '#options' => $term_opts,
383          '#multiple' => true,          '#multiple' => true,
384          '#description' => $voc->description          '#description' => $description,
            .' &nbsp;'. t('"!name" is used for: !types.', array('!name' => '<strong>'. $vocname .'</strong>', '!types' => $node_type_list)),  
385          '#size' => min(10, count($term_opts)),          '#size' => min(10, count($term_opts)),
386          '#prefix' => '<div class="taxonomy_browser_'. $select_type .'">',          '#prefix' => '<div class="taxonomy_browser_'. $select_type .'">',
387          '#suffix' => '</div>',          '#suffix' => '</div>',

Legend:
Removed from v.1.19.2.11.2.19  
changed lines
  Added in v.1.19.2.11.2.20

  ViewVC Help
Powered by ViewVC 1.1.2