diff --git a/core/modules/system/lib/Drupal/system/Controller/SystemController.php b/core/modules/system/lib/Drupal/system/Controller/SystemController.php new file mode 100644 index 0000000..8b67388 --- /dev/null +++ b/core/modules/system/lib/Drupal/system/Controller/SystemController.php @@ -0,0 +1,61 @@ + $content)); + } + else { + $output = t('You do not have any administrative items.'); + } + return $output; + } + + /** + * Prints a listing of all books. + * + * @return string + * A HTML-formatted string with the listing of all books content. + */ + public function bookRender() { + } + +} diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index c6002f9..2a180d6 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -66,28 +66,6 @@ function system_admin_config_page() { } /** - * Provide a single block from the administration menu as a page. - * - * This function is often a destination for these blocks. - * For example, 'admin/structure/types' needs to have a destination to be valid - * in the Drupal menu system, but too much information there might be - * hidden, so we supply the contents of the block. - * - * @return - * The output HTML. - */ -function system_admin_menu_block_page() { - $item = menu_get_item(); - if ($content = system_admin_menu_block($item)) { - $output = theme('admin_block_content', array('content' => $content)); - } - else { - $output = t('You do not have any administrative items.'); - } - return $output; -} - -/** * Menu callback; prints a listing of admin tasks, organized by module. */ function system_admin_index() { diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 0c2e39d..ef64ea1 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -649,11 +649,9 @@ function system_menu() { ); $items['admin'] = array( 'title' => 'Administration', - 'access arguments' => array('access administration pages'), - 'page callback' => 'system_admin_menu_block_page', + 'route_name' => 'system_admin', 'weight' => 9, 'menu_name' => 'admin', - 'file' => 'system.admin.inc', ); $items['admin/compact'] = array( 'title' => 'Compact mode', @@ -682,9 +680,7 @@ function system_menu() { 'description' => 'Administer blocks, content types, menus, etc.', 'position' => 'right', 'weight' => -8, - 'page callback' => 'system_admin_menu_block_page', - 'access arguments' => array('access administration pages'), - 'file' => 'system.admin.inc', + 'route_name' => 'system_admin_structure', ); // Appearance. $items['admin/appearance'] = array( @@ -799,9 +795,7 @@ function system_menu() { 'description' => 'Media tools.', 'position' => 'left', 'weight' => -10, - 'page callback' => 'system_admin_menu_block_page', - 'access arguments' => array('access administration pages'), - 'file' => 'system.admin.inc', + 'route_name' => 'system_admin_config_media', ); $items['admin/config/media/file-system'] = array( 'title' => 'File system', @@ -828,9 +822,7 @@ function system_menu() { 'description' => 'Tools related to web services.', 'position' => 'right', 'weight' => 0, - 'page callback' => 'system_admin_menu_block_page', - 'access arguments' => array('access administration pages'), - 'file' => 'system.admin.inc', + 'route_name' => 'system_admin_config_services', ); $items['admin/config/services/rss-publishing'] = array( 'title' => 'RSS publishing', @@ -847,9 +839,7 @@ function system_menu() { 'description' => 'Development tools.', 'position' => 'right', 'weight' => -10, - 'page callback' => 'system_admin_menu_block_page', - 'access arguments' => array('access administration pages'), - 'file' => 'system.admin.inc', + 'route_name' => 'system_admin_config_development', ); $items['admin/config/development/maintenance'] = array( 'title' => 'Maintenance mode', @@ -885,9 +875,7 @@ function system_menu() { 'description' => 'Regional settings, localization and translation.', 'position' => 'left', 'weight' => -5, - 'page callback' => 'system_admin_menu_block_page', - 'access arguments' => array('access administration pages'), - 'file' => 'system.admin.inc', + 'route_name' => 'system_admin_config_regional', ); $items['admin/config/regional/settings'] = array( 'title' => 'Regional settings', @@ -946,9 +934,7 @@ function system_menu() { 'description' => 'Local site search, metadata and SEO.', 'position' => 'left', 'weight' => -10, - 'page callback' => 'system_admin_menu_block_page', - 'access arguments' => array('access administration pages'), - 'file' => 'system.admin.inc', + 'route_name' => 'system_admin_config_search', ); // System settings. @@ -957,9 +943,7 @@ function system_menu() { 'description' => 'General system related configuration.', 'position' => 'right', 'weight' => -20, - 'page callback' => 'system_admin_menu_block_page', - 'access arguments' => array('access administration pages'), - 'file' => 'system.admin.inc', + 'route_name' => 'system_admin_config_system', ); $items['admin/config/system/site-information'] = array( 'title' => 'Site information', @@ -984,9 +968,7 @@ function system_menu() { 'title' => 'User interface', 'description' => 'Tools that enhance the user interface.', 'position' => 'right', - 'page callback' => 'system_admin_menu_block_page', - 'access arguments' => array('access administration pages'), - 'file' => 'system.admin.inc', + 'route_name' => 'system_admin_config_ui', 'weight' => -15, ); $items['admin/config/workflow'] = array( @@ -994,29 +976,23 @@ function system_menu() { 'description' => 'Content workflow, editorial workflow tools.', 'position' => 'right', 'weight' => 5, - 'page callback' => 'system_admin_menu_block_page', - 'access arguments' => array('access administration pages'), - 'file' => 'system.admin.inc', + 'route_name' => 'system_admin_config_workflow', ); $items['admin/config/content'] = array( 'title' => 'Content authoring', 'description' => 'Settings related to formatting and authoring content.', 'position' => 'left', 'weight' => -15, - 'page callback' => 'system_admin_menu_block_page', - 'access arguments' => array('access administration pages'), - 'file' => 'system.admin.inc', + 'route_name' => 'system_admin_config_content', ); // Reports. $items['admin/reports'] = array( 'title' => 'Reports', 'description' => 'View reports, updates, and errors.', - 'page callback' => 'system_admin_menu_block_page', - 'access arguments' => array('access site reports'), + 'route_name' => 'system_admin_reports', 'weight' => 5, 'position' => 'left', - 'file' => 'system.admin.inc', ); $items['admin/reports/status'] = array( 'title' => 'Status report', diff --git a/core/modules/system/system.routing.yml b/core/modules/system/system.routing.yml index 69a3eae..e1aba0a 100644 --- a/core/modules/system/system.routing.yml +++ b/core/modules/system/system.routing.yml @@ -1,3 +1,75 @@ +system_admin: + pattern: '/admin' + defaults: + _content: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage' + requirements: + _permission: 'access administration pages' +system_admin_structure: + pattern: '/admin/structure' + defaults: + _content: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage' + requirements: + _permission: 'access administration pages' +system_admin_reports: + pattern: '/admin/reports' + defaults: + _content: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage' + requirements: + _permission: 'access administration pages' +system_admin_config_media: + pattern: '/admin/config/media' + defaults: + _content: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage' + requirements: + _permission: 'access administration pages' +system_admin_config_services: + pattern: '/admin/config/services' + defaults: + _content: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage' + requirements: + _permission: 'access administration pages' +system_admin_config_development: + pattern: '/admin/config/development' + defaults: + _content: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage' + requirements: + _permission: 'access administration pages' +system_admin_config_regional: + pattern: '/admin/config/regional' + defaults: + _content: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage' + requirements: + _permission: 'access administration pages' +system_admin_config_search: + pattern: '/admin/config/search' + defaults: + _content: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage' + requirements: + _permission: 'access administration pages' +system_admin_config_system: + pattern: '/admin/config/system' + defaults: + _content: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage' + requirements: + _permission: 'access administration pages' +system_admin_config_ui: + pattern: '/admin/config/user-interface' + defaults: + _content: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage' + requirements: + _permission: 'access administration pages' +system_admin_config_workflow: + pattern: '/admin/config/workflow' + defaults: + _content: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage' + requirements: + _permission: 'access administration pages' +system_admin_config_content: + pattern: '/admin/config/content' + defaults: + _content: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage' + requirements: + _permission: 'access administration pages' system.cron: pattern: '/cron/{key}' defaults: