Skip to content
This repository has been archived by the owner on Mar 4, 2019. It is now read-only.

Commit

Permalink
Replace with (fix #2)
Browse files Browse the repository at this point in the history
  • Loading branch information
dashohoxha committed Aug 30, 2015
1 parent 9c156f4 commit 49cc6f2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions ajax_chain_select.module
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ function ajax_chain_select_element_process($element, &$form_state, $form) {
$is_submitted = (!empty($form_state['input']));
$submitted_values = $form_state['values']['region'];

$region_element = array(
$chain_select_element = array(
'#array_parents' => array(),
'#tree' => FALSE,
'#attached' => array(
'js' => array(drupal_get_path('module', 'ajax_chain_select') . '/ajax_chain_select.js'),
),
);

$region_element[$element_name] = array(
$chain_select_element[$element_name] = array(
'#type' => 'fieldset',
'#tree' => TRUE,
'#id' => !empty($element['#id']) ? $element['#id'] : drupal_html_id('edit-' . implode('-', $element['#parents'])),
Expand All @@ -74,9 +74,9 @@ function ajax_chain_select_element_process($element, &$form_state, $form) {
'#data_callback' => $data_callback,
);

$region_element[$element_name]['#attached']['js'][] = array(
$chain_select_element[$element_name]['#attached']['js'][] = array(
'type' => 'setting',
'data' => array('ajax_chain_select' => array($region_element[$element_name]['#id'] => $settings)),
'data' => array('ajax_chain_select' => array($chain_select_element[$element_name]['#id'] => $settings)),
);

$index = 0;
Expand Down Expand Up @@ -112,7 +112,7 @@ function ajax_chain_select_element_process($element, &$form_state, $form) {
unset($level_config['#default_value']);
}

$region_element[$element_name][$level] = array(
$chain_select_element[$element_name][$level] = array(
'#type' => 'select',
'#options' => $data,
'#title' => !empty($level_config['#title']) ? $level_config['#title'] : '',
Expand All @@ -126,27 +126,27 @@ function ajax_chain_select_element_process($element, &$form_state, $form) {
);

if ($index != $levels_count - 1) {
$region_element[$element_name][$level]['#attributes']['class'] = array('ajax-chain-select-select');
$chain_select_element[$element_name][$level]['#attributes']['class'] = array('ajax-chain-select-select');
}

$index++;
$previous_level = $level;
$previous_level_config = $level_config;
}

$region_element[$element_name]['dc'] = array(
$chain_select_element[$element_name]['dc'] = array(
'#type' => 'textfield',
'#value' => base64_encode($element['#data_callback']),
'#attributes' => array('hidden' => TRUE, 'class' => array('acs-dc')),
);

$region_element[$element_name]['dch'] = array(
$chain_select_element[$element_name]['dch'] = array(
'#type' => 'textfield',
'#value' => ajax_chain_select_get_token($element['#data_callback']),
'#attributes' => array('hidden' => TRUE, 'class' => array('acs-dch')),
);

return $region_element;
return $chain_select_element;
}

/**
Expand Down

0 comments on commit 49cc6f2

Please sign in to comment.