+++ b/core/modules/system/system.admin.incundefined @@ -1592,150 +1417,6 @@ function system_run_cron_submit($form, &$form_state) { } /** - * Form builder; Configure error reporting settings. - * - * @ingroup forms - * @see system_logging_settings_submit() - */ -function system_logging_settings($form, &$form_state) { - config_context_enter('config.context.free'); - $form['error_level'] = array( - '#type' => 'radios', - '#title' => t('Error messages to display'), - '#default_value' => config('system.logging')->get('error_level'), - '#options' => array( - ERROR_REPORTING_HIDE => t('None'), - ERROR_REPORTING_DISPLAY_SOME => t('Errors and warnings'), - ERROR_REPORTING_DISPLAY_ALL => t('All messages'), - ERROR_REPORTING_DISPLAY_VERBOSE => t('All messages, with backtrace information'), - ), - '#description' => t('It is recommended that sites running on production environments do not display any errors.'), - ); - - return system_config_form($form, $form_state); -} - -/** - * Form submission handler for system_logging_settings(). - * - * @ingroup forms - */ -function system_logging_settings_submit($form, &$form_state) { - config_context_enter('config.context.free'); - config('system.logging') - ->set('error_level', $form_state['values']['error_level']) - ->save(); -} - -/** - * Form builder; Configure site performance settings. - * - * @ingroup forms - * @see system_performance_settings_submit(). - */ -function system_performance_settings($form, &$form_state) { - drupal_add_library('system', 'drupal.system'); - config_context_enter('config.context.free'); - $config = config('system.performance'); - - $form['clear_cache'] = array( - '#type' => 'details', - '#title' => t('Clear cache'), - ); - - $form['clear_cache']['clear'] = array( - '#type' => 'submit', - '#value' => t('Clear all caches'), - '#submit' => array('system_clear_cache_submit'), - ); - - $form['caching'] = array( - '#type' => 'details', - '#title' => t('Caching'), - ); - - $period = drupal_map_assoc(array(0, 60, 180, 300, 600, 900, 1800, 2700, 3600, 10800, 21600, 32400, 43200, 86400), 'format_interval'); - $period[0] = '<' . t('none') . '>'; - $form['caching']['page_cache_maximum_age'] = array( - '#type' => 'select', - '#title' => t('Page cache maximum age'), - '#default_value' => $config->get('cache.page.max_age'), - '#options' => $period, - '#description' => t('The maximum time a page can be cached. This is used as the value for max-age in Cache-Control headers.'), - ); - - $form['caching']['cache'] = array( - '#type' => 'checkbox', - '#title' => t('Use internal page cache'), - '#description' => t("If a reverse proxy cache isn't available, use Drupal's internal cache system to store cached pages."), - '#default_value' => $config->get('cache.page.use_internal'), - ); - - $directory = 'public://'; - $is_writable = is_dir($directory) && is_writable($directory); - $disabled = !$is_writable; - $disabled_message = ''; - if (!$is_writable) { - $disabled_message = ' ' . t('Set up the public files directory to make these optimizations available.', array('!file-system' => url('admin/config/media/file-system'))); - } - - $form['bandwidth_optimization'] = array( - '#type' => 'details', - '#title' => t('Bandwidth optimization'), - '#description' => t('External resources can be optimized automatically, which can reduce both the size and number of requests made to your website.') . $disabled_message, - ); - - $js_hide = ($config->get('cache.page.max_age') > 0) ? '' : ' class="js-hide"'; - $form['bandwidth_optimization']['page_compression'] = array( - '#type' => 'checkbox', - '#title' => t('Compress cached pages.'), - '#default_value' => $config->get('response.gzip'), - '#states' => array( - 'visible' => array( - 'input[name="cache"]' => array('checked' => TRUE), - ), - ), - ); - $form['bandwidth_optimization']['preprocess_css'] = array( - '#type' => 'checkbox', - '#title' => t('Aggregate and compress CSS files.'), - '#default_value' => $config->get('css.preprocess'), - '#disabled' => $disabled, - ); - $form['bandwidth_optimization']['preprocess_js'] = array( - '#type' => 'checkbox', - '#title' => t('Aggregate JavaScript files.'), - '#default_value' => $config->get('js.preprocess'), - '#disabled' => $disabled, - ); - - $form['#submit'][] = 'drupal_clear_css_cache'; - $form['#submit'][] = 'drupal_clear_js_cache'; - // This form allows page compression settings to be changed, which can - // invalidate the page cache, so it needs to be cleared on form submit. - $form['#submit'][] = 'system_clear_page_cache_submit'; - $form['#submit'][] = 'system_performance_settings_submit'; - - return system_config_form($form, $form_state); -} - -/** - * Form submission handler for system_performance_settings(). - * - * @ingroup forms - */ -function system_performance_settings_submit($form, &$form_state) { - config_context_enter('config.context.free'); - $config = config('system.performance'); - $config->set('cache.page.use_internal', $form_state['values']['cache']); - $config->set('cache.page.max_age', $form_state['values']['page_cache_maximum_age']); - $config->set('response.gzip', $form_state['values']['page_compression']); - $config->set('css.preprocess', $form_state['values']['preprocess_css']); - $config->set('js.preprocess', $form_state['values']['preprocess_js']); - $config->save(); -} - -/** * Submit callback; clear system caches. * * @ingroup forms