-
Notifications
You must be signed in to change notification settings - Fork 0
/
form_reference.api.php
52 lines (47 loc) · 1.19 KB
/
form_reference.api.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* @file
* Documentation for form_reference API.
*/
/**
* @addtogroup hooks
* @{
*/
/**
* Specify forms to be available to form_reference.
*
* Each form is specified using its form_id as the element key.
*
* As a minimum, name should be defined and appears in the field configuration.
*
* Optional:
* - category - Category the form belongs in. 'Other' if not specified.
* - wrapper - A wrapper function to be used instead of drupal_get_form().
* - module - The module in which the form exists.
* - file - The file in which the form exists.
* - validation_element - Existence of this element in the loaded form will be
* checked to validate that the form_id is valid.
*
* @return array
* Array of form definitions.
*/
function hook_form_reference() {
$forms = array(
'user_login' => array(
'name' => t('User Login'),
),
'page' => array(
'name' => t('Basic page'),
// The following are optional.
'category' => t('Core'),
'wrapper' => 'node_add',
'module' => 'node',
'file' => 'node.pages.inc',
'validation_element' => '#node_edit_form',
),
);
return $forms;
}
/**
* @} End of "addtogroup hooks".
*/