_element_info
Definition
_element_info($type, $refresh = NULL)
includes/form.inc, line 1350
Description
Retrieve the default properties for the defined element type.
Related topics
| Name | Description |
|---|---|
| Form generation | Functions to enable the processing and display of HTML forms. |
Code
<?php
function _element_info($type, $refresh = NULL) {
static $cache;
$basic_defaults = array(
'#description' => NULL,
'#attributes' => array(),
'#required' => FALSE,
);
if (!isset($cache) || $refresh) {
$cache = array();
foreach (module_implements('elements') as $module) {
$elements = module_invoke($module, 'elements');
if (isset($elements) && is_array($elements)) {
$cache = array_merge_recursive($cache, $elements);
}
}
if (sizeof($cache)) {
foreach ($cache as $element_type => $info) {
$cache[$element_type] = array_merge_recursive($basic_defaults, $info);
}
}
}
return $cache[$type];
}
?> 