function ctools_dependent_pre_render

cis7 dependent.inc ctools_dependent_pre_render($element)
cle7 dependent.inc ctools_dependent_pre_render($element)
elmsmedia7 dependent.inc ctools_dependent_pre_render($element)
icor7 dependent.inc ctools_dependent_pre_render($element)
meedjum_blog7 dependent.inc ctools_dependent_pre_render($element)
mooc7 dependent.inc ctools_dependent_pre_render($element)
8 string references to 'ctools_dependent_pre_render'
ctools_dependent_element_info_alter in sites/all/modules/ulmus/ctools/includes/dependent.inc
CTools alters the element_info to be able to add #process functions to every major form element to make it much more handy to use #dependency, because you don't have to add #process.
date_element_info in sites/all/modules/ulmus/date/date.module
Implements hook_element_info().
date_popup_element_info in sites/all/modules/ulmus/date/date_popup/date_popup.module
Implements hook_element_info().
date_repeat_element_info in sites/all/modules/ulmus/date/date_repeat/date_repeat.module
Implements hook_element_info().
date_views_filter_handler_simple::date_parts_form in sites/all/modules/ulmus/date/date_views/includes/date_views_filter_handler_simple.inc
A form element to select date part values.

... See full list

File

sites/all/modules/ulmus/ctools/includes/dependent.inc, line 134
Provide dependent checkboxes that can be easily used in forms.

Code

function ctools_dependent_pre_render($element) {
  // Preprocess only items with #dependency set.
  if (isset($element['#dependency'])) {
    if (!isset($element['#dependency_count'])) {
      $element['#dependency_count'] = 1;
    }
    if (!isset($element['#dependency_type'])) {
      $element['#dependency_type'] = 'hide';
    }

    $js = array(
      'values' => $element['#dependency'],
      'num' => $element['#dependency_count'],
      'type' => $element['#dependency_type'],
    );

    // Add a additional wrapper id around fieldsets, textareas to support depedency on it.
    if (in_array($element['#type'], array('textarea', 'fieldset', 'text_format'))) {
      $element['#theme_wrappers'][] = 'container';
      $element['#attributes']['id'] = $element['#id'] . '-wrapper';
    }

    // Text formats need to unset the dependency on the textarea
    // or it gets applied twice.
    if ($element['#type'] == 'text_format') {
      unset($element['value']['#dependency']);
    }

    $element['#attached']['js'][] = ctools_attach_js('dependent');
    $options['CTools']['dependent'][$element['#id']] = $js;
    $element['#attached']['js'][] = array(
      'type' => 'setting',
      'data' => $options,
    );

  }

  return $element;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.