/[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.8, Mon Apr 17 07:11:39 2006 UTC revision 1.9, Fri Jan 5 15:57:53 2007 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: activeselect.module,v 1.7 2006/04/09 05:11:52 jaza Exp $  // $Id: activeselect.module,v 1.8 2006/04/17 07:11:39 jaza Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 14  function activeselect_help($section) { Line 14  function activeselect_help($section) {
14    switch ($section) {    switch ($section) {
15      case 'admin/help#activeselect':      case 'admin/help#activeselect':
16        return '<p>'. t('The activeselect module defines the activeselect form element. An activeselect element is the same as a regular select element, except that when the user selects a new option (or set of options), a different select element (the target element) gets its list updated. This is done using AJAX, and it is designed to degrade gracefully if the required JavaScript support is not present. The target element can be either a regular select box, or another activeselect box (which in turn can trigger another target box, which can trigger yet another, resulting in a hierarchical cascade of activeselect elements).') .'</p>';        return '<p>'. t('The activeselect module defines the activeselect form element. An activeselect element is the same as a regular select element, except that when the user selects a new option (or set of options), a different select element (the target element) gets its list updated. This is done using AJAX, and it is designed to degrade gracefully if the required JavaScript support is not present. The target element can be either a regular select box, or another activeselect box (which in turn can trigger another target box, which can trigger yet another, resulting in a hierarchical cascade of activeselect elements).') .'</p>';
     case 'admin/modules#description':  
       return t('Defines the activeselect form element, which allows modules to have AJAX-enabled select boxes.');  
17    }    }
18  }  }
19    
# Line 76  function theme_activeselect($element) { Line 74  function theme_activeselect($element) {
74    $extra = '';    $extra = '';
75    if ($element['#activeselect_path'] && $element['#activeselect_targets']) {    if ($element['#activeselect_path'] && $element['#activeselect_targets']) {
76      $module_path = drupal_get_path('module', 'activeselect'). '/';      $module_path = drupal_get_path('module', 'activeselect'). '/';
77      theme_add_style($module_path. 'activeselect.css');      drupal_add_css($module_path. 'activeselect.css');
78      drupal_add_js($module_path. 'activeselect.js');      drupal_add_js($module_path. 'activeselect.js');
79      $class[] = ' form-activeselect';      $class[] = ' form-activeselect';
80      $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 89  function theme_activeselect($element) { Line 87  function theme_activeselect($element) {
87    }    }
88    _form_set_class($element, $class);    _form_set_class($element, $class);
89    
90    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, '<select name="'. $element['#name'] .''. ($element['#multiple'] ? '[]' : '') .'"'. ($element['#multiple'] ? ' multiple="multiple" ' : '') . drupal_attributes($element['#attributes']) .' id="' . $element['#id'] .'" '. $size. '>'. form_select_options($element) .'</select>'). $extra;
91  }  }

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.2