diff --git a/core/modules/system/lib/Drupal/system/Controller/SystemController.php b/core/modules/system/lib/Drupal/system/Controller/SystemController.php index 276aa04..7e6871a 100644 --- a/core/modules/system/lib/Drupal/system/Controller/SystemController.php +++ b/core/modules/system/lib/Drupal/system/Controller/SystemController.php @@ -15,37 +15,30 @@ class SystemController implements ControllerInterface { /** + * System Manager Service. + * + * @var \Drupal\system\SystemManager + */ + protected $systemManager; + + /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { - return new static(); + return new static($container->get('system.manager')); } /** * Constructs a SystemController object. */ - public function __construct() { + public function __construct(SystemManager $systemManager) { + $this->systemManager = $systemManager; } /** * 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. */ public function systemAdminMenuBlockPage() { - $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; + return $this->systemManager->getBlockContents(); } } diff --git a/core/modules/system/lib/Drupal/system/SystemManager.php b/core/modules/system/lib/Drupal/system/SystemManager.php new file mode 100644 index 0000000..573e5ce --- /dev/null +++ b/core/modules/system/lib/Drupal/system/SystemManager.php @@ -0,0 +1,43 @@ + $content, + '#theme' => 'admin_block_content', + ); + } + else { + $output = array( + '#type' => 'markup', + '#markup' => t('You do not have any administrative items.'), + ); + } + return $output; + } +} diff --git a/core/modules/system/system.services.yml b/core/modules/system/system.services.yml index c049b0a..26fdd01 100644 --- a/core/modules/system/system.services.yml +++ b/core/modules/system/system.services.yml @@ -6,3 +6,5 @@ services: plugin.manager.system.plugin_ui: class: Drupal\system\Plugin\Type\PluginUIManager arguments: ['@container.namespaces'] + system.manager: + class: Drupal\system\SystemManager