/[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.22, Thu Sep 25 20:43:33 2008 UTC revision 1.19.2.11.2.23, Sat Feb 7 02:20:02 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: taxonomy_browser.module,v 1.19.2.11.2.21 2008/08/14 14:27:30 nancyw Exp $  // $Id: taxonomy_browser.module,v 1.19.2.11.2.22 2008/09/25 20:43:33 nancyw Exp $
3  // Original by Moshe Weitzman (weitzmna@tejasa.com)  // Original by Moshe Weitzman (weitzmna@tejasa.com)
4    
5  /**  /**
# Line 132  function taxonomy_browser_admin_settings Line 132  function taxonomy_browser_admin_settings
132    
133    $form['taxonomy_browser_collapse'] = array(    $form['taxonomy_browser_collapse'] = array(
134      '#title' => t('Make vocabularies collapsible'),      '#title' => t('Make vocabularies collapsible'),
135      '#type' => 'checkbox',      '#type' => 'radios',
136      '#default_value' => variable_get('taxonomy_browser_collapse', FALSE),      '#options' => array('Not collapsible', 'Collapsed by default', 'Collapsible, but not collapsed'),
137        '#default_value' => variable_get('taxonomy_browser_collapse', 0),
138      '#description' => t('Do you want to display of the terms within a vocabulary to be collapsible? Requires "Check boxes" above.'),      '#description' => t('Do you want to display of the terms within a vocabulary to be collapsible? Requires "Check boxes" above.'),
139        '#prefix' => '<div class="taxonomy_browser_radios">',
140        '#suffix' => '</div>',
141      );      );
142    
143    $form['taxonomy_browser_default_op'] = array(    $form['taxonomy_browser_default_op'] = array(
# Line 219  function taxonomy_browser_admin_settings Line 222  function taxonomy_browser_admin_settings
222      && $form_state['values']['taxonomy_browser_show_unused'] == TRUE) {      && $form_state['values']['taxonomy_browser_show_unused'] == TRUE) {
223      form_set_error('taxonomy_browser_show_unused', t('"Show unused" requires "count nodes."'));      form_set_error('taxonomy_browser_show_unused', t('"Show unused" requires "count nodes."'));
224    }    }
225      if ($form_state['values']['taxonomy_browser_collapse'] != 0
226        && $form_state['values']['taxonomy_browser_select_type'] != 1) {
227        form_set_error('taxonomy_browser_collapse', t('"Make vocabularies collapsible" requires "Check boxes."'));
228      }
229  }  }
230    
231  //********************************************************************  //********************************************************************
# Line 238  function taxonomy_browser_form() { Line 245  function taxonomy_browser_form() {
245    $form = array();    $form = array();
246    $selection_types = array('select', 'checkboxes');    $selection_types = array('select', 'checkboxes');
247    $select_type = $selection_types[variable_get('taxonomy_browser_select_type', 1)];    $select_type = $selection_types[variable_get('taxonomy_browser_select_type', 1)];
248    $collapsible = variable_get('taxonomy_browser_collapse', FALSE) && ($select_type == 'checkboxes');    $collapsible = variable_get('taxonomy_browser_collapse', 0);
249    $count_nodes = variable_get('taxonomy_browser_count_nodes', FALSE);    $count_nodes = variable_get('taxonomy_browser_count_nodes', FALSE);
250    $show_unused = variable_get('taxonomy_browser_show_unused', FALSE);    $show_unused = variable_get('taxonomy_browser_show_unused', FALSE);
251    $allow_children = variable_get('taxonomy_browser_allow_children', FALSE);    $allow_children = variable_get('taxonomy_browser_allow_children', FALSE);
# Line 387  function taxonomy_browser_form() { Line 394  function taxonomy_browser_form() {
394      }      }
395    
396      $vocname = check_plain($voc->name);      $vocname = check_plain($voc->name);
397      $description = $voc->description ? decode_entities(check_markup($voc->description)) : NULL;      $description = $voc->description ? check_markup($voc->description) : NULL;
398      if (variable_get('taxonomy_browser_show_types', FALSE)) {      if (variable_get('taxonomy_browser_show_types', FALSE)) {
399        $description .= t('"!name" is used for: !types.', array('!name' => '<strong>'. $vocname .'</strong>', '!types' => (empty($node_type_list) ? '<em>'. t('nothing') .'</em>' : $node_type_list)));        $used_for = t('"!name" is used for: !types.', array('!name' => '<strong>'. $vocname .'</strong>', '!types' => (empty($node_type_list) ? '<em>'. t('nothing') .'</em>' : $node_type_list)));
400      }      }
401    
402      if (!empty($term_opts)) {      if (!empty($term_opts)) {
# Line 398  function taxonomy_browser_form() { Line 405  function taxonomy_browser_form() {
405          '#title' => $vocname,          '#title' => $vocname,
406          '#options' => $term_opts,          '#options' => $term_opts,
407          '#multiple' => TRUE,          '#multiple' => TRUE,
408          '#description' => $description,          '#description' => $collapsible ? $used_for : $description . $used_for,
409          '#prefix' => '<div class="taxonomy_browser_'. $select_type .'">',          '#prefix' => '<div class="taxonomy_browser_'. $select_type .'">',
410          '#suffix' => '</div>',          '#suffix' => '</div>',
411          '#field_suffix' => $node_type_list,          '#field_suffix' => $node_type_list,
# Line 411  function taxonomy_browser_form() { Line 418  function taxonomy_browser_form() {
418            '#type' => 'fieldset',            '#type' => 'fieldset',
419            '#title' => $vocname,            '#title' => $vocname,
420            '#collapsible' => TRUE,            '#collapsible' => TRUE,
421            '#collapsed' => TRUE,            '#collapsed' => $collapsible == 1,
422              '#description' => $description,
423            );            );
424          $form['taxonomy'][$fld_set][$v] = $voc_element;          $form['taxonomy'][$fld_set][$v] = $voc_element;
425        }        }

Legend:
Removed from v.1.19.2.11.2.22  
changed lines
  Added in v.1.19.2.11.2.23

  ViewVC Help
Powered by ViewVC 1.1.2