diff --git a/core/modules/system/lib/Drupal/system/Form/CronForm.php b/core/modules/system/lib/Drupal/system/Form/CronForm.php new file mode 100644 index 0000000..fa9f71d --- /dev/null +++ b/core/modules/system/lib/Drupal/system/Form/CronForm.php @@ -0,0 +1,125 @@ +configFactory = $config_factory; + $this->configFactory->enterContext($context); + $this->state = $key_value_factory->get('state'); + } + + /** + * Implements \Drupal\Core\ControllerInterface::create(). + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('config.factory'), + $container->get('config.context.free'), + $container->get('keyvalue') + ); + } + + /** + * Implements \Drupal\Core\Form\FormInterface::getFormID(). + */ + public function getFormID() { + return 'system_cron_settings'; + } + + /** + * Implements \Drupal\Core\Form\FormInterface::buildForm(). + */ + public function buildForm(array $form, array &$form_state) { + $config = $this->configFactory->get('system.cron'); + + $form['description'] = array( + '#markup' => '

' . t('Cron takes care of running periodic tasks like checking for updates and indexing content for search.') . '

', + ); + $form['run'] = array( + '#type' => 'submit', + '#value' => t('Run cron'), + '#submit' => array(array($this, 'submitCron')), + ); + + $status = '

' . t('Last run: %cron-last ago.', array('%cron-last' => format_interval(REQUEST_TIME - $this->state->get('system.cron_last')))) . '

'; + $form['status'] = array( + '#markup' => $status, + ); + + $form['cron_url'] = array( + '#markup' => '

' . t('To run cron from outside the site, go to !cron', array('!cron' => url('cron/' . $this->state->get('system.cron_key'), array('absolute' => TRUE)))) . '

', + ); + + $form['cron'] = array( + '#type' => 'details', + ); + $form['cron']['cron_safe_threshold'] = array( + '#type' => 'select', + '#title' => t('Run cron every'), + '#default_value' => $config->get('threshold.autorun'), + '#options' => array(0 => t('Never')) + drupal_map_assoc(array(3600, 10800, 21600, 43200, 86400, 604800), 'format_interval'), + ); + + return parent::buildForm($form, $form_state); + } + + /** + * Implements \Drupal\Core\Form\FormInterface::submitForm(). + */ + public function submitForm(array &$form, array &$form_state) { + $this->configFactory->get('system.cron') + ->set('threshold.autorun', $form_state['values']['cron_safe_threshold']) + ->save(); + + parent::submitForm($form, $form_state); + } + + /** + * Runs cron and reloads the page. + */ + public function submitCron(array &$form, array &$form_state) { + // Run cron manually from Cron form. + if (drupal_cron_run()) { + drupal_set_message(t('Cron run successfully.')); + } + else { + drupal_set_message(t('Cron run failed.'), 'error'); + } + + return new RedirectResponse(url('admin/config/system/cron', array('absolute' => TRUE))); + } + +} diff --git a/core/modules/system/lib/Drupal/system/Form/FileSystemForm.php b/core/modules/system/lib/Drupal/system/Form/FileSystemForm.php new file mode 100644 index 0000000..1e159ba --- /dev/null +++ b/core/modules/system/lib/Drupal/system/Form/FileSystemForm.php @@ -0,0 +1,89 @@ +configFactory->get('system.file'); + $form['file_public_path'] = array( + '#type' => 'textfield', + '#title' => t('Public file system path'), + '#default_value' => variable_get('file_public_path', conf_path() . '/files'), + '#maxlength' => 255, + '#description' => t('A local file system path where public files will be stored. This directory must exist and be writable by Drupal. This directory must be relative to the Drupal installation directory and be accessible over the web.'), + '#after_build' => array('system_check_directory'), + ); + + $form['file_private_path'] = array( + '#type' => 'textfield', + '#title' => t('Private file system path'), + '#default_value' => $config->get('path.private'), + '#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 more information about securing private files.', array('@handbook' => 'http://drupal.org/documentation/modules/file')), + '#after_build' => array('system_check_directory'), + ); + + $form['file_temporary_path'] = array( + '#type' => 'textfield', + '#title' => t('Temporary directory'), + '#default_value' => $config->get('path.temporary'), + '#maxlength' => 255, + '#description' => t('A local file system path where temporary files will be stored. This directory should not be accessible over the web.'), + '#after_build' => array('system_check_directory'), + ); + // Any visible, writeable wrapper can potentially be used for the files + // directory, including a remote file system that integrates with a CDN. + foreach (file_get_stream_wrappers(STREAM_WRAPPERS_WRITE_VISIBLE) as $scheme => $info) { + $options[$scheme] = check_plain($info['description']); + } + + if (!empty($options)) { + $form['file_default_scheme'] = array( + '#type' => 'radios', + '#title' => t('Default download method'), + '#default_value' => $config->get('default_scheme'), + '#options' => $options, + '#description' => t('This setting is used as the preferred download method. The use of public files is more efficient, but does not provide any access control.'), + ); + } + + return parent::buildForm($form, $form_state); + } + + /** + * Implements \Drupal\Core\Form\FormInterface::submitForm(). + */ + public function submitForm(array &$form, array &$form_state) { + $config = $this->configFactory->get('system.file') + ->set('path.private', $form_state['values']['file_private_path']) + ->set('path.temporary', $form_state['values']['file_temporary_path']); + variable_set('file_public_path', $form_state['values']['file_public_path']); + + if (isset($form_state['values']['file_default_scheme'])) { + $config->set('default_scheme', $form_state['values']['file_default_scheme']); + } + $config->save(); + + parent::submitForm($form, $form_state); + } + +} diff --git a/core/modules/system/lib/Drupal/system/Form/LoggingForm.php b/core/modules/system/lib/Drupal/system/Form/LoggingForm.php new file mode 100644 index 0000000..1f38ae8 --- /dev/null +++ b/core/modules/system/lib/Drupal/system/Form/LoggingForm.php @@ -0,0 +1,54 @@ +configFactory->get('system.logging'); + $form['error_level'] = array( + '#type' => 'radios', + '#title' => t('Error messages to display'), + '#default_value' => $config->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 parent::buildForm($form, $form_state); + } + + /** + * Implements \Drupal\Core\Form\FormInterface::submitForm(). + */ + public function submitForm(array &$form, array &$form_state) { + $this->configFactory->get('system.logging') + ->set('error_level', $form_state['values']['error_level']) + ->save(); + + parent::submitForm($form, $form_state); + } + +} diff --git a/core/modules/system/lib/Drupal/system/Form/PerformanceForm.php b/core/modules/system/lib/Drupal/system/Form/PerformanceForm.php new file mode 100644 index 0000000..288d2af --- /dev/null +++ b/core/modules/system/lib/Drupal/system/Form/PerformanceForm.php @@ -0,0 +1,142 @@ +configFactory->get('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(array($this, 'submitCacheClear')), + ); + + $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 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'][] = array('systemClearPageCacheSubmit'); + $form['#submit'][] = array('submitForm'); + + return parent::buildForm($form, $form_state); + } + + /** + * Implements \Drupal\Core\Form\FormInterface::submitForm(). + */ + public function submitForm(array &$form, array &$form_state) { + $config = $this->configFactory->get('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(); + + parent::submitForm($form, $form_state); + } + + /** + * Clears the caches. + */ + public function submitCacheClear(array &$form, array &$form_state) { + drupal_flush_all_caches(); + drupal_set_message(t('Caches cleared.')); + } + + /** + * Submit callback; clear the page cache. + * + * @ingroup forms + */ + public function systemClearPageCacheSubmit(array $form, array &$form_state) { + cache('page')->deleteAll(); + } + +} diff --git a/core/modules/system/lib/Drupal/system/Form/RegionalForm.php b/core/modules/system/lib/Drupal/system/Form/RegionalForm.php new file mode 100644 index 0000000..b202975 --- /dev/null +++ b/core/modules/system/lib/Drupal/system/Form/RegionalForm.php @@ -0,0 +1,123 @@ +configFactory->get('system.timezone'); + $system_date = $this->configFactory->get('system.date'); + + // Date settings: + $zones = system_time_zones(); + + $form['locale'] = array( + '#type' => 'details', + '#title' => t('Locale'), + ); + + $form['locale']['site_default_country'] = array( + '#type' => 'select', + '#title' => t('Default country'), + '#empty_value' => '', + '#default_value' => $system_date->get('country.default'), + '#options' => $countries, + '#attributes' => array('class' => array('country-detect')), + ); + + $form['locale']['date_first_day'] = array( + '#type' => 'select', + '#title' => t('First day of week'), + '#default_value' => $system_date->get('first_day'), + '#options' => array(0 => t('Sunday'), 1 => t('Monday'), 2 => t('Tuesday'), 3 => t('Wednesday'), 4 => t('Thursday'), 5 => t('Friday'), 6 => t('Saturday')), + ); + + $form['timezone'] = array( + '#type' => 'details', + '#title' => t('Time zones'), + ); + + $form['timezone']['date_default_timezone'] = array( + '#type' => 'select', + '#title' => t('Default time zone'), + '#default_value' => $system_timezone->get('default') ?: date_default_timezone_get(), + '#options' => $zones, + ); + + $configurable_timezones = $system_timezone->get('user.configurable'); + $form['timezone']['configurable_timezones'] = array( + '#type' => 'checkbox', + '#title' => t('Users may set their own time zone.'), + '#default_value' => $configurable_timezones, + ); + + $form['timezone']['configurable_timezones_wrapper'] = array( + '#type' => 'container', + '#states' => array( + // Hide the user configured timezone settings when users are forced to use + // the default setting. + 'invisible' => array( + 'input[name="configurable_timezones"]' => array('checked' => FALSE), + ), + ), + ); + $form['timezone']['configurable_timezones_wrapper']['empty_timezone_message'] = array( + '#type' => 'checkbox', + '#title' => t('Remind users at login if their time zone is not set.'), + '#default_value' => $system_timezone->get('user.warn'), + '#description' => t('Only applied if users may set their own time zone.') + ); + + $form['timezone']['configurable_timezones_wrapper']['user_default_timezone'] = array( + '#type' => 'radios', + '#title' => t('Time zone for new users'), + '#default_value' => $system_timezone->get('user.default'), + '#options' => array( + DRUPAL_USER_TIMEZONE_DEFAULT => t('Default time zone.'), + DRUPAL_USER_TIMEZONE_EMPTY => t('Empty time zone.'), + DRUPAL_USER_TIMEZONE_SELECT => t('Users may set their own time zone at registration.'), + ), + '#description' => t('Only applied if users may set their own time zone.') + ); + + return parent::buildForm($form, $form_state); + } + + /** + * Implements \Drupal\Core\Form\FormInterface::submitForm(). + */ + public function submitForm(array &$form, array &$form_state) { + $this->configFactory->get('system.date') + ->set('country.default', $form_state['values']['site_default_country']) + ->set('first_day', $form_state['values']['date_first_day']) + ->save(); + $this->configFactory->get('system.timezone') + ->set('default', $form_state['values']['date_default_timezone']) + ->set('user.configurable', $form_state['values']['configurable_timezones']) + ->set('user.warn', $form_state['values']['empty_timezone_message']) + ->set('user.default', $form_state['values']['user_default_timezone']) + ->save(); + + parent::submitForm($form, $form_state); + } + +} diff --git a/core/modules/system/lib/Drupal/system/Form/RssFeedsForm.php b/core/modules/system/lib/Drupal/system/Form/RssFeedsForm.php new file mode 100644 index 0000000..cd4a35b --- /dev/null +++ b/core/modules/system/lib/Drupal/system/Form/RssFeedsForm.php @@ -0,0 +1,68 @@ +configFactory->get('system.rss'); + $form['feed_description'] = array( + '#type' => 'textarea', + '#title' => t('Feed description'), + '#default_value' => $rss_config->get('channel.description'), + '#description' => t('Description of your site, included in each feed.') + ); + $form['feed_default_items'] = array( + '#type' => 'select', + '#title' => t('Number of items in each feed'), + '#default_value' => $rss_config->get('items.limit'), + '#options' => drupal_map_assoc(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.') + ); + $form['feed_item_length'] = array( + '#type' => 'select', + '#title' => t('Feed content'), + '#default_value' => $rss_config->get('items.view_mode'), + '#options' => array( + 'title' => t('Titles only'), + 'teaser' => t('Titles plus teaser'), + 'fulltext' => t('Full text'), + ), + '#description' => t('Global setting for the default display of content items in each feed.') + ); + + return parent::buildForm($form, $form_state); + } + + /** + * Implements \Drupal\Core\Form\FormInterface::submitForm(). + */ + public function submitForm(array &$form, array &$form_state) { + $this->configFactory->get('system.rss') + ->set('channel.description', $form_state['values']['feed_description']) + ->set('items.limit', $form_state['values']['feed_default_items']) + ->set('items.view_mode', $form_state['values']['feed_item_length']) + ->save(); + + parent::submitForm($form, $form_state); + } + +} diff --git a/core/modules/system/lib/Drupal/system/Form/SiteInformationForm.php b/core/modules/system/lib/Drupal/system/Form/SiteInformationForm.php new file mode 100644 index 0000000..1f32a85 --- /dev/null +++ b/core/modules/system/lib/Drupal/system/Form/SiteInformationForm.php @@ -0,0 +1,144 @@ +configFactory->get('system.site'); + $site_mail = $site_config->get('mail'); + if (empty($site_mail)) { + $site_mail = ini_get('sendmail_from'); + } + + $form['site_information'] = array( + '#type' => 'details', + '#title' => t('Site details'), + ); + $form['site_information']['site_name'] = array( + '#type' => 'textfield', + '#title' => t('Site name'), + '#default_value' => $site_config->get('name'), + '#required' => TRUE + ); + $form['site_information']['site_slogan'] = array( + '#type' => 'textfield', + '#title' => t('Slogan'), + '#default_value' => $site_config->get('slogan'), + '#description' => t("How this is used depends on your site's theme."), + ); + $form['site_information']['site_mail'] = array( + '#type' => 'email', + '#title' => t('E-mail address'), + '#default_value' => $site_mail, + '#description' => t("The From 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.)"), + '#required' => TRUE, + ); + $form['front_page'] = array( + '#type' => 'details', + '#title' => t('Front page'), + ); + $front_page = $site_config->get('page.front') != 'user' ? drupal_container()->get('path.alias_manager')->getPathAlias($site_config->get('page.front')) : ''; + $form['front_page']['site_frontpage'] = array( + '#type' => 'textfield', + '#title' => t('Default front page'), + '#default_value' => $front_page, + '#size' => 40, + '#description' => t('Optionally, specify a relative URL to display as the front page. Leave blank to display the default front page.'), + '#field_prefix' => url(NULL, array('absolute' => TRUE)), + ); + $form['error_page'] = array( + '#type' => 'details', + '#title' => t('Error pages'), + ); + $form['error_page']['site_403'] = array( + '#type' => 'textfield', + '#title' => t('Default 403 (access denied) page'), + '#default_value' => $site_config->get('page.403'), + '#size' => 40, + '#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.'), + '#field_prefix' => url(NULL, array('absolute' => TRUE)), + ); + $form['error_page']['site_404'] = array( + '#type' => 'textfield', + '#title' => t('Default 404 (not found) page'), + '#default_value' => $site_config->get('page.404'), + '#size' => 40, + '#description' => t('This page is displayed when no other content matches the requested document. Leave blank to display a generic "page not found" page.'), + '#field_prefix' => url(NULL, array('absolute' => TRUE)), + ); + + return parent::buildForm($form, $form_state); + } + + /** + * Implements \Drupal\Core\Form\FormInterface::validateForm(). + */ + public function validateForm(array &$form, array &$form_state) { + // Check for empty front page path. + if (empty($form_state['values']['site_frontpage'])) { + // Set to default "user". + form_set_value($form['front_page']['site_frontpage'], 'user', $form_state); + } + else { + // Get the normal path of the front page. + form_set_value($form['front_page']['site_frontpage'], drupal_container()->get('path.alias_manager')->getSystemPath($form_state['values']['site_frontpage']), $form_state); + } + // Validate front page path. + if (!drupal_valid_path($form_state['values']['site_frontpage'])) { + form_set_error('site_frontpage', t("The path '%path' is either invalid or you do not have access to it.", array('%path' => $form_state['values']['site_frontpage']))); + } + // Get the normal paths of both error pages. + if (!empty($form_state['values']['site_403'])) { + form_set_value($form['error_page']['site_403'], drupal_container()->get('path.alias_manager')->getSystemPath($form_state['values']['site_403']), $form_state); + } + if (!empty($form_state['values']['site_404'])) { + form_set_value($form['error_page']['site_404'], drupal_container()->get('path.alias_manager')->getSystemPath($form_state['values']['site_404']), $form_state); + } + // Validate 403 error path. + if (!empty($form_state['values']['site_403']) && !drupal_valid_path($form_state['values']['site_403'])) { + form_set_error('site_403', t("The path '%path' is either invalid or you do not have access to it.", array('%path' => $form_state['values']['site_403']))); + } + // Validate 404 error path. + if (!empty($form_state['values']['site_404']) && !drupal_valid_path($form_state['values']['site_404'])) { + form_set_error('site_404', t("The path '%path' is either invalid or you do not have access to it.", array('%path' => $form_state['values']['site_404']))); + } + + parent::validateForm($form, $form_state); + } + + /** + * Implements \Drupal\Core\Form\FormInterface::submitForm(). + */ + public function submitForm(array &$form, array &$form_state) { + $this->configFactory->get('system.site') + ->set('name', $form_state['values']['site_name']) + ->set('mail', $form_state['values']['site_mail']) + ->set('slogan', $form_state['values']['site_slogan']) + ->set('page.front', $form_state['values']['site_frontpage']) + ->set('page.403', $form_state['values']['site_403']) + ->set('page.404', $form_state['values']['site_404']) + ->save(); + + parent::submitForm($form, $form_state); + } + +} diff --git a/core/modules/system/lib/Drupal/system/Form/SiteMaintenanceModeForm.php b/core/modules/system/lib/Drupal/system/Form/SiteMaintenanceModeForm.php new file mode 100644 index 0000000..1827124 --- /dev/null +++ b/core/modules/system/lib/Drupal/system/Form/SiteMaintenanceModeForm.php @@ -0,0 +1,54 @@ +configFactory->get('system.maintenance'); + $form['maintenance_mode'] = array( + '#type' => 'checkbox', + '#title' => t('Put site into maintenance mode'), + '#default_value' => $config->get('enabled'), + '#description' => t('Visitors will only see the maintenance mode message. Only users with the "Access site in maintenance mode" permission will be able to access the site. Authorized users can log in directly via the user login page.', array('@permissions-url' => url('admin/config/people/permissions'), '@user-login' => url('user'))), + ); + $form['maintenance_mode_message'] = array( + '#type' => 'textarea', + '#title' => t('Message to display when in maintenance mode'), + '#default_value' => $config->get('message'), + ); + + return parent::buildForm($form, $form_state); + } + + /** + * Implements \Drupal\Core\Form\FormInterface::submitForm(). + */ + public function submitForm(array &$form, array &$form_state) { + $this->configFactory->get('system.maintenance') + ->set('enabled', $form_state['values']['maintenance_mode']) + ->set('message', $form_state['values']['maintenance_mode_message']) + ->save(); + + parent::submitForm($form, $form_state); + } + +} diff --git a/core/modules/system/lib/Drupal/system/Form/SystemFormBase.php b/core/modules/system/lib/Drupal/system/Form/SystemFormBase.php new file mode 100644 index 0000000..ca40ea2 --- /dev/null +++ b/core/modules/system/lib/Drupal/system/Form/SystemFormBase.php @@ -0,0 +1,43 @@ +configFactory = $config_factory; + $this->configFactory->enterContext($context); + } + + /** + * Implements \Drupal\Core\ControllerInterface::create(). + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('config.factory'), + $container->get('config.context.free') + ); + } + +} diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index dbdf6a5..7f3d693 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -1400,433 +1400,6 @@ function system_modules_uninstall_submit($form, &$form_state) { } /** - * Form builder; The general site information form. - * - * @ingroup forms - * @see system_settings_form() - */ -function system_site_information_settings($form, &$form_state) { - config_context_enter('config.context.free'); - $site_config = config('system.site'); - $site_mail = $site_config->get('mail'); - if (empty($site_mail)) { - $site_mail = ini_get('sendmail_from'); - } - - $form['site_information'] = array( - '#type' => 'details', - '#title' => t('Site details'), - ); - $form['site_information']['site_name'] = array( - '#type' => 'textfield', - '#title' => t('Site name'), - '#default_value' => $site_config->get('name'), - '#required' => TRUE - ); - $form['site_information']['site_slogan'] = array( - '#type' => 'textfield', - '#title' => t('Slogan'), - '#default_value' => $site_config->get('slogan'), - '#description' => t("How this is used depends on your site's theme."), - ); - $form['site_information']['site_mail'] = array( - '#type' => 'email', - '#title' => t('E-mail address'), - '#default_value' => $site_mail, - '#description' => t("The From 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.)"), - '#required' => TRUE, - ); - $form['front_page'] = array( - '#type' => 'details', - '#title' => t('Front page'), - ); - $front_page = $site_config->get('page.front') != 'user' ? drupal_container()->get('path.alias_manager')->getPathAlias($site_config->get('page.front')) : ''; - $form['front_page']['site_frontpage'] = array( - '#type' => 'textfield', - '#title' => t('Default front page'), - '#default_value' => $front_page, - '#size' => 40, - '#description' => t('Optionally, specify a relative URL to display as the front page. Leave blank to display the default front page.'), - '#field_prefix' => url(NULL, array('absolute' => TRUE)), - ); - $form['error_page'] = array( - '#type' => 'details', - '#title' => t('Error pages'), - ); - $form['error_page']['site_403'] = array( - '#type' => 'textfield', - '#title' => t('Default 403 (access denied) page'), - '#default_value' => $site_config->get('page.403'), - '#size' => 40, - '#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.'), - '#field_prefix' => url(NULL, array('absolute' => TRUE)), - ); - $form['error_page']['site_404'] = array( - '#type' => 'textfield', - '#title' => t('Default 404 (not found) page'), - '#default_value' => $site_config->get('page.404'), - '#size' => 40, - '#description' => t('This page is displayed when no other content matches the requested document. Leave blank to display a generic "page not found" page.'), - '#field_prefix' => url(NULL, array('absolute' => TRUE)), - ); - - $form['#validate'][] = 'system_site_information_settings_validate'; - - return system_config_form($form, $form_state); -} - -/** - * Validates the submitted site-information form. - */ -function system_site_information_settings_validate($form, &$form_state) { - // Check for empty front page path. - if (empty($form_state['values']['site_frontpage'])) { - // Set to default "user". - form_set_value($form['front_page']['site_frontpage'], 'user', $form_state); - } - else { - // Get the normal path of the front page. - form_set_value($form['front_page']['site_frontpage'], drupal_container()->get('path.alias_manager')->getSystemPath($form_state['values']['site_frontpage']), $form_state); - } - // Validate front page path. - if (!drupal_valid_path($form_state['values']['site_frontpage'])) { - form_set_error('site_frontpage', t("The path '%path' is either invalid or you do not have access to it.", array('%path' => $form_state['values']['site_frontpage']))); - } - // Get the normal paths of both error pages. - if (!empty($form_state['values']['site_403'])) { - form_set_value($form['error_page']['site_403'], drupal_container()->get('path.alias_manager')->getSystemPath($form_state['values']['site_403']), $form_state); - } - if (!empty($form_state['values']['site_404'])) { - form_set_value($form['error_page']['site_404'], drupal_container()->get('path.alias_manager')->getSystemPath($form_state['values']['site_404']), $form_state); - } - // Validate 403 error path. - if (!empty($form_state['values']['site_403']) && !drupal_valid_path($form_state['values']['site_403'])) { - form_set_error('site_403', t("The path '%path' is either invalid or you do not have access to it.", array('%path' => $form_state['values']['site_403']))); - } - // Validate 404 error path. - if (!empty($form_state['values']['site_404']) && !drupal_valid_path($form_state['values']['site_404'])) { - form_set_error('site_404', t("The path '%path' is either invalid or you do not have access to it.", array('%path' => $form_state['values']['site_404']))); - } -} - -/** - * Form submission handler for system_site_information_settings(). - */ -function system_site_information_settings_submit($form, &$form_state) { - config_context_enter('config.context.free'); - config('system.site') - ->set('name', $form_state['values']['site_name']) - ->set('mail', $form_state['values']['site_mail']) - ->set('slogan', $form_state['values']['site_slogan']) - ->set('page.front', $form_state['values']['site_frontpage']) - ->set('page.403', $form_state['values']['site_403']) - ->set('page.404', $form_state['values']['site_404']) - ->save(); -} - -/** - * Form builder; Cron form. - * - * @ingroup forms - */ -function system_cron_settings($form, &$form_state) { - config_context_enter('config.context.free'); - $form['description'] = array( - '#markup' => '

' . t('Cron takes care of running periodic tasks like checking for updates and indexing content for search.') . '

', - ); - $form['run'] = array( - '#type' => 'submit', - '#value' => t('Run cron'), - '#submit' => array('system_run_cron_submit'), - ); - - $status = '

' . t('Last run: %cron-last ago.', array('%cron-last' => format_interval(REQUEST_TIME - state()->get('system.cron_last')))) . '

'; - $form['status'] = array( - '#markup' => $status, - ); - - $form['cron_url'] = array( - '#markup' => '

' . t('To run cron from outside the site, go to !cron', array('!cron' => url('cron/' . state()->get('system.cron_key'), array('absolute' => TRUE)))) . '

', - ); - - $form['cron'] = array( - '#type' => 'details', - ); - $form['cron']['cron_safe_threshold'] = array( - '#type' => 'select', - '#title' => t('Run cron every'), - '#default_value' => config('system.cron')->get('threshold.autorun'), - '#options' => array(0 => t('Never')) + drupal_map_assoc(array(3600, 10800, 21600, 43200, 86400, 604800), 'format_interval'), - ); - - return system_config_form($form, $form_state); -} - -/** - * Form builder submit handler; Handle submission for cron settings. - * - * @ingroup forms - */ -function system_cron_settings_submit($form, &$form_state) { - config_context_enter('config.context.free'); - config('system.cron') - ->set('threshold.autorun', $form_state['values']['cron_safe_threshold']) - ->save(); -} - -/** - * Submit callback; run cron. - * - * @ingroup forms - */ -function system_run_cron_submit($form, &$form_state) { - // Run cron manually from Cron form. - if (drupal_cron_run()) { - drupal_set_message(t('Cron run successfully.')); - } - else { - drupal_set_message(t('Cron run failed.'), 'error'); - } - - drupal_goto('admin/config/system/cron'); -} - -/** - * 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 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 - */ -function system_clear_cache_submit($form, &$form_state) { - drupal_flush_all_caches(); - drupal_set_message(t('Caches cleared.')); -} - -/** - * Submit callback; clear the page cache. - * - * @ingroup forms - */ -function system_clear_page_cache_submit($form, &$form_state) { - cache('page')->deleteAll(); -} - -/** - * Form builder; Configure the site file handling. - * - * @ingroup forms - * @see system_settings_form_sumbit() - */ -function system_file_system_settings($form, $form_state) { - $config = config('system.file'); - $form['file_public_path'] = array( - '#type' => 'textfield', - '#title' => t('Public file system path'), - '#default_value' => variable_get('file_public_path', conf_path() . '/files'), - '#maxlength' => 255, - '#description' => t('A local file system path where public files will be stored. This directory must exist and be writable by Drupal. This directory must be relative to the Drupal installation directory and be accessible over the web.'), - '#after_build' => array('system_check_directory'), - ); - - $form['file_private_path'] = array( - '#type' => 'textfield', - '#title' => t('Private file system path'), - '#default_value' => $config->get('path.private'), - '#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 more information about securing private files.', array('@handbook' => 'http://drupal.org/documentation/modules/file')), - '#after_build' => array('system_check_directory'), - ); - - $form['file_temporary_path'] = array( - '#type' => 'textfield', - '#title' => t('Temporary directory'), - '#default_value' => $config->get('path.temporary'), - '#maxlength' => 255, - '#description' => t('A local file system path where temporary files will be stored. This directory should not be accessible over the web.'), - '#after_build' => array('system_check_directory'), - ); - // Any visible, writeable wrapper can potentially be used for the files - // directory, including a remote file system that integrates with a CDN. - foreach (file_get_stream_wrappers(STREAM_WRAPPERS_WRITE_VISIBLE) as $scheme => $info) { - $options[$scheme] = check_plain($info['description']); - } - - if (!empty($options)) { - $form['file_default_scheme'] = array( - '#type' => 'radios', - '#title' => t('Default download method'), - '#default_value' => $config->get('default_scheme'), - '#options' => $options, - '#description' => t('This setting is used as the preferred download method. The use of public files is more efficient, but does not provide any access control.'), - ); - } - - return system_config_form($form, $form_state); -} - -/** - * Save configuration values for file system. - * - * @ingroup forms - * @see system_file_system_settings() - */ -function system_file_system_settings_submit($form, &$form_state) { - $config = config('system.file') - ->set('path.private', $form_state['values']['file_private_path']) - ->set('path.temporary', $form_state['values']['file_temporary_path']); - variable_set('file_public_path', $form_state['values']['file_public_path']); - - - if(isset($form_state['values']['file_default_scheme'])) { - $config->set('default_scheme', $form_state['values']['file_default_scheme']); - } - $config->save(); -} - -/** * Form builder; Configure site image toolkit usage. * * @ingroup forms @@ -1892,199 +1465,6 @@ function system_image_toolkit_settings_submit($form, &$form_state) { } /** - * Form builder; Configure how the site handles RSS feeds. - * - * @ingroup forms - */ -function system_rss_feeds_settings($form, &$form_state) { - config_context_enter('config.context.free'); - $rss_config = config('system.rss'); - $form['feed_description'] = array( - '#type' => 'textarea', - '#title' => t('Feed description'), - '#default_value' => $rss_config->get('channel.description'), - '#description' => t('Description of your site, included in each feed.') - ); - $form['feed_default_items'] = array( - '#type' => 'select', - '#title' => t('Number of items in each feed'), - '#default_value' => $rss_config->get('items.limit'), - '#options' => drupal_map_assoc(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.') - ); - $form['feed_item_length'] = array( - '#type' => 'select', - '#title' => t('Feed content'), - '#default_value' => $rss_config->get('items.view_mode'), - '#options' => array( - 'title' => t('Titles only'), - 'teaser' => t('Titles plus teaser'), - 'fulltext' => t('Full text'), - ), - '#description' => t('Global setting for the default display of content items in each feed.') - ); - - return system_config_form($form, $form_state); -} - -/** - * Form builder submit handler; Handle submission for RSS feeds settings. - * - * @ingroup forms - */ -function system_rss_feeds_settings_submit($form, &$form_state) { - config_context_enter('config.context.free'); - config('system.rss') - ->set('channel.description', $form_state['values']['feed_description']) - ->set('items.limit', $form_state['values']['feed_default_items']) - ->set('items.view_mode', $form_state['values']['feed_item_length']) - ->save(); -} - -/** - * Form builder; Configure the site regional settings. - * - * @ingroup forms - * @see system_config_form() - * @see system_regional_settings_submit() - */ -function system_regional_settings($form, &$form_state) { - $countries = country_get_list(); - $system_timezone = config('system.timezone'); - $system_date = config('system.date'); - - // Date settings: - $zones = system_time_zones(); - - $form['locale'] = array( - '#type' => 'details', - '#title' => t('Locale'), - ); - - $form['locale']['site_default_country'] = array( - '#type' => 'select', - '#title' => t('Default country'), - '#empty_value' => '', - '#default_value' => $system_date->get('country.default'), - '#options' => $countries, - '#attributes' => array('class' => array('country-detect')), - ); - - $form['locale']['date_first_day'] = array( - '#type' => 'select', - '#title' => t('First day of week'), - '#default_value' => $system_date->get('first_day'), - '#options' => array(0 => t('Sunday'), 1 => t('Monday'), 2 => t('Tuesday'), 3 => t('Wednesday'), 4 => t('Thursday'), 5 => t('Friday'), 6 => t('Saturday')), - ); - - $form['timezone'] = array( - '#type' => 'details', - '#title' => t('Time zones'), - ); - - $form['timezone']['date_default_timezone'] = array( - '#type' => 'select', - '#title' => t('Default time zone'), - '#default_value' => $system_timezone->get('default') ?: date_default_timezone_get(), - '#options' => $zones, - ); - - $configurable_timezones = $system_timezone->get('user.configurable'); - $form['timezone']['configurable_timezones'] = array( - '#type' => 'checkbox', - '#title' => t('Users may set their own time zone.'), - '#default_value' => $configurable_timezones, - ); - - $form['timezone']['configurable_timezones_wrapper'] = array( - '#type' => 'container', - '#states' => array( - // Hide the user configured timezone settings when users are forced to use - // the default setting. - 'invisible' => array( - 'input[name="configurable_timezones"]' => array('checked' => FALSE), - ), - ), - ); - $form['timezone']['configurable_timezones_wrapper']['empty_timezone_message'] = array( - '#type' => 'checkbox', - '#title' => t('Remind users at login if their time zone is not set.'), - '#default_value' => $system_timezone->get('user.warn'), - '#description' => t('Only applied if users may set their own time zone.') - ); - - $form['timezone']['configurable_timezones_wrapper']['user_default_timezone'] = array( - '#type' => 'radios', - '#title' => t('Time zone for new users'), - '#default_value' => $system_timezone->get('user.default'), - '#options' => array( - DRUPAL_USER_TIMEZONE_DEFAULT => t('Default time zone.'), - DRUPAL_USER_TIMEZONE_EMPTY => t('Empty time zone.'), - DRUPAL_USER_TIMEZONE_SELECT => t('Users may set their own time zone at registration.'), - ), - '#description' => t('Only applied if users may set their own time zone.') - ); - - return system_config_form($form, $form_state); -} - -/** - * Form builder submit handler; Handles submission for regional settings. - * - * @ingroup forms - * @see system_regional_settings() - */ -function system_regional_settings_submit($form, &$form_state) { - config('system.date') - ->set('country.default', $form_state['values']['site_default_country']) - ->set('first_day', $form_state['values']['date_first_day']) - ->save(); - config('system.timezone') - ->set('default', $form_state['values']['date_default_timezone']) - ->set('user.configurable', $form_state['values']['configurable_timezones']) - ->set('user.warn', $form_state['values']['empty_timezone_message']) - ->set('user.default', $form_state['values']['user_default_timezone']) - ->save(); -} - -/** - * Form builder; Configure the site's maintenance status. - * - * @ingroup forms - * @see system_site_maintenance_mode_submit() - */ -function system_site_maintenance_mode($form, &$form_state) { - config_context_enter('config.context.free'); - $config = config('system.maintenance'); - $form['maintenance_mode'] = array( - '#type' => 'checkbox', - '#title' => t('Put site into maintenance mode'), - '#default_value' => $config->get('enabled'), - '#description' => t('Visitors will only see the maintenance mode message. Only users with the "Access site in maintenance mode" permission will be able to access the site. Authorized users can log in directly via the user login page.', array('@permissions-url' => url('admin/config/people/permissions'), '@user-login' => url('user'))), - ); - $form['maintenance_mode_message'] = array( - '#type' => 'textarea', - '#title' => t('Message to display when in maintenance mode'), - '#default_value' => $config->get('message'), - ); - - return system_config_form($form, $form_state); -} - -/** - * Form submission handler for system_site_maintenance_mode(). - * - * @ingroup forms - */ -function system_site_maintenance_mode_submit($form, &$form_state) { - config_context_enter('config.context.free'); - config('system.maintenance') - ->set('enabled', $form_state['values']['maintenance_mode']) - ->set('message', $form_state['values']['maintenance_mode_message']) - ->save(); -} - -/** * Menu callback: displays the site status report. Can also be used as a pure check. * * @param $check diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 5a90e3e..3e937f1 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -802,11 +802,9 @@ function system_menu() { $items['admin/config/media/file-system'] = array( 'title' => 'File system', 'description' => 'Tell Drupal where to store uploaded files and how they are accessed.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_file_system_settings'), + 'route_name' => 'system_file_system_settings', 'access arguments' => array('administer site configuration'), 'weight' => -10, - 'file' => 'system.admin.inc', ); $items['admin/config/media/image-toolkit'] = array( 'title' => 'Image toolkit', @@ -831,10 +829,8 @@ function system_menu() { $items['admin/config/services/rss-publishing'] = array( 'title' => 'RSS publishing', 'description' => 'Configure the site description, the number of items per feed and whether feeds should be titles/teasers/full-text.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_rss_feeds_settings'), + 'route_name' => 'system_rss_feeds_settings', 'access arguments' => array('administer site configuration'), - 'file' => 'system.admin.inc', ); // Development settings. @@ -850,28 +846,22 @@ function system_menu() { $items['admin/config/development/maintenance'] = array( 'title' => 'Maintenance mode', 'description' => 'Take the site offline for maintenance or bring it back online.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_site_maintenance_mode'), + 'route_name' => 'system_site_maintenance_mode', 'access arguments' => array('administer site configuration'), - 'file' => 'system.admin.inc', 'weight' => -10, ); $items['admin/config/development/performance'] = array( 'title' => 'Performance', 'description' => 'Enable or disable page caching for anonymous users and set CSS and JS bandwidth optimization options.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_performance_settings'), + 'route_name' => 'system_performance_settings', 'access arguments' => array('administer site configuration'), - 'file' => 'system.admin.inc', 'weight' => -20, ); $items['admin/config/development/logging'] = array( 'title' => 'Logging and errors', 'description' => "Settings for logging and alerts modules. Various modules can route Drupal's system events to different destinations, such as syslog, database, email, etc.", - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_logging_settings'), + 'route_name' => 'system_logging_settings', 'access arguments' => array('administer site configuration'), - 'file' => 'system.admin.inc', 'weight' => -15, ); @@ -888,11 +878,9 @@ function system_menu() { $items['admin/config/regional/settings'] = array( 'title' => 'Regional settings', 'description' => "Settings for the site's default time zone and country.", - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_regional_settings'), + 'route_name' => 'system_regional_settings', 'access arguments' => array('administer site configuration'), 'weight' => -20, - 'file' => 'system.admin.inc', ); $items['admin/config/regional/date-time'] = array( 'title' => 'Formats', @@ -960,19 +948,15 @@ function system_menu() { $items['admin/config/system/site-information'] = array( 'title' => 'Site information', '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'), + 'route_name' => 'system_site_information_settings', 'access arguments' => array('administer site configuration'), - 'file' => 'system.admin.inc', 'weight' => -20, ); $items['admin/config/system/cron'] = array( 'title' => 'Cron', 'description' => 'Manage automatic site maintenance tasks.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_cron_settings'), + 'route_name' => 'system_cron_settings', 'access arguments' => array('administer site configuration'), - 'file' => 'system.admin.inc', 'weight' => 20, ); // Additional categories diff --git a/core/modules/system/system.routing.yml b/core/modules/system/system.routing.yml index 085895e..b5f2d20 100644 --- a/core/modules/system/system.routing.yml +++ b/core/modules/system/system.routing.yml @@ -4,3 +4,59 @@ system.cron: _controller: '\Drupal\system\CronController::run' requirements: _access_system_cron: 'TRUE' + +system_site_information_settings: + pattern: '/admin/config/system/site-information' + defaults: + _form: 'Drupal\system\Form\SiteInformationForm' + requirements: + _permission: 'administer site configuration' + +system_cron_settings: + pattern: '/admin/config/system/cron' + defaults: + _form: 'Drupal\system\Form\CronForm' + requirements: + _permission: 'administer site configuration' + +system_logging_settings: + pattern: '/admin/config/development/logging' + defaults: + _form: 'Drupal\system\Form\LoggingForm' + requirements: + _permission: 'administer site configuration' + +system_performance_settings: + pattern: '/admin/config/development/performance' + defaults: + _form: 'Drupal\system\Form\PerformanceForm' + requirements: + _permission: 'administer site configuration' + +system_file_system_settings: + pattern: '/admin/config/media/file-system' + defaults: + _form: 'Drupal\system\Form\FileSystemForm' + requirements: + _permission: 'administer site configuration' + +system_rss_feeds_settings: + pattern: '/admin/config/services/rss-publishing' + defaults: + _form: 'Drupal\system\Form\RssFeedsForm' + requirements: + _permission: 'administer site configuration' + +system_regional_settings: + pattern: '/admin/config/regional/settings' + defaults: + _form: 'Drupal\system\Form\RegionalForm' + requirements: + _permission: 'administer site configuration' + +system_site_maintenance_mode: + pattern: '/admin/config/development/maintenance' + defaults: + _form: 'Drupal\system\Form\SiteMaintenanceModeForm' + requirements: + _permission: 'administer site configuration'