element_info

Versions
7
element_info($type)

Retrieve the default properties for the defined element type.

▾ 8 functions call element_info()

drupal_deliver_html_page in includes/common.inc
Package and send the result of a page callback to the browser as a normal HTML page.
drupal_prepare_form in includes/form.inc
Prepares a structured form array by adding required elements, executing any hook_form_alter functions, and optionally inserting a validation token to prevent tampering.
drupal_render in includes/common.inc
Renders HTML given a structured array tree.
drupal_render_page in includes/common.inc
Renders the page, including all theming.
file_field_widget in modules/file/file.field.inc
Implementation of hook_field_widget().
form_builder in includes/form.inc
Walk through the structured form array, adding any required properties to each element and mapping the incoming input data to the proper elements. Also, execute any #process handlers attached to a specific element.
form_process_weight in includes/form.inc
Expand weight elements into selects.
system_batch_page in modules/system/system.admin.inc
Default page callback for batches.

Code

includes/common.inc, line 5275

<?php
function element_info($type) {
  $cache = &drupal_static(__FUNCTION__);

  if (!isset($cache)) {
    $cache = module_invoke_all('element_info');
    foreach ($cache as $element_type => $info) {
      $cache[$element_type]['#type'] = $element_type;
    }
    // Allow modules to alter the element type defaults.
    drupal_alter('element_info', $cache);
  }

  return isset($cache[$type]) ? $cache[$type] : array();
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.