function system_variable_info in Variable 7.2
Same name and namespace in other branches
- 6 includes/system.variable.inc \system_variable_info()
- 7 includes/system.variable.inc \system_variable_info()
Implements hook_variable_info().
File
- includes/
system.variable.inc, line 10 - Variable API module. Definition for Drupal core variables
Code
function system_variable_info($options) {
// Site configuration, site information
$variables['site_name'] = array(
'type' => 'string',
'title' => t('Site name', array(), $options),
'default' => 'Drupal',
'description' => t('The name of this website.', array(), $options),
'required' => TRUE,
'group' => 'site_information',
);
$variables['site_mail'] = array(
'type' => 'mail_address',
'title' => t('Site email address', array(), $options),
'default' => ini_get('sendmail_from'),
'description' => t("The <em>From</em> address in automated e-mails sent during registration and new password requests, and other notifications. (Use an address ending in your site's domain to help prevent this e-mail being flagged as spam.)", array(), $options),
'required' => TRUE,
'group' => 'site_information',
);
$variables['site_slogan'] = array(
'type' => 'text',
'title' => t('Site slogan', array(), $options),
'default' => '',
'description' => t("Your site's motto, tag line, or catchphrase (often displayed alongside the title of the site).", array(), $options),
'group' => 'site_information',
);
$variables['anonymous'] = array(
'type' => 'string',
'title' => t('Anonymous user', array(), $options),
'default' => t('Anonymous', array(), $options),
'description' => t('The name used to indicate anonymous users.', array(), $options),
'required' => TRUE,
'group' => 'site_information',
);
$variables['site_frontpage'] = array(
'type' => 'drupal_path',
'title' => t('Default front page', array(), $options),
'default' => 'node',
'description' => t('The home page displays content from this relative URL. If unsure, specify "node".', array(), $options),
'required' => TRUE,
'group' => 'site_information',
);
$variables['default_nodes_main'] = array(
'type' => 'select_number',
'title' => t('Number of posts on main page', array(), $options),
'default' => 10,
'options' => array(
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
15,
20,
25,
30,
),
'description' => t('The maximum number of posts displayed on overview pages such as the front page.', array(), $options),
'group' => 'site_information',
);
$variables['site_403'] = array(
'type' => 'drupal_path',
'title' => t('Default 403 (access denied) page', array(), $options),
'default' => '',
'description' => t('This page is displayed when the requested document is denied to the current user. Leave blank to display a generic "access denied" page.', array(), $options),
'group' => 'site_information',
);
$variables['site_404'] = array(
'type' => 'drupal_path',
'title' => t('Default 404 (not found) page', array(), $options),
'default' => '',
'description' => t('This page is displayed when no other content matches the requested document. Leave blank to display a generic "page not found" page.', array(), $options),
'group' => 'site_information',
);
// Feed settings. Group 'feed_settings'.
$variables['feed_description'] = array(
'type' => 'text',
'title' => t('Feed description'),
'default' => '',
'description' => t('Description of your site, included in each feed.', array(), $options),
'group' => 'feed_settings',
);
$variables['feed_default_items'] = array(
'type' => 'select_number',
'title' => t('Number of items in each feed'),
'default' => 10,
'options' => array(
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
15,
20,
25,
30,
),
'description' => t('Default number of items to include in each feed.', array(), $options),
'group' => 'feed_settings',
);
$variables['feed_item_length'] = array(
'type' => 'select',
'title' => t('Feed content'),
'default' => 'fulltext',
'options' => array(
'title' => t('Titles only', array(), $options),
'teaser' => t('Titles plus teaser', array(), $options),
'fulltext' => t('Full text', array(), $options),
),
'description' => t('Global setting for the default display of content items in each feed.', array(), $options),
'group' => 'feed_settings',
);
// Regional settings. Group 'regional_settings'.
$variables['site_default_country'] = array(
'type' => 'select',
'options' => 'country',
'title' => t('Default country', array(), $options),
'element' => array(
'#type' => 'select',
'#attributes' => array(
'class' => array(
'country-detect',
),
),
),
'group' => 'regional_settings',
);
$variables['date_first_day'] = array(
'type' => 'select',
'options' => 'weekday',
'title' => t('First day of week', array(), $options),
'default' => 0,
'localize' => TRUE,
'group' => 'regional_settings',
);
$variables['date_default_timezone'] = array(
'type' => 'select',
'options' => 'timezone',
'title' => t('Default time zone', array(), $options),
'default callback' => 'date_default_timezone_get',
'group' => 'regional_settings',
);
$variables['configurable_timezones'] = array(
'type' => 'boolean',
'title' => t('Users may set their own time zone.', array(), $options),
'default' => 1,
'group' => 'regional_settings',
);
$variables['empty_timezone_message'] = array(
'type' => 'boolean',
'title' => t('Remind users at login if their time zone is not set.', array(), $options),
'default' => 0,
'description' => t('Only applied if users may set their own time zone.', array(), $options),
'group' => 'regional_settings',
);
$variables['user_default_timezone'] = array(
'type' => 'select',
'title' => t('Time zone for new users'),
'default' => DRUPAL_USER_TIMEZONE_DEFAULT,
'options' => array(
DRUPAL_USER_TIMEZONE_DEFAULT => t('Default time zone.', array(), $options),
DRUPAL_USER_TIMEZONE_EMPTY => t('Empty time zone.', array(), $options),
DRUPAL_USER_TIMEZONE_SELECT => t('Users may set their own time zone at registration.', array(), $options),
),
'description' => t('Only applied if users may set their own time zone.', array(), $options),
'localize' => TRUE,
'group' => 'regional_settings',
);
$variables['date_format_[date_type]'] = array(
'type' => 'multiple',
'title' => t('Date format'),
'repeat' => array(
'type' => 'select',
'options' => 'date_format',
),
'group' => 'regional_settings',
);
// Maintenance mode. Group 'site_information'
$variables['maintenance_mode'] = array(
'type' => 'boolean',
'title' => t('Put site into maintenance mode', array(), $options),
'default' => 0,
'description' => t('When enabled, only users with the "Use the site in maintenance mode" <a href="@permissions-url">permission</a> are able to access your site to perform maintenance; all other visitors see the maintenance mode message configured below. Authorized users can log in directly via the <a href="@user-login">user login</a> page.', array(
'@permissions-url' => url('admin/people/permissions'),
'@user-login' => url('user'),
), $options),
'group' => 'site_information',
);
$variables['maintenance_mode_message'] = array(
'type' => 'text',
'title' => t('Maintenance mode message', array(), $options),
'default' => t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array(
'@site' => variable_get('site_name', 'Drupal'),
), $options),
'description' => t('Message to show visitors when the site is in maintenance mode.', array(), $options),
'group' => 'site_information',
);
// Theme settings, we may want to localize the logo. Group 'theme_settings'
$variables['theme_settings'] = array(
'type' => 'properties',
'title' => t('Global theme settings.', array(), $options),
'group' => 'theme_settings',
'default callback' => 'system_variable_theme_defaults',
'localize' => TRUE,
'group' => 'theme_settings',
);
$variables['theme_[theme]_settings'] = array(
'type' => 'multiple',
'multiple' => 'theme',
'title' => t('Theme settings', array(), $options),
'description' => t('Logo, icons and other specific theme settings.', array(), $options),
'repeat' => array(
'type' => 'properties',
'default callback' => 'system_variable_theme_defaults',
),
'group' => 'theme_settings',
'localize' => TRUE,
);
// Performance options, changing them may need some extra cache refresh.
$variables['cache'] = array(
'type' => 'boolean',
'title' => t('Cache pages for anonymous users', array(), $options),
'default' => 0,
'group' => 'system_performance',
);
// This one belongs to a different module, block, but it won't do any harm having it here.
$variables['block_cache'] = array(
'type' => 'boolean',
'title' => t('Cache blocks'),
'default' => FALSE,
'description' => t('Block caching is inactive if you have enabled modules defining content access restrictions.', array(), $options),
'group' => 'system_performance',
);
$interval = array(
0,
60,
180,
300,
600,
900,
1800,
2700,
3600,
10800,
21600,
32400,
43200,
86400,
);
$variables['cache_lifetime'] = array(
'type' => 'time_interval',
'title' => t('Minimum cache lifetime', array(), $options),
'default' => 0,
'interval values' => $interval,
'description' => t('Cached pages will not be re-created until at least this much time has elapsed.', array(), $options),
'group' => 'system_performance',
);
$variables['page_cache_maximum_age'] = array(
'type' => 'time_interval',
'title' => t('Expiration of cached pages', array(), $options),
'default' => 0,
'interval values' => $interval,
'description' => t('The maximum time an external cache can use an old version of a page.', array(), $options),
'group' => 'system_performance',
);
$description = t('External resources can be optimized automatically, which can reduce both the size and number of requests made to your website.', array(), $options);
$variables['page_compression'] = array(
'type' => 'enable',
'title' => t('Compress cached pages.', array(), $options),
'description' => $description,
'default' => TRUE,
'group' => 'system_performance',
);
$variables['preprocess_css'] = array(
'type' => 'boolean',
'title' => t('Aggregate and compress CSS files.'),
'description' => $description,
'default' => 0,
'group' => 'system_performance',
);
$variables['preprocess_js'] = array(
'type' => 'boolean',
'title' => t('Aggregate JavaScript files.'),
'description' => $description,
'default' => 0,
'group' => 'system_performance',
);
return $variables;
}