function _webform_views_options_form in Webform 7.4
Shared form for the Webform submission data field and relationship handler.
2 calls to _webform_views_options_form()
- webform_handler_field_submission_data::options_form in views/
webform_handler_field_submission_data.inc - Default options form provides the label widget that all fields should have.
- webform_handler_relationship_submission_data::options_form in views/
webform_handler_relationship_submission_data.inc - Provide the label widget that all fields should have.
File
- views/
webform.views.inc, line 669 - Views hooks implemented for the Webform module.
Code
function _webform_views_options_form(&$form, &$form_state, $nid, $cid) {
form_load_include($form_state, 'inc', 'webform', 'includes/webform.components');
$node = $nid ? node_load($nid) : NULL;
$form['webform_nid'] = array(
'#type' => 'textfield',
'#title' => t('Webform node'),
'#default_value' => isset($node) ? $node->title . ' [nid:' . $node->nid . ']' : '',
'#ajax' => array(
'path' => views_ui_build_form_url($form_state),
'event' => 'blur',
),
'#autocomplete_path' => 'webform/autocomplete',
'#description' => t('Enter the title or NID of the Webform whose values should be made available.'),
'#submit' => array(
'views_ui_config_item_form_submit_temporary',
),
'#executes_submit_callback' => TRUE,
);
$components = array();
if (isset($node->webform['components'])) {
$components = $node->webform['components'];
}
$type_options = array();
foreach (webform_components() as $key => $component) {
$type_options[$key] = check_plain($component['label']);
}
$options = webform_component_list($node, NULL, 'path', TRUE);
$form['webform_cid'] = array(
'#title' => t('Component data'),
'#type' => 'select',
'#options' => $options,
'#default_value' => $cid,
'#access' => count($components),
'#description' => t('Select the component whose values should be made available.'),
);
}