1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Module file for webform_validation_testing.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Implements hook_webform_validation_validators().
|
10
|
*/
|
11
|
function webform_validation_testing_webform_validation_validators() {
|
12
|
$validators = array(
|
13
|
'webform_validation_testing_1' => array(
|
14
|
'name' => t('Webform Validation Testing 1'),
|
15
|
'component_types' => array(
|
16
|
'all',
|
17
|
),
|
18
|
'custom_data' => array(
|
19
|
'label' => t('Custom data: Should be textarea'),
|
20
|
'type' => 'textarea',
|
21
|
'description' => t('Test textarea.'),
|
22
|
'required' => FALSE,
|
23
|
),
|
24
|
'description' => t('Used for testing.'),
|
25
|
),
|
26
|
);
|
27
|
return $validators;
|
28
|
}
|
29
|
|
30
|
/**
|
31
|
* Implements hook_webform_validation_validate().
|
32
|
*/
|
33
|
function webform_validation_testing_webform_validation_validate($validator_name, $items, $components, $rule) {
|
34
|
switch ($validator_name) {
|
35
|
case 'webform_validation_testing_1':
|
36
|
return array();
|
37
|
}
|
38
|
}
|