You are here

function system_elements in Drupal 4

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

Implementation of hook_elements().

File

modules/system.module, line 60
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' => 30,
  );
  $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,
  );
  $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;
}