diff --git a/core/modules/system/lib/Drupal/system/Controller/ConfigController.php b/core/modules/system/lib/Drupal/system/Controller/ConfigController.php new file mode 100644 index 0000000..c51ed2b --- /dev/null +++ b/core/modules/system/lib/Drupal/system/Controller/ConfigController.php @@ -0,0 +1,69 @@ +status report for more information.', array('@status' => url('admin/reports/status'))), 'error'); + } + $blocks = array(); + if ($system_link = entity_load_multiple_by_properties('menu_link', array('link_path' => 'admin/config', 'module' => 'system'))) { + $system_link = reset($system_link); + $query = Drupal::entityQuery('menu_link') + ->condition('link_path', 'admin/help', '<>') + ->condition('menu_name', $system_link->menu_name) + ->condition('plid', $system_link->id()) + ->condition('hidden', 0); + $result = $query->execute(); + if (!empty($result)) { + $menu_links = menu_link_load_multiple($result); + + foreach ($menu_links as $item) { + _menu_link_translate($item); + if (!$item['access']) { + continue; + } + // The link description, either derived from 'description' in hook_menu() + // or customized via menu module is used as title attribute. + if (!empty($item['localized_options']['attributes']['title'])) { + $item['description'] = $item['localized_options']['attributes']['title']; + unset($item['localized_options']['attributes']['title']); + } + $block = $item; + $block['content'] = ''; + $block['content'] .= theme('admin_block_content', array('content' => system_admin_menu_block($item))); + if (!empty($block['content'])) { + $block['show'] = TRUE; + } + + // Prepare for sorting as in function _menu_tree_check_access(). + // The weight is offset so it is always positive, with a uniform 5-digits. + $blocks[(50000 + $item['weight']) . ' ' . $item['title'] . ' ' . $item['mlid']] = $block; + } + } + } + if ($blocks) { + ksort($blocks); + return theme('admin_page', array('blocks' => $blocks)); + } + else { + return t('You do not have any administrative items.'); + } + } + +} diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index d344d37..430814c 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -13,59 +13,6 @@ use Drupal\Core\Datetime\DrupalDateTime; /** - * Menu callback; Provide the administration overview page. - */ -function system_admin_config_page() { - // Check for status report errors. - if (system_status(TRUE) && user_access('administer site configuration')) { - drupal_set_message(t('One or more problems were detected with your Drupal installation. Check the status report for more information.', array('@status' => url('admin/reports/status'))), 'error'); - } - $blocks = array(); - if ($system_link = entity_load_multiple_by_properties('menu_link', array('link_path' => 'admin/config', 'module' => 'system'))) { - $system_link = reset($system_link); - $query = Drupal::entityQuery('menu_link') - ->condition('link_path', 'admin/help', '<>') - ->condition('menu_name', $system_link->menu_name) - ->condition('plid', $system_link->id()) - ->condition('hidden', 0); - $result = $query->execute(); - if (!empty($result)) { - $menu_links = menu_link_load_multiple($result); - - foreach ($menu_links as $item) { - _menu_link_translate($item); - if (!$item['access']) { - continue; - } - // The link description, either derived from 'description' in hook_menu() - // or customized via menu module is used as title attribute. - if (!empty($item['localized_options']['attributes']['title'])) { - $item['description'] = $item['localized_options']['attributes']['title']; - unset($item['localized_options']['attributes']['title']); - } - $block = $item; - $block['content'] = ''; - $block['content'] .= theme('admin_block_content', array('content' => system_admin_menu_block($item))); - if (!empty($block['content'])) { - $block['show'] = TRUE; - } - - // Prepare for sorting as in function _menu_tree_check_access(). - // The weight is offset so it is always positive, with a uniform 5-digits. - $blocks[(50000 + $item['weight']) . ' ' . $item['title'] . ' ' . $item['mlid']] = $block; - } - } - } - if ($blocks) { - ksort($blocks); - return theme('admin_page', array('blocks' => $blocks)); - } - else { - return t('You do not have any administrative items.'); - } -} - -/** * Provide a single block from the administration menu as a page. * * This function is often a destination for these blocks. diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 08160b7..857eaa7 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -784,15 +784,6 @@ function system_menu() { 'file' => 'system.admin.inc', ); - // Configuration. - $items['admin/config'] = array( - 'title' => 'Configuration', - 'description' => 'Administer settings.', - 'page callback' => 'system_admin_config_page', - 'access arguments' => array('access administration pages'), - 'file' => 'system.admin.inc', - ); - // Media settings. $items['admin/config/media'] = array( 'title' => 'Media', diff --git a/core/modules/system/system.routing.yml b/core/modules/system/system.routing.yml index b285844..6a67ddd 100644 --- a/core/modules/system/system.routing.yml +++ b/core/modules/system/system.routing.yml @@ -73,3 +73,10 @@ system_site_maintenance_mode: _form: 'Drupal\system\Form\SiteMaintenanceModeForm' requirements: _permission: 'administer site configuration' + +system_admin_config: + pattern: '/admin/config' + defaults: + _controller: 'Drupal\system\Controller\ConfigController::getPage' + requirements: + _permission: 'access administration pages'