function webform_webform_component_info in Webform 7.4
Same name and namespace in other branches
- 6.3 webform.module \webform_webform_component_info()
- 7.3 webform.module \webform_webform_component_info()
Implements hook_webform_component_info().
File
- ./
webform.module, line 1084 - This module provides a simple way to create forms and questionnaires.
Code
function webform_webform_component_info() {
$component_info = array(
'date' => array(
'label' => t('Date'),
'description' => t('Presents month, day, and year fields.'),
'features' => array(
'views_range' => TRUE,
'css_classes' => FALSE,
),
'file' => 'components/date.inc',
'conditional_type' => 'date',
),
'email' => array(
'label' => t('E-mail'),
'description' => t('A special textfield that accepts e-mail addresses.'),
'file' => 'components/email.inc',
'features' => array(
'email_address' => TRUE,
'spam_analysis' => TRUE,
'placeholder' => TRUE,
'conditional_action_set' => TRUE,
),
),
'fieldset' => array(
'label' => t('Fieldset'),
'description' => t('Fieldsets allow you to organize multiple fields into groups.'),
'features' => array(
'csv' => FALSE,
'default_value' => FALSE,
'required' => FALSE,
'conditional' => FALSE,
'group' => TRUE,
'stores_data' => FALSE,
'title_inline' => FALSE,
'wrapper_classes' => FALSE,
),
'file' => 'components/fieldset.inc',
),
'grid' => array(
'label' => t('Grid'),
'description' => t('Allows creation of grid questions, denoted by radio buttons.'),
'features' => array(
'default_value' => FALSE,
'title_inline' => FALSE,
'title_internal' => TRUE,
'css_classes' => FALSE,
'conditional' => FALSE,
'group' => TRUE,
),
'file' => 'components/grid.inc',
),
'hidden' => array(
'label' => t('Hidden'),
'description' => t('A field which is not visible to the user, but is recorded with the submission.'),
'file' => 'components/hidden.inc',
'features' => array(
'required' => FALSE,
'description' => FALSE,
'email_address' => TRUE,
'email_name' => TRUE,
'title_display' => FALSE,
'private' => FALSE,
'wrapper_classes' => FALSE,
'css_classes' => FALSE,
'conditional_action_set' => TRUE,
),
),
'markup' => array(
'label' => t('Markup'),
'description' => t('Displays text as HTML in the form; does not render a field.'),
'features' => array(
'analysis' => FALSE,
'csv' => FALSE,
'default_value' => FALSE,
'description' => FALSE,
'email' => FALSE,
'required' => FALSE,
'conditional' => FALSE,
'stores_data' => FALSE,
'title_display' => FALSE,
'private' => FALSE,
'wrapper_classes' => FALSE,
'css_classes' => FALSE,
'conditional_action_set' => TRUE,
),
'file' => 'components/markup.inc',
),
'number' => array(
'label' => t('Number'),
'description' => t('A numeric input field (either as textfield or select list).'),
'features' => array(
'conditional_action_set' => TRUE,
),
'file' => 'components/number.inc',
'conditional_type' => 'numeric',
),
'pagebreak' => array(
'label' => t('Page break'),
'description' => t('Organize forms into multiple pages.'),
'features' => array(
'analysis' => FALSE,
'conditional' => FALSE,
'csv' => FALSE,
'default_value' => FALSE,
'description' => FALSE,
'private' => FALSE,
'required' => FALSE,
'stores_data' => FALSE,
'title_display' => FALSE,
'wrapper_classes' => FALSE,
'css_classes' => FALSE,
),
'file' => 'components/pagebreak.inc',
),
'select' => array(
'label' => t('Select options'),
'description' => t('Allows creation of checkboxes, radio buttons, or select menus.'),
'file' => 'components/select.inc',
'features' => array(
'default_value' => FALSE,
'email_address' => TRUE,
'email_name' => TRUE,
'conditional_action_set' => TRUE,
),
'conditional_type' => 'select',
),
'textarea' => array(
'label' => t('Textarea'),
'description' => t('A large text area that allows for multiple lines of input.'),
'file' => 'components/textarea.inc',
'features' => array(
'spam_analysis' => TRUE,
'placeholder' => TRUE,
'conditional_action_set' => TRUE,
),
),
'textfield' => array(
'label' => t('Textfield'),
'description' => t('Basic textfield type.'),
'file' => 'components/textfield.inc',
'features' => array(
'email_name' => TRUE,
'spam_analysis' => TRUE,
'placeholder' => TRUE,
'conditional_action_set' => TRUE,
),
),
'time' => array(
'label' => t('Time'),
'description' => t('Presents the user with hour and minute fields. Optional am/pm fields.'),
'features' => array(
'views_range' => TRUE,
'css_classes' => FALSE,
),
'file' => 'components/time.inc',
'conditional_type' => 'time',
),
);
if (module_exists('file')) {
$component_info['file'] = array(
'label' => t('File'),
'description' => t('Allow users to upload files of configurable types.'),
'features' => array(
'conditional' => FALSE,
'default_value' => FALSE,
'attachment' => TRUE,
'file_usage' => TRUE,
),
'file' => 'components/file.inc',
);
}
return $component_info;
}