summaryrefslogtreecommitdiff
path: root/modules/system/system.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system/system.module')
-rw-r--r--modules/system/system.module51
1 files changed, 42 insertions, 9 deletions
diff --git a/modules/system/system.module b/modules/system/system.module
index d0a542efb..086a298e9 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -46,6 +46,13 @@ define('DRUPAL_OPTIONAL', 1);
define('DRUPAL_REQUIRED', 2);
/**
+ * Maximum number of values in a weight select element.
+ *
+ * If the number of values is over the maximum, a text field is used instead.
+ */
+define('DRUPAL_WEIGHT_SELECT_MAX', 100);
+
+/**
* Return only visible regions.
*
* @see system_region_list()
@@ -969,7 +976,7 @@ function system_menu() {
);
$items['admin/config/system/site-information'] = array(
'title' => 'Site information',
- 'description' => t('Change site name, e-mail address, slogan, default front page, and number of posts per page, error pages.'),
+ 'description' => 'Change site name, e-mail address, slogan, default front page, and number of posts per page, error pages.',
'page callback' => 'drupal_get_form',
'page arguments' => array('system_site_information_settings'),
'access arguments' => array('administer site configuration'),
@@ -977,8 +984,8 @@ function system_menu() {
'weight' => -20,
);
$items['admin/config/system/cron'] = array(
- 'title' => t('Cron'),
- 'description' => t('Manage automatic site maintenance tasks.'),
+ 'title' => 'Cron',
+ 'description' => 'Manage automatic site maintenance tasks.',
'page callback' => 'drupal_get_form',
'page arguments' => array('system_cron_settings'),
'access arguments' => array('administer site configuration'),
@@ -1108,7 +1115,7 @@ function system_library() {
'title' => 'Drupal progress indicator',
'version' => VERSION,
'js' => array(
- 'misc/progress.js' => array('group' => JS_DEFAULT, 'cache' => FALSE),
+ 'misc/progress.js' => array('group' => JS_DEFAULT),
),
);
@@ -2465,6 +2472,18 @@ function _system_update_bootstrap_status() {
function _system_rebuild_theme_data() {
// Find themes
$themes = drupal_system_listing('/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\.info$/', 'themes');
+ // Allow modules to add further themes.
+ if ($module_themes = module_invoke_all('system_theme_info')) {
+ foreach ($module_themes as $name => $uri) {
+ // @see file_scan_directory()
+ $themes[$name] = (object) array(
+ 'uri' => $uri,
+ 'filename' => pathinfo($uri, PATHINFO_FILENAME),
+ 'name' => $name,
+ );
+ }
+ }
+
// Find theme engines
$engines = drupal_system_listing('/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\.engine$/', 'themes/engines');
@@ -2700,8 +2719,8 @@ function system_region_list($theme_key, $show = REGIONS_ALL) {
* Implements hook_system_info_alter().
*/
function system_system_info_alter(&$info, $file, $type) {
- // Remove page-top from the blocks UI since it is reserved for modules to
- // populate from outside the blocks system.
+ // Remove page-top and page-bottom from the blocks UI since they are reserved for
+ // modules to populate from outside the blocks system.
if ($type == 'theme') {
$info['regions_hidden'][] = 'page_top';
$info['regions_hidden'][] = 'page_bottom';
@@ -2864,7 +2883,18 @@ function confirm_form($form, $question, $path, $description = NULL, $yes = NULL,
}
/**
- * Determines if the current user is in compact mode.
+ * Determines whether the current user is in compact mode.
+ *
+ * Compact mode shows certain administration pages with less description text,
+ * such as the configuration page and the permissions page.
+ *
+ * Whether the user is in compact mode is determined by a cookie, which is set
+ * for the user by system_admin_compact_page().
+ *
+ * If the user does not have the cookie, the default value is given by the
+ * system variable 'admin_compact_mode', which itself defaults to FALSE. This
+ * does not have a user interface to set it: it is a hidden variable which can
+ * be set in the settings.php file.
*
* @return
* TRUE when in compact mode, FALSE when in expanded mode.
@@ -3420,12 +3450,12 @@ function system_image_toolkits() {
function system_retrieve_file($url, $destination = NULL, $managed = FALSE, $replace = FILE_EXISTS_RENAME) {
$parsed_url = parse_url($url);
if (!isset($destination)) {
- $path = file_build_uri(basename($parsed_url['path']));
+ $path = file_build_uri(drupal_basename($parsed_url['path']));
}
else {
if (is_dir(drupal_realpath($destination))) {
// Prevent URIs with triple slashes when glueing parts together.
- $path = str_replace('///', '//', "$destination/") . basename($parsed_url['path']);
+ $path = str_replace('///', '//', "$destination/") . drupal_basename($parsed_url['path']);
}
else {
$path = $destination;
@@ -3860,7 +3890,10 @@ function system_date_format_save($date_format, $dfid = 0) {
drupal_write_record('date_formats', $info, $keys);
}
+ // Retrieve an array of language objects for enabled languages.
$languages = language_list('enabled');
+ // This list is keyed off the value of $language->enabled; we want the ones
+ // that are enabled (value of 1).
$languages = $languages[1];
$locale_format = array();