diff --git a/core/modules/help/help.routing.yml b/core/modules/help/help.routing.yml new file mode 100644 index 0000000..d4682ee --- /dev/null +++ b/core/modules/help/help.routing.yml @@ -0,0 +1,6 @@ +help_main: + pattern: 'admin/help' + defaults: + _content: '\Drupal\help\Controller\HelpController::helpMain' + requirements: + _permission: 'access administration pages' diff --git a/core/modules/help/lib/Drupal/help/Controller/HelpController.php b/core/modules/help/lib/Drupal/help/Controller/HelpController.php new file mode 100644 index 0000000..c0d6348 --- /dev/null +++ b/core/modules/help/lib/Drupal/help/Controller/HelpController.php @@ -0,0 +1,76 @@ +' . t('Help topics') . '

' . t('Help is available on the following items:') . '

' . $this->helpLinksAsList(); + return $output; + } + + /** + * Provides a formatted list of available help topics. + * + * @return + * A string containing the formatted list. + */ + private function helpLinksAsList() { + $empty_arg = drupal_help_arg(); + $module_info = system_rebuild_module_data(); + + $modules = array(); + foreach (module_implements('help') as $module) { + if (module_invoke($module, 'help', "admin/help#$module", $empty_arg)) { + $modules[$module] = $module_info[$module]->info['name']; + } + } + asort($modules); + + // Output pretty four-column list. + $count = count($modules); + $break = ceil($count / 4); + $output = '
'; + + return $output; + } + + +}