diff --git a/core/modules/update/lib/Drupal/update/Controller/UpdateController.php b/core/modules/update/lib/Drupal/update/Controller/UpdateController.php new file mode 100644 index 0000000..0b4cff0 --- /dev/null +++ b/core/modules/update/lib/Drupal/update/Controller/UpdateController.php @@ -0,0 +1,42 @@ + $data)); + } + else { + return theme('update_report', array('data' => _update_no_data())); + } + } + +} diff --git a/core/modules/update/update.module b/core/modules/update/update.module index 13e1771..88801f7 100644 --- a/core/modules/update/update.module +++ b/core/modules/update/update.module @@ -158,10 +158,8 @@ function update_menu() { $items['admin/reports/updates'] = array( 'title' => 'Available updates', 'description' => 'Get a status report about available updates for your installed modules and themes.', - 'page callback' => 'update_status', - 'access arguments' => array('administer site configuration'), + 'route_name' => 'update_status', 'weight' => -50, - 'file' => 'update.report.inc', ); $items['admin/reports/updates/list'] = array( 'title' => 'List', diff --git a/core/modules/update/update.report.inc b/core/modules/update/update.report.inc index 607b523..35677d8 100644 --- a/core/modules/update/update.report.inc +++ b/core/modules/update/update.report.inc @@ -6,22 +6,6 @@ */ /** - * Page callback: Generates a page about the update status of projects. - * - * @see update_menu() - */ -function update_status() { - if ($available = update_get_available(TRUE)) { - module_load_include('inc', 'update', 'update.compare'); - $data = update_calculate_project_data($available); - return theme('update_report', array('data' => $data)); - } - else { - return theme('update_report', array('data' => _update_no_data())); - } -} - -/** * Returns HTML for the project status report. * * @param array $variables diff --git a/core/modules/update/update.routing.yml b/core/modules/update/update.routing.yml new file mode 100644 index 0000000..d3a49ca --- /dev/null +++ b/core/modules/update/update.routing.yml @@ -0,0 +1,6 @@ +update_status: + pattern: '/admin/reports/updates' + defaults: + _content: '\Drupal\update\Controller\UpdateController::update_status' + requirements: + _permission: 'administer site configuration'