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

Diff of /contributions/modules/activeselect/activeselect.module

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

revision 1.7, Sun Apr 9 05:11:52 2006 UTC revision 1.7.2.1, Mon Apr 17 07:11:53 2006 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: activeselect.module,v 1.6 2006/03/29 12:51:48 jaza Exp $  // $Id: activeselect.module,v 1.7 2006/04/09 05:11:52 jaza Exp $
3    
4  /**  /**
5   * @file   * @file
6   * Defines the activeselect form element, which allows modules to have   * Defines the activeselect form element, which allows modules to have
7   * AJAX-enabled select boxes.   * AJAX-enabled select boxes.
8   */   */
9    
# Line 29  function activeselect_elements() { Line 29  function activeselect_elements() {
29  }  }
30    
31  /**  /**
32   * Converts the string of values passed to an activeselect callback function   * Converts the string of values passed to an activeselect callback function
33   * into an array.   * into an array.
34   *   *
35   * @param $string   * @param $string
36   *   The string of values passed to an activeselect callback.   *   The string of values passed to an activeselect callback.
37   *   *
38   * @return   * @return
39   *   An array of values, in the form $key => $value.   *   An array of values, in the form $key => $value.
40   */   */
# Line 45  function activeselect_explode_values($st Line 45  function activeselect_explode_values($st
45      $array[$match[0]] = html_entity_decode($match[1]);      $array[$match[0]] = html_entity_decode($match[1]);
46      unset($array[$key]);      unset($array[$key]);
47    }    }
48    
49    return $array;    return $array;
50  }  }
51    
# Line 76  function theme_activeselect($element) { Line 76  function theme_activeselect($element) {
76    $extra = '';    $extra = '';
77    if ($element['#activeselect_path'] && $element['#activeselect_targets']) {    if ($element['#activeselect_path'] && $element['#activeselect_targets']) {
78      $module_path = drupal_get_path('module', 'activeselect'). '/';      $module_path = drupal_get_path('module', 'activeselect'). '/';
79      theme('add_style', $module_path. 'activeselect.css');      theme_add_style($module_path. 'activeselect.css');
80      drupal_add_js($module_path. 'activeselect.js');      drupal_add_js($module_path. 'activeselect.js');
81      $class[] = ' form-activeselect';      $class[] = ' form-activeselect';
82      $extra = '<input class="activeselect-path" type="hidden" id="'. $element['#id'] .'-activeselect-path" value="'. check_url(url($element['#activeselect_path'], NULL, NULL, TRUE)) .'" disabled="disabled" />'. "\n";      $extra = '<input class="activeselect-path" type="hidden" id="'. $element['#id'] .'-activeselect-path" value="'. check_url(url($element['#activeselect_path'], NULL, NULL, TRUE)) .'" disabled="disabled" />'. "\n";
# Line 88  function theme_activeselect($element) { Line 88  function theme_activeselect($element) {
88      $extra .= '<input class="activeselect-extra" type="hidden" id="'. $element['#id'] .'-activeselect-extra" value="'. check_plain($element['#activeselect_extra']) .'" disabled="disabled" />'. "\n";      $extra .= '<input class="activeselect-extra" type="hidden" id="'. $element['#id'] .'-activeselect-extra" value="'. check_plain($element['#activeselect_extra']) .'" disabled="disabled" />'. "\n";
89    }    }
90    _form_set_class($element, $class);    _form_set_class($element, $class);
91    
92    return theme('form_element', $element['#title'], '<select name="'. $element['#name'] .''. ($element['#multiple'] ? '[]' : '') .'"'. ($element['#multiple'] ? ' multiple="multiple" ' : '') . drupal_attributes($element['#attributes']) .' id="' . $element['#id'] .'" '. $size. '>'. form_select_options($element) .'</select>', $element['#description'], $element['#id'], $element['#required'], form_get_error($element)). $extra;    return theme('form_element', $element['#title'], '<select name="'. $element['#name'] .''. ($element['#multiple'] ? '[]' : '') .'"'. ($element['#multiple'] ? ' multiple="multiple" ' : '') . drupal_attributes($element['#attributes']) .' id="' . $element['#id'] .'" '. $size. '>'. form_select_options($element) .'</select>', $element['#description'], $element['#id'], $element['#required'], form_get_error($element)). $extra;
93  }  }

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.7.2.1

  ViewVC Help
Powered by ViewVC 1.1.2