function drupalgap_webform_form_webform_component_edit_form_alter in DrupalGap 7
Implements hook_form_FORM_ID_alter().
File
- modules/
drupalgap_webform/ drupalgap_webform.module, line 6
Code
function drupalgap_webform_form_webform_component_edit_form_alter(&$form, &$form_state) {
if ($form['type']['#value'] != 'select') {
return;
}
$cid = $form['cid']['#value'];
// Add a checkbox for the DrupalGap hybrid widget.
$default_value = isset($form['#node']->webform['components'][$cid]['extra']['drupalgap_webform_select_hybrid']) ? $form['#node']->webform['components'][$cid]['extra']['drupalgap_webform_select_hybrid'] : 0;
$form['extra']['drupalgap_webform_select_hybrid'] = array(
'#type' => 'checkbox',
'#title' => t('Use DrupalGap Hybrid Widget'),
'#description' => t('A hybrid widget for this select component inside the DrupalGap app.'),
'#default_value' => $default_value,
);
}