You are here

function system_elements in Drupal 5

Same name and namespace in other branches
  1. 4 modules/system.module \system_elements()
  2. 6 modules/system/system.module \system_elements()

Implementation of hook_elements().

File

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

Code

function system_elements() {

  // Top level form
  $type['form'] = array(
    '#method' => 'post',
    '#action' => request_uri(),
  );

  // Inputs
  $type['checkbox'] = array(
    '#input' => TRUE,
    '#return_value' => 1,
  );
  $type['submit'] = array(
    '#input' => TRUE,
    '#name' => 'op',
    '#button_type' => 'submit',
    '#executes_submit_callback' => TRUE,
  );
  $type['button'] = array(
    '#input' => TRUE,
    '#name' => 'op',
    '#button_type' => 'submit',
    '#executes_submit_callback' => FALSE,
  );
  $type['textfield'] = array(
    '#input' => TRUE,
    '#size' => 60,
    '#maxlength' => 128,
    '#autocomplete_path' => FALSE,
  );
  $type['password'] = array(
    '#input' => TRUE,
    '#size' => 60,
  );
  $type['password_confirm'] = array(
    '#input' => TRUE,
    '#process' => array(
      'expand_password_confirm' => array(),
    ),
  );
  $type['textarea'] = array(
    '#input' => TRUE,
    '#cols' => 60,
    '#rows' => 5,
  );
  $type['radios'] = array(
    '#input' => TRUE,
    '#process' => array(
      'expand_radios' => array(),
    ),
  );
  $type['radio'] = array(
    '#input' => TRUE,
  );
  $type['checkboxes'] = array(
    '#input' => TRUE,
    '#process' => array(
      'expand_checkboxes' => array(),
    ),
    '#tree' => TRUE,
  );
  $type['select'] = array(
    '#input' => TRUE,
  );
  $type['weight'] = array(
    '#input' => TRUE,
    '#delta' => 10,
    '#default_value' => 0,
    '#process' => array(
      'process_weight' => array(),
    ),
  );
  $type['date'] = array(
    '#input' => TRUE,
    '#process' => array(
      'expand_date' => array(),
    ),
    '#validate' => array(
      'date_validate' => array(),
    ),
  );
  $type['file'] = array(
    '#input' => TRUE,
    '#size' => 60,
  );

  // Form structure
  $type['item'] = array();
  $type['hidden'] = array(
    '#input' => TRUE,
  );
  $type['value'] = array(
    '#input' => TRUE,
  );
  $type['markup'] = array(
    '#prefix' => '',
    '#suffix' => '',
  );
  $type['fieldset'] = array(
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
  );
  $type['token'] = array(
    '#input' => TRUE,
  );
  return $type;
}