You are here

function variable_variable_type_defaults in Variable 6

Implementation of hook_variable_form_defaults()

File

./variable.inc, line 88
Variable API module. Extended API.

Code

function variable_variable_type_defaults() {
  $types['string'] = array(
    'form_element' => array(
      '#type' => 'textfield',
    ),
    'localize' => TRUE,
  );
  $types['mail_address'] = array(
    'form_element' => array(
      '#type' => 'textfield',
    ),
  );
  $types['drupal_path'] = array(
    'form_element' => array(
      '#type' => 'textfield',
      '#size' => 40,
    ),
  );
  $types['file_path'] = array(
    'form_element' => array(
      '#type' => 'textfield',
      '#size' => 30,
      '#maxlength' => 255,
    ),
  );
  $types['text'] = array(
    'form_element' => array(
      '#type' => 'textarea',
    ),
    'localize' => TRUE,
  );
  $types['mail_text'] = array(
    //'form_callback' => 'variable_form_element_mail_text',
    'build_callback' => 'variable_mail_build',
    'multiple' => array(
      'subject',
      'body',
    ),
    'localize' => TRUE,
  );
  $types['url'] = array(
    'form_element' => array(
      '#type' => 'textfield',
      '#size' => 30,
      '#maxlength' => 255,
    ),
  );

  // Enable/Disable
  $types['enable'] = array(
    'form_element' => array(
      '#type' => 'radios',
      '#options' => array(
        t('Disabled'),
        t('Enabled'),
      ),
    ),
  );
  $types['number'] = array(
    'form_element' => array(
      '#type' => 'textfield',
      '#size' => 15,
      '#maxlength' => 10,
    ),
  );

  // TRUE / FALSE value, checkbox
  $types['boolean'] = array(
    'form_element' => array(
      '#type' => 'checkbox',
    ),
  );

  // Select single option from multiple choices
  $types['select'] = array(
    'form_element' => array(
      '#type' => 'select',
    ),
    'form_callback' => 'variable_form_element_options',
  );

  // Select multiple options from multiple choices
  $types['options'] = array(
    'form_element' => array(
      '#type' => 'checkboxes',
    ),
    'form_callback' => 'variable_form_element_options',
  );
  return $types;
}