updated core to 7.73
This commit is contained in:
@@ -309,7 +309,7 @@ function system_theme_enable() {
|
||||
}
|
||||
drupal_goto('admin/appearance');
|
||||
}
|
||||
return drupal_access_denied();
|
||||
return MENU_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -337,7 +337,7 @@ function system_theme_disable() {
|
||||
}
|
||||
drupal_goto('admin/appearance');
|
||||
}
|
||||
return drupal_access_denied();
|
||||
return MENU_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -383,7 +383,7 @@ function system_theme_default() {
|
||||
}
|
||||
drupal_goto('admin/appearance');
|
||||
}
|
||||
return drupal_access_denied();
|
||||
return MENU_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -572,9 +572,10 @@ function system_theme_settings($form, &$form_state, $key = '') {
|
||||
// Process the theme and all its base themes.
|
||||
foreach ($theme_keys as $theme) {
|
||||
// Include the theme-settings.php file.
|
||||
$filename = DRUPAL_ROOT . '/' . str_replace("/$theme.info", '', $themes[$theme]->filename) . '/theme-settings.php';
|
||||
if (file_exists($filename)) {
|
||||
require_once $filename;
|
||||
$theme_settings_path = drupal_get_path('theme', $theme) . '/theme-settings.php';
|
||||
if (file_exists(DRUPAL_ROOT . '/' . $theme_settings_path)) {
|
||||
require_once DRUPAL_ROOT . '/' . $theme_settings_path;
|
||||
$form_state['build_info']['files'][] = $theme_settings_path;
|
||||
}
|
||||
|
||||
// Call theme-specific settings.
|
||||
@@ -640,13 +641,13 @@ function system_theme_settings_validate($form, &$form_state) {
|
||||
|
||||
// If the user provided a path for a logo or favicon file, make sure a file
|
||||
// exists at that path.
|
||||
if ($form_state['values']['logo_path']) {
|
||||
if (!empty($form_state['values']['logo_path'])) {
|
||||
$path = _system_theme_settings_validate_path($form_state['values']['logo_path']);
|
||||
if (!$path) {
|
||||
form_set_error('logo_path', t('The custom logo path is invalid.'));
|
||||
}
|
||||
}
|
||||
if ($form_state['values']['favicon_path']) {
|
||||
if (!empty($form_state['values']['favicon_path'])) {
|
||||
$path = _system_theme_settings_validate_path($form_state['values']['favicon_path']);
|
||||
if (!$path) {
|
||||
form_set_error('favicon_path', t('The custom favicon path is invalid.'));
|
||||
@@ -703,14 +704,16 @@ function system_theme_settings_submit($form, &$form_state) {
|
||||
|
||||
// If the user uploaded a new logo or favicon, save it to a permanent location
|
||||
// and use it in place of the default theme-provided file.
|
||||
if ($file = $values['logo_upload']) {
|
||||
if (!empty($values['logo_upload'])) {
|
||||
$file = $values['logo_upload'];
|
||||
unset($values['logo_upload']);
|
||||
$filename = file_unmanaged_copy($file->uri);
|
||||
$values['default_logo'] = 0;
|
||||
$values['logo_path'] = $filename;
|
||||
$values['toggle_logo'] = 1;
|
||||
}
|
||||
if ($file = $values['favicon_upload']) {
|
||||
if (!empty($values['favicon_upload'])) {
|
||||
$file = $values['favicon_upload'];
|
||||
unset($values['favicon_upload']);
|
||||
$filename = file_unmanaged_copy($file->uri);
|
||||
$values['default_favicon'] = 0;
|
||||
@@ -950,7 +953,11 @@ function system_sort_modules_by_info_name($a, $b) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Array sorting callback; sorts modules or themes by their name.
|
||||
* Sorts themes by their names, with the default theme listed first.
|
||||
*
|
||||
* Callback for uasort() within system_themes_page().
|
||||
*
|
||||
* @see system_sort_modules_by_info_name().
|
||||
*/
|
||||
function system_sort_themes($a, $b) {
|
||||
if ($a->is_default) {
|
||||
@@ -995,22 +1002,28 @@ function _system_modules_build_row($info, $extra) {
|
||||
$status_short = '';
|
||||
$status_long = '';
|
||||
|
||||
// Initialize empty arrays of long and short reasons explaining why the
|
||||
// module is incompatible.
|
||||
// Add each reason as a separate element in both the arrays.
|
||||
$reasons_short = array();
|
||||
$reasons_long = array();
|
||||
|
||||
// Check the core compatibility.
|
||||
if (!isset($info['core']) || $info['core'] != DRUPAL_CORE_COMPATIBILITY) {
|
||||
$compatible = FALSE;
|
||||
$status_short .= t('Incompatible with this version of Drupal core.');
|
||||
$status_long .= t('This version is not compatible with Drupal !core_version and should be replaced.', array('!core_version' => DRUPAL_CORE_COMPATIBILITY));
|
||||
$reasons_short[] = t('Incompatible with this version of Drupal core.');
|
||||
$reasons_long[] = t('This version is not compatible with Drupal !core_version and should be replaced.', array('!core_version' => DRUPAL_CORE_COMPATIBILITY));
|
||||
}
|
||||
|
||||
// Ensure this module is compatible with the currently installed version of PHP.
|
||||
if (version_compare(phpversion(), $info['php']) < 0) {
|
||||
$compatible = FALSE;
|
||||
$status_short .= t('Incompatible with this version of PHP');
|
||||
$reasons_short[] = t('Incompatible with this version of PHP');
|
||||
$php_required = $info['php'];
|
||||
if (substr_count($info['php'], '.') < 2) {
|
||||
$php_required .= '.*';
|
||||
}
|
||||
$status_long .= t('This module requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $php_required, '!php_version' => phpversion()));
|
||||
$reasons_long[] = t('This module requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $php_required, '!php_version' => phpversion()));
|
||||
}
|
||||
|
||||
// If this module is compatible, present a checkbox indicating
|
||||
@@ -1026,6 +1039,8 @@ function _system_modules_build_row($info, $extra) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
$status_short = implode(' ', $reasons_short);
|
||||
$status_long = implode(' ', $reasons_long);
|
||||
$form['enable'] = array(
|
||||
'#markup' => theme('image', array('path' => 'misc/watchdog-error.png', 'alt' => $status_short, 'title' => $status_short)),
|
||||
);
|
||||
@@ -1618,6 +1633,7 @@ function system_cron_settings() {
|
||||
$form['cron']['cron_safe_threshold'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('Run cron every'),
|
||||
'#description' => t('More information about setting up scheduled tasks can be found by <a href="@url">reading the cron tutorial on drupal.org</a>.', array('@url' => url('http://drupal.org/cron'))),
|
||||
'#default_value' => variable_get('cron_safe_threshold', DRUPAL_CRON_DEFAULT_THRESHOLD),
|
||||
'#options' => array(0 => t('Never')) + drupal_map_assoc(array(3600, 10800, 21600, 43200, 86400, 604800), 'format_interval'),
|
||||
);
|
||||
@@ -1797,7 +1813,7 @@ function system_file_system_settings() {
|
||||
'#title' => t('Private file system path'),
|
||||
'#default_value' => variable_get('file_private_path', ''),
|
||||
'#maxlength' => 255,
|
||||
'#description' => t('An existing local file system path for storing private files. It should be writable by Drupal and not accessible over the web. See the online handbook for <a href="@handbook">more information about securing private files</a>.', array('@handbook' => 'http://drupal.org/documentation/modules/file')),
|
||||
'#description' => t('An existing local file system path for storing private files. It should be writable by Drupal and not accessible over the web. See the online handbook for <a href="@handbook">more information about securing private files</a>.', array('@handbook' => 'https://www.drupal.org/docs/7/core/modules/file/overview')),
|
||||
'#after_build' => array('system_check_directory'),
|
||||
);
|
||||
|
||||
@@ -1841,7 +1857,7 @@ function system_image_toolkit_settings() {
|
||||
if (count($toolkits_available) == 0) {
|
||||
variable_del('image_toolkit');
|
||||
$form['image_toolkit_help'] = array(
|
||||
'#markup' => t("No image toolkits were detected. Drupal includes support for <a href='!gd-link'>PHP's built-in image processing functions</a> but they were not detected on this system. You should consult your system administrator to have them enabled, or try using a third party toolkit.", array('gd-link' => url('http://php.net/gd'))),
|
||||
'#markup' => t("No image toolkits were detected. Drupal includes support for <a href='!gd-link'>PHP's built-in image processing functions</a> but they were not detected on this system. You should consult your system administrator to have them enabled, or try using a third party toolkit.", array('!gd-link' => url('http://php.net/gd'))),
|
||||
);
|
||||
return $form;
|
||||
}
|
||||
@@ -2187,6 +2203,11 @@ function system_add_date_format_type_form_submit($form, &$form_state) {
|
||||
* Return the date for a given format string via Ajax.
|
||||
*/
|
||||
function system_date_time_lookup() {
|
||||
// This callback is protected with a CSRF token because user input from the
|
||||
// query string is reflected in the output.
|
||||
if (!isset($_GET['token']) || !drupal_valid_token($_GET['token'], 'admin/config/regional/date-time/formats/lookup')) {
|
||||
return MENU_ACCESS_DENIED;
|
||||
}
|
||||
$result = format_date(REQUEST_TIME, 'custom', $_GET['format']);
|
||||
drupal_json_output($result);
|
||||
}
|
||||
@@ -2545,9 +2566,21 @@ function theme_system_admin_index($variables) {
|
||||
/**
|
||||
* Returns HTML for the status report.
|
||||
*
|
||||
* This theme function is dependent on install.inc being loaded, because
|
||||
* that's where the constants are defined.
|
||||
*
|
||||
* @param $variables
|
||||
* An associative array containing:
|
||||
* - requirements: An array of requirements.
|
||||
* - requirements: An array of requirements/status items. Each requirement
|
||||
* is an associative array containing the following elements:
|
||||
* - title: The name of the requirement.
|
||||
* - value: (optional) The current value (version, time, level, etc).
|
||||
* - description: (optional) The description of the requirement.
|
||||
* - severity: (optional) The requirement's result/severity level, one of:
|
||||
* - REQUIREMENT_INFO: Status information.
|
||||
* - REQUIREMENT_OK: The requirement is satisfied.
|
||||
* - REQUIREMENT_WARNING: The requirement failed with a warning.
|
||||
* - REQUIREMENT_ERROR: The requirement failed with an error.
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
@@ -2575,8 +2608,10 @@ function theme_status_report($variables) {
|
||||
|
||||
foreach ($requirements as $requirement) {
|
||||
if (empty($requirement['#type'])) {
|
||||
$severity = $severities[isset($requirement['severity']) ? (int) $requirement['severity'] : 0];
|
||||
$severity = $severities[isset($requirement['severity']) ? (int) $requirement['severity'] : REQUIREMENT_OK];
|
||||
$severity['icon'] = '<div title="' . $severity['title'] . '"><span class="element-invisible">' . $severity['title'] . '</span></div>';
|
||||
// The requirement's 'value' key is optional, provide a default value.
|
||||
$requirement['value'] = isset($requirement['value']) ? $requirement['value'] : '';
|
||||
|
||||
// Output table row(s)
|
||||
if (!empty($requirement['description'])) {
|
||||
@@ -2631,8 +2666,8 @@ function theme_system_modules_fieldset($variables) {
|
||||
}
|
||||
$row[] = array('data' => $description, 'class' => array('description'));
|
||||
// Display links (such as help or permissions) in their own columns.
|
||||
foreach (array('help', 'permissions', 'configure') as $key) {
|
||||
$row[] = array('data' => drupal_render($module['links'][$key]), 'class' => array($key));
|
||||
foreach (array('help', 'permissions', 'configure') as $link_type) {
|
||||
$row[] = array('data' => drupal_render($module['links'][$link_type]), 'class' => array($link_type));
|
||||
}
|
||||
$rows[] = $row;
|
||||
}
|
||||
@@ -2860,13 +2895,14 @@ function system_date_time_formats() {
|
||||
* Allow users to add additional date formats.
|
||||
*/
|
||||
function system_configure_date_formats_form($form, &$form_state, $dfid = 0) {
|
||||
$ajax_path = 'admin/config/regional/date-time/formats/lookup';
|
||||
$js_settings = array(
|
||||
'type' => 'setting',
|
||||
'data' => array(
|
||||
'dateTime' => array(
|
||||
'date-format' => array(
|
||||
'text' => t('Displayed as'),
|
||||
'lookup' => url('admin/config/regional/date-time/formats/lookup'),
|
||||
'lookup' => url($ajax_path, array('query' => array('token' => drupal_get_token($ajax_path)))),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user