function system_variable_type_info in Variable 7.2
Same name and namespace in other branches
- 7 includes/system.variable.inc \system_variable_type_info()
Implements hook_variable_type_info().
File
- includes/
system.variable.inc, line 293 - Variable API module. Definition for Drupal core variables
Code
function system_variable_type_info() {
// Internal Drupal path as used by menu items.
$type['drupal_path'] = array(
'title' => t('Drupal path'),
'element callback' => 'system_variable_path_element',
'localize' => TRUE,
);
// File system path, relative to Drupal installation.
$type['file_path'] = array(
'title' => t('File path'),
'default' => conf_path() . '/files',
'element' => array(
'#type' => 'textfield',
'#maxlength' => 255,
'#after_build' => array(
'system_check_directory',
),
),
);
// These are just for option lists though they can be used as variable type to have a selectable value.
$type['weekday'] = array(
'title' => t('Day of week'),
'type' => 'select',
'options callback' => 'system_variable_option_weekday',
);
$type['theme'] = array(
'title' => t('Theme'),
'type' => 'select',
'options callback' => 'system_variable_option_theme',
'cache' => TRUE,
);
$type['country'] = array(
'title' => t('Country'),
'type' => 'select',
'options callback' => 'system_variable_option_country',
'cache' => TRUE,
);
$type['timezone'] = array(
'title' => t('Time zone'),
'type' => 'select',
'options callback' => 'system_time_zones',
'cache' => TRUE,
);
$type['date_type'] = array(
'title' => t('Date type'),
'type' => 'select',
'options callback' => 'system_variable_option_date_type',
);
$type['date_format'] = array(
'title' => t('Date format'),
'type' => 'select',
'options callback' => 'system_variable_option_date_format',
);
$type['time_interval'] = array(
'title' => t('Time interval'),
'type' => 'select',
'options callback' => 'system_variable_option_time_interval',
);
return $type;
}