webform_phone.module in Webform Phone Number 7
Same filename and directory in other branches
Information about phone fields for webform module
File
webform_phone.moduleView source
<?php
/**
* @file
* Information about phone fields for webform module
*/
/**
* Implements hook_webform_component_info().
*/
function webform_phone_webform_component_info() {
$components = array();
$components['phone'] = array(
'label' => t('Phone Number'),
'description' => t('Phone Number field.'),
'features' => array(
// Add content to CSV downloads. Defaults to TRUE.
'csv' => TRUE,
// Show this component in e-mailed submissions. Defaults to TRUE.
'email' => TRUE,
// Allow this component to be used as an e-mail FROM or TO address.
// Defaults to FALSE.
'email_address' => FALSE,
// Allow this component to be used as an e-mail SUBJECT or FROM name.
// Defaults to FALSE.
'email_name' => FALSE,
// This component may be toggled as required or not. Defaults to TRUE.
'required' => TRUE,
// This component has a title that can be toggled as displayed or not.
'title_display' => TRUE,
// This component has a title that can be displayed inline.
'title_inline' => TRUE,
// If this component can be used as a conditional SOURCE. All components
// may always be displayed conditionally, regardless of this setting.
// Defaults to TRUE.
'conditional' => TRUE,
// If this component allows other components to be grouped within it
// (like a fieldset or tabs). Defaults to FALSE.
'group' => FALSE,
// If this component can be used for SPAM analysis, usually with Mollom.
'spam_analysis' => FALSE,
// If this component saves a file that can be used as an e-mail
// attachment. Defaults to FALSE.
'attachment' => FALSE,
),
'file' => 'webform_phone.components.inc',
);
return $components;
}
/**
* Implements hook_webform_validator_alter().
*/
function webform_phone_webform_validator_alter(&$validators) {
$validators['unique']['component_types'][] = 'phone';
// webform_validaton combined 'oneoftwo' and 'oneofseveral' into 'someofseveral' as of 7.x-1.5
if (array_key_exists('oneoftwo', $validators)) {
$validators['oneoftwo']['component_types'][] = 'phone';
}
if (array_key_exists('oneofseveral', $validators)) {
$validators['oneofseveral']['component_types'][] = 'phone';
}
if (array_key_exists('someofseveral', $validators)) {
$validators['someofseveral']['component_types'][] = 'phone';
}
}
Functions
Name![]() |
Description |
---|---|
webform_phone_webform_component_info | Implements hook_webform_component_info(). |
webform_phone_webform_validator_alter | Implements hook_webform_validator_alter(). |