1 system.module system_element_info()

Implements hook_element_info().

File

core/modules/system/system.module, line 226
Configuration system that lets administrators modify the workings of the site.

Code

function system_element_info() {
  // Top level elements.
  $types['form'] = array(
    '#method' => 'post',
    '#action' => request_uri(),
    '#theme_wrappers' => array('form'),
  );
  // By default, we don't want Ajax commands being rendered in the context of an
  // HTML page, so we don't provide defaults for #theme or #theme_wrappers.
  // However, modules can set these properties (for example, to provide an HTML
  // debugging page that displays rather than executes Ajax commands).
  $types['ajax'] = array(
    '#header' => TRUE,
    '#commands' => array(),
    '#error' => NULL,
  );
  $types['head_tag'] = array(
    '#theme' => 'head_tag',
    '#pre_render' => array('backdrop_pre_render_conditional_comments'),
    '#attributes' => array(),
    '#value' => NULL,
  );
  $types['styles'] = array(
    '#items' => array(),
    '#pre_render' => array('backdrop_pre_render_styles'),
    '#group_callback' => 'backdrop_group_css',
    '#aggregate_callback' => 'backdrop_aggregate_css',
  );
  $types['scripts'] = array(
    '#items' => array(),
    '#pre_render' => array('backdrop_pre_render_scripts'),
    '#group_callback' => 'backdrop_group_js',
    '#aggregate_callback' => 'backdrop_aggregate_js',
  );

  // Input elements.
  $types['submit'] = array(
    '#input' => TRUE,
    '#name' => 'op',
    '#button_type' => 'submit',
    '#executes_submit_callback' => TRUE,
    '#limit_validation_errors' => FALSE,
    '#process' => array('ajax_process_form', 'form_process_button'),
    '#theme_wrappers' => array('button'),
  );
  $types['button'] = array(
    '#input' => TRUE,
    '#name' => 'op',
    '#button_type' => 'submit',
    '#executes_submit_callback' => FALSE,
    '#limit_validation_errors' => FALSE,
    '#process' => array('ajax_process_form', 'form_process_button'),
    '#theme_wrappers' => array('button'),
  );
  $types['image_button'] = array(
    '#input' => TRUE,
    '#button_type' => 'submit',
    '#executes_submit_callback' => TRUE,
    '#limit_validation_errors' => FALSE,
    '#process' => array('ajax_process_form', 'form_process_button'),
    '#return_value' => TRUE,
    '#has_garbage_value' => TRUE,
    '#src' => NULL,
    '#theme_wrappers' => array('image_button'),
  );
  $types['textfield'] = array(
    '#input' => TRUE,
    '#size' => 60,
    '#maxlength' => 128,
    '#autocomplete_path' => FALSE,
    '#process' => array('form_process_autocomplete', 'ajax_process_form'),
    '#theme' => 'textfield',
    '#theme_wrappers' => array('form_element'),
  );
  $types['tel'] = array(
    '#input' => TRUE,
    '#size' => 30,
    '#maxlength' => 128,
    '#autocomplete_path' => FALSE,
    '#process' => array('ajax_process_form'),
    '#theme' => 'tel',
    '#theme_wrappers' => array('form_element'),
  );
  $types['email'] = array(
    '#input' => TRUE,
    '#size' => 60,
    '#maxlength' => EMAIL_MAX_LENGTH,
    '#autocomplete_path' => FALSE,
    '#process' => array('ajax_process_form'),
    '#element_validate' => array('form_validate_email'),
    '#theme' => 'email',
    '#theme_wrappers' => array('form_element'),
  );
  $types['url'] = array(
    '#input' => TRUE,
    '#size' => 60,
    '#maxlength' => 255,
    '#autocomplete_path' => FALSE,
    '#process' => array('ajax_process_form'),
    '#element_validate' => array('form_validate_url'),
    '#theme' => 'url',
    '#theme_wrappers' => array('form_element'),
  );
  $types['color'] = array(
    '#input' => TRUE,
    '#process' => array('ajax_process_form'),
    '#element_validate' => array('form_validate_color'),
    '#theme' => 'color',
    '#theme_wrappers' => array('form_element'),
  );
  $types['number'] = array(
    '#input' => TRUE,
    '#step' => 1,
    '#process' => array('ajax_process_form'),
    '#element_validate' => array('form_validate_number'),
    '#theme' => 'number',
    '#theme_wrappers' => array('form_element'),
  );
  $types['range'] = array(
    '#input' => TRUE,
    '#size' => 30,
    '#step' => 1,
    '#min' => 0,
    '#max' => 100,
    '#maxlength' => 128,
    '#process' => array('ajax_process_form'),
    '#element_validate' => array('form_validate_number'),
    '#theme' => 'range',
    '#theme_wrappers' => array('form_element'),
  );
  $types['search'] = array(
    '#input' => TRUE,
    '#size' => 60,
    '#maxlength' => 128,
    '#autocomplete_path' => FALSE,
    '#process' => array('ajax_process_form'),
    '#theme' => 'search',
    '#theme_wrappers' => array('form_element'),
  );
  $types['machine_name'] = array(
    '#input' => TRUE,
    '#default_value' => NULL,
    '#required' => TRUE,
    '#maxlength' => 64,
    '#size' => 60,
    '#autocomplete_path' => FALSE,
    '#process' => array('form_process_machine_name', 'ajax_process_form'),
    '#element_validate' => array('form_validate_machine_name'),
    '#theme' => 'textfield',
    '#theme_wrappers' => array('form_element'),
  );
  $types['password'] = array(
    '#input' => TRUE,
    '#size' => 60,
    '#maxlength' => 128,
    '#process' => array('ajax_process_form'),
    '#theme' => 'password',
    '#theme_wrappers' => array('form_element'),
    '#password_strength' => FALSE,
    '#password_toggle' => FALSE,
    '#password_shown' => FALSE,
    '#process' => array('user_form_process_password'),
  );
  $types['password_confirm'] = array(
    '#input' => TRUE,
    '#process' => array('form_process_password_confirm', 'user_form_process_password_confirm'),
    '#theme_wrappers' => array('form_element'),
  );
  $types['textarea'] = array(
    '#input' => TRUE,
    '#cols' => 60,
    '#rows' => 5,
    '#resizable' => 'vertical',
    '#description_display' => 'before',
    '#process' => array('ajax_process_form'),
    '#theme' => 'textarea',
    '#theme_wrappers' => array('form_element'),
  );
  $types['radios'] = array(
    '#input' => TRUE,
    '#description_display' => 'before',
    '#process' => array('form_process_radios'),
    '#theme_wrappers' => array('container__radios'),
    '#pre_render' => array('form_pre_render_conditional_form_element'),
  );
  $types['radio'] = array(
    '#input' => TRUE,
    '#default_value' => NULL,
    '#process' => array('ajax_process_form'),
    '#theme' => 'radio',
    '#theme_wrappers' => array('form_element'),
    '#title_display' => 'after',
  );
  $types['checkboxes'] = array(
    '#input' => TRUE,
    '#description_display' => 'before',
    '#process' => array('form_process_checkboxes'),
    '#theme_wrappers' => array('container__checkboxes'),
    '#pre_render' => array('form_pre_render_conditional_form_element'),
  );
  $types['checkbox'] = array(
    '#input' => TRUE,
    '#return_value' => 1,
    '#theme' => 'checkbox',
    '#process' => array('form_process_checkbox', 'ajax_process_form'),
    '#theme_wrappers' => array('form_element'),
    '#title_display' => 'after',
  );
  $types['select'] = array(
    '#input' => TRUE,
    '#multiple' => FALSE,
    '#process' => array('form_process_select', 'ajax_process_form'),
    '#theme' => 'select',
    '#theme_wrappers' => array('form_element'),
  );
  $types['weight'] = array(
    '#input' => TRUE,
    '#delta' => 10,
    '#default_value' => 0,
    '#process' => array('form_process_weight', 'ajax_process_form'),
  );
  $types['date'] = array(
    '#input' => TRUE,
    '#element_validate' => array('date_validate'),
    '#process' => array('form_process_date'),
    '#theme' => 'date',
    '#theme_wrappers' => array('form_element'),
  );
  $types['html_date'] = array(
    '#input' => TRUE,
    '#element_validate' => array('html_date_validate'),
    '#theme' => 'html_date',
    '#theme_wrappers' => array('form_element'),
    '#value_callback' => 'html_date_or_time_value_callback',
  );
  $types['html_time'] = array(
    '#input' => TRUE,
    '#element_validate' => array('html_time_validate'),
    '#theme' => 'html_time',
    '#theme_wrappers' => array('form_element'),
    '#value_callback' => 'html_date_or_time_value_callback',
  );
  $types['html_datetime'] = array(
    '#input' => TRUE,
    '#element_validate' => array('html_datetime_validate'),
    '#process' => array('form_process_html_datetime'),
    '#theme' => 'html_datetime',
    '#theme_wrappers' => array('form_element'),
  );
  $types['file'] = array(
    '#input' => TRUE,
    '#size' => 60,
    '#theme' => 'file',
    '#theme_wrappers' => array('form_element'),
  );
  $types['tableselect'] = array(
    '#input' => TRUE,
    '#js_select' => TRUE,
    '#multiple' => TRUE,
    '#process' => array('form_process_tableselect'),
    '#options' => array(),
    '#empty' => '',
    '#theme' => 'tableselect',
  );

  // Form structure.
  $types['item'] = array(
    '#markup' => '',
    '#pre_render' => array('backdrop_pre_render_markup'),
    '#theme_wrappers' => array('form_element'),
  );
  $types['hidden'] = array(
    '#input' => TRUE,
    '#process' => array('ajax_process_form'),
    '#theme' => 'hidden',
  );
  $types['value'] = array(
    '#input' => TRUE,
  );
  $types['markup'] = array(
    '#markup' => '',
    '#pre_render' => array('backdrop_pre_render_markup'),
  );
  $types['help'] = array(
    '#markup' => '',
    '#pre_render' => array('backdrop_pre_render_markup'),
    '#theme' => 'help',
  );
  $types['link'] = array(
    '#pre_render' => array('backdrop_pre_render_link', 'backdrop_pre_render_markup'),
  );
  $types['fieldset'] = array(
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
    '#value' => NULL,
    '#description_display' => 'before',
    '#process' => array('form_process_fieldset', 'ajax_process_form'),
    '#pre_render' => array('form_pre_render_fieldset'),
    '#theme_wrappers' => array('fieldset'),
  );
  $types['vertical_tabs'] = array(
    '#theme_wrappers' => array('vertical_tabs'),
    '#default_tab' => '',
    '#process' => array('form_process_vertical_tabs'),
  );
  $types['dropbutton'] = array(
    '#pre_render' => array('backdrop_pre_render_dropbutton'),
    '#theme' => 'links__dropbutton',
  );
  $types['operations'] = array(
    '#pre_render' => array('backdrop_pre_render_dropbutton'),
    '#theme' => 'links__dropbutton__operations',
  );
  $types['details'] = array(
    '#summary' => NULL,
    '#details' => NULL,
    '#open' => FALSE,
    '#theme_wrappers' => array('details'),
  );
  $types['container'] = array(
    '#theme_wrappers' => array('container'),
    '#process' => array('form_process_container'),
  );
  $types['actions'] = array(
    '#theme_wrappers' => array('container'),
    '#process' => array('form_process_actions', 'form_process_container'),
    '#weight' => 100,
  );

  $types['token'] = array(
    '#input' => TRUE,
    '#theme' => 'hidden',
  );

  return $types;
}