diff --git a/core/includes/menu.inc b/core/includes/menu.inc index 7a6828ca6e6c27747f8a34f2936a3c60846ae48f..0fefe74a004f6be31f91652d71d72bb21b44c2af 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -364,14 +364,6 @@ function theme_menu_local_action($variables) { return $output; } -/** - * Generates elements for the $arg array in the help hook. - */ -function drupal_help_arg($arg = array()) { - // Note - the number of empty elements should be > MENU_MAX_PARTS. - return $arg + array('', '', '', '', '', '', '', '', '', '', '', ''); -} - /** * Returns an array containing the names of system-defined (default) menus. */ diff --git a/core/modules/action/action.module b/core/modules/action/action.module index 85ccee9b61caa00ce5db3c4425ddf969b9d6d892..80c513bc2d4ceab525749832af3bc250f69af53c 100644 --- a/core/modules/action/action.module +++ b/core/modules/action/action.module @@ -5,12 +5,14 @@ * This is the Actions module for executing stored actions. */ +use Symfony\Component\HttpFoundation\Request; + /** * Implements hook_help(). */ -function action_help($path, $arg) { - switch ($path) { - case 'admin/help#action': +function action_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.action': $output = ''; $output .= '
' . t('The Action module provides tasks that can be executed by the site such as unpublishing content, sending e-mail messages, or blocking a user. Other modules can trigger these actions when specific system events happen; for example, when new content is posted or when a user logs in. Modules can also provide additional actions. For more information, see the online documentation for the Action module.', array('!documentation' => 'https://drupal.org/documentation/modules/action')) . '
'; @@ -23,12 +25,11 @@ function action_help($path, $arg) { $output .= ''; return $output; - case 'admin/config/system/actions': - case 'admin/config/system/actions/manage': + case 'action.admin': $output = '' . t('There are two types of actions: simple and advanced. Simple actions do not require any additional configuration and are listed here automatically. Advanced actions need to be created and configured before they can be used because they have options that need to be specified; for example, sending an e-mail to a specified address or unpublishing content containing certain words. To create an advanced action, select the action from the drop-down list in the advanced action section below and click the Create button.') . '
'; return $output; - case 'admin/config/system/actions/configure': + case 'action.admin_configure': return t('An advanced action offers additional configuration options which may be filled out below. Changing the Description field is recommended in order to better identify the precise action taking place.'); } } diff --git a/core/modules/aggregator/aggregator.module b/core/modules/aggregator/aggregator.module index 47f217384329705c48ae9dc7fed0685e8c9708df..db175a6f3d4b3eed8de4e173eab5df3709c51b1a 100644 --- a/core/modules/aggregator/aggregator.module +++ b/core/modules/aggregator/aggregator.module @@ -7,6 +7,7 @@ use Drupal\aggregator\FeedInterface; use Drupal\Component\Utility\Xss; +use Symfony\Component\HttpFoundation\Request; /** * Denotes that a feed's items should never expire. @@ -16,9 +17,9 @@ /** * Implements hook_help(). */ -function aggregator_help($path, $arg) { - switch ($path) { - case 'admin/help#aggregator': +function aggregator_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.aggregator': $output = ''; $output .= '' . t('The Aggregator module is an on-site syndicator and news reader that gathers and displays fresh content from RSS-, RDF-, and Atom-based feeds made available across the web. Thousands of sites (particularly news sites and blogs) publish their latest headlines in feeds, using a number of standardized XML-based formats. For more information, see the online documentation for the Aggregator module.', array('!aggregator-module' => 'https://drupal.org/documentation/modules/aggregator')) . '
'; @@ -34,14 +35,17 @@ function aggregator_help($path, $arg) { $output .= '' . t('Thousands of sites (particularly news sites and blogs) publish their latest headlines and posts in feeds, using a number of standardized XML-based formats. Formats supported by the aggregator include RSS, RDF, and Atom.') . '
'; $output .= '' . t('Current feeds are listed below, and new feeds may be added. At the blocks administration page you can enable for each feed the block Aggregator feed that contains the latest items .', array('!addfeed' => \Drupal::url('aggregator.feed_add'), '!block' => \Drupal::url('block.admin_display'))) . '
'; return $output; - case 'aggregator/sources/add': + + case 'aggregator.feed_add': return '' . t('Add a feed in RSS, RDF or Atom format. A feed may only have one entry.') . '
'; - case 'admin/config/services/aggregator/add/opml': + + case 'aggregator.opml_add': return '' . t('OPML is an XML format used to exchange multiple feeds between aggregators. A single OPML document may contain a collection of many feeds. Drupal can parse such a file and import all feeds at once, saving you the effort of adding them manually. You may either upload a local file from your computer or enter a URL where Drupal can download it.') . '
'; } } diff --git a/core/modules/ban/ban.module b/core/modules/ban/ban.module index 5e6ba658d29a0498ede7b610a18d98ca5da0a507..f36a26591adddf9d61e02b1a46b08b507c63fbb8 100644 --- a/core/modules/ban/ban.module +++ b/core/modules/ban/ban.module @@ -5,12 +5,14 @@ * Allows to ban individual IP addresses. */ +use Symfony\Component\HttpFoundation\Request; + /** * Implements hook_help(). */ -function ban_help($path, $arg) { - switch ($path) { - case 'admin/help#ban': +function ban_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.ban': $output = ''; $output .= '' . t('The Ban module allows administrators to ban visits to their site from individual IP addresses. For more information, see the online documentation for the Ban module.', array('!url' => 'https://drupal.org/documentation/modules/ban')) . '
'; @@ -21,7 +23,7 @@ function ban_help($path, $arg) { $output .= ''; return $output; - case 'admin/config/people/ban': + case 'ban.admin_page': return '' . t('IP addresses listed here are banned from your site. Banned addresses are completely forbidden from accessing the site and instead see a brief message explaining the situation.') . '
'; } } diff --git a/core/modules/basic_auth/basic_auth.module b/core/modules/basic_auth/basic_auth.module index c7e0221daa3cd1e697b8a27de6d45cc2e57e719a..f8fd225a9c73e44e89d26ab6b95a3d50714ab254 100644 --- a/core/modules/basic_auth/basic_auth.module +++ b/core/modules/basic_auth/basic_auth.module @@ -5,12 +5,14 @@ * Provides an HTTP Basic authentication provider. */ +use Symfony\Component\HttpFoundation\Request; + /** * Implements hook_help(). */ -function basic_auth_help($path, $arg) { - switch ($path) { - case 'admin/help#basic_auth': +function basic_auth_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.basic_auth': $output = ''; $output .= '' . t('The HTTP Basic Authentication module supplies an HTTP Basic authentication provider for web service requests. This authentication provider authenticates requests using the HTTP Basic Authentication user name and password, as an alternative to using Drupal\'s standard cookie-based authentication system. It is only useful if your site provides web services configured to use this type of authentication (for instance, the RESTful Web Services module). For more information, see the online documentation for the HTTP Basic Authentication module.', array('!hba_do' => 'https://drupal.org/documentation/modules/basic_auth', '!rest_help' => \Drupal::url('help.page', array('name' => 'rest')))) . '
'; diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 5190436457635a33b50c41dbde294305c784f02c..88b6ecc9e22f226e0bdf119bc1ce10179d0a8586 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -10,6 +10,7 @@ use Drupal\language\Entity\Language; use Drupal\system\Entity\Menu; use Symfony\Cmf\Component\Routing\RouteObjectInterface; +use Symfony\Component\HttpFoundation\Request; /** * Shows this block on every page except the listed pages. @@ -30,9 +31,9 @@ /** * Implements hook_help(). */ -function block_help($path, $arg) { - switch ($path) { - case 'admin/help#block': +function block_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.block': $output = ''; $output .= '' . t('The Block module allows you to place blocks in regions and to configure their settings. For more information, see the online documentation for the Blocks module.', array('!blocks-documentation' => 'https://drupal.org/documentation/modules/block/')) . '
'; @@ -53,13 +54,8 @@ function block_help($path, $arg) { $output .= ''; return $output; } - if ($arg[0] == 'admin' && $arg[1] == 'structure' && $arg['2'] == 'block' && (empty($arg[3]) || $arg[3] == 'list') && empty($arg[5])) { - if (!empty($arg[4])) { - $demo_theme = $arg[4]; - } - else { - $demo_theme = \Drupal::config('system.theme')->get('default'); - } + if ($route_name == 'block.admin_display' || $route_name == 'block.admin_display_theme') { + $demo_theme = $request->attributes->get('theme', \Drupal::config('system.theme')->get('default')); $themes = list_themes(); $output = '' . t('This page provides a drag-and-drop interface for adding a block to a region, and for controlling the order of blocks within regions. To add a block to a region, or to configure its specific title and visibility settings, click the block title under Place blocks. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the Save blocks button at the bottom of the page.') . '
'; $output .= '' . l(t('Demonstrate block regions (!theme)', array('!theme' => $themes[$demo_theme]->info['name'])), 'admin/structure/block/demo/' . $demo_theme) . '
'; diff --git a/core/modules/block/custom_block/custom_block.module b/core/modules/block/custom_block/custom_block.module index 620611c048eba7e06e5a1387c5cf3a2c329d52d6..b20d2d0bb3118b44a9a64f3438f85f1a8e9e7265 100644 --- a/core/modules/block/custom_block/custom_block.module +++ b/core/modules/block/custom_block/custom_block.module @@ -7,13 +7,14 @@ use Drupal\custom_block\Entity\CustomBlockType; use Drupal\custom_block\Entity\CustomBlock; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function custom_block_help($path, $arg) { - switch ($path) { - case 'admin/help#custom_block': +function custom_block_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.custom_block': $output = ''; $output .= '' . t('The Custom Block module allows you to create blocks of content, which can be placed in regions throughout the website. Custom blocks can have fields; see the Field module help for more information. Once created, custom blocks can be placed like blocks provided by other modules; see the Block module help page for details. For more information, see the online documentation for the Custom Block module.', array('!custom-blocks' => \Drupal::url('custom_block.list'), '!field-help' => \Drupal::url('help.page', array('name' => 'field')), '!blocks' => \Drupal::url('help.page', array('name' => 'block')), '!online-help' => 'https://drupal.org/documentation/modules/custom_block')) . '
'; @@ -26,11 +27,11 @@ function custom_block_help($path, $arg) { $output .= ''; return $output; - case 'admin/structure/block/custom-blocks': + case 'custom_block.list': $output = '' . t('This page lists user-created blocks. These blocks are derived from block types. A block type can consist of different fields and display settings. From the block types tab you can manage these fields as well as create new block types.') . '
'; return $output; - case 'admin/structure/block/custom-blocks/types': + case 'custom_block.type_list': $output = '' . t('This page lists block types. A block type can consist of different fields and display settings. From here you can manage these fields as well as create new block types.') . '
'; return $output; diff --git a/core/modules/book/book.module b/core/modules/book/book.module index e5bb818f164943d2bfb243f6d5459bd8f232971b..9cc4835336093e0932dd9c82d068116bac8b9764 100644 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -14,13 +14,14 @@ use Drupal\Core\Language\Language; use Drupal\Core\Entity\Display\EntityViewDisplayInterface; use Drupal\Core\Template\Attribute; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function book_help($path, $arg) { - switch ($path) { - case 'admin/help#book': +function book_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.book': $output = '' . t('The Book module is used for creating structured, multi-page content, such as site resource guides, manuals, and wikis. It allows you to create content that has chapters, sections, subsections, or any similarly-tiered structure. For more information, see the online documentation for the Book module.', array('!book' => 'https://drupal.org/documentation/modules/book')) . '
'; $output .= '' . t('The book module offers a means to organize a collection of related content pages, collectively known as a book. When viewed, this content automatically displays links to adjacent book pages, providing a simple navigation system for creating and reviewing structured content.') . '
'; - case 'node/%/outline': + + case 'book.outline': return '' . t('The outline feature allows you to include pages in the Book hierarchy, as well as move them within the hierarchy or to reorder an entire book.', array('!book' => \Drupal::url('book.render'), '!book-admin' => \Drupal::url('book.admin'))) . '
'; } } diff --git a/core/modules/breakpoint/breakpoint.module b/core/modules/breakpoint/breakpoint.module index 19fe29f7012cb668a73509b544d55b8a977662ea..8d6283b9a8872ba91f17777b91c06800655a6754 100644 --- a/core/modules/breakpoint/breakpoint.module +++ b/core/modules/breakpoint/breakpoint.module @@ -8,13 +8,14 @@ use Drupal\breakpoint\Entity\Breakpoint; use Drupal\breakpoint\Entity\BreakpointGroup; use Drupal\Core\Config\Entity\ConfigEntityStorage; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function breakpoint_help($path, $arg) { - switch ($path) { - case 'admin/help#breakpoint': +function breakpoint_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.breakpoint': $output = ''; $output .= '' . t('The Breakpoint module keeps track of the height, width, and resolution breakpoints where a responsive design needs to change in order to respond to different devices being used to view the site. This module does not have a user interface, but contributed modules such as Breakpoint UI may provide one. For more information, see the online documentation for the Breakpoint module.', array('!docs' => 'https://drupal.org/documentation/modules/breakpoint', '!breakpoint_ui' => 'https://drupal.org/project/breakpoint_ui')) . '
'; diff --git a/core/modules/ckeditor/ckeditor.module b/core/modules/ckeditor/ckeditor.module index 7000dbfbe632eeb0e99cfb299ab09b5d308832c1..8f640df3ac6f5e658433c122264ddac68f4a1506 100644 --- a/core/modules/ckeditor/ckeditor.module +++ b/core/modules/ckeditor/ckeditor.module @@ -6,13 +6,14 @@ */ use Drupal\editor\Entity\Editor; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function ckeditor_help($path, $arg) { - switch ($path) { - case 'admin/help#ckeditor': +function ckeditor_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.ckeditor': $output = ''; $output .= '' . t('The CKEditor module provides a visual text editor and adds a toolbar to text fields. Users can use buttons to format content and to create semantically correct and valid HTML. The CKEditor module uses the framework provided by the Text Editor module. It requires JavaScript to be enabled in the browser. For more information, see the online documentation for the CKEditor module and the CKEditor website.', array( '!doc_url' => 'https://drupal.org/documentation/modules/ckeditor', '!cke_url' => 'http://ckeditor.com', '!text_editor' => \Drupal::url('help.page', array('name' => 'editor')))) . '
'; diff --git a/core/modules/color/color.module b/core/modules/color/color.module index 02cabf39f602a4bd25eb67777c07d93c02724b8a..5ac6340cf3dca1cbeaa3240b1fdf8b2f82415788 100644 --- a/core/modules/color/color.module +++ b/core/modules/color/color.module @@ -6,13 +6,14 @@ use Drupal\Core\Asset\CssOptimizer; use Drupal\Component\Utility\String; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function color_help($path, $arg) { - switch ($path) { - case 'admin/help#color': +function color_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.color': $output = '' . t('The Color module allows users with the Administer site configuration permission to change the color scheme (color of links, backgrounds, text, and other theme elements) of themes that are compatible with it. For more information, see the online documentation for the Color module.', array('!color_do' => 'https://drupal.org/documentation/modules/color')) . '
'; $output .= '' . t('The Comment module allows users to comment on site content, set commenting defaults and permissions, and moderate comments. For more information, see the online handbook entry for Comment module.', array('@comment' => 'http://drupal.org/documentation/modules/comment')) . '
'; $output .= '' . t('This page provides a list of all comment forms on the site and allows you to manage the fields, form and display settings for each.') . '
'; return $output; } diff --git a/core/modules/config/config.module b/core/modules/config/config.module index 900e1244444eb10238ef09b537d7f78800ca7c74..8819fdbeacbd0e4fbf6afebd132a1bdb1ecf220b 100644 --- a/core/modules/config/config.module +++ b/core/modules/config/config.module @@ -5,12 +5,14 @@ * Allows site administrators to modify configuration. */ +use Symfony\Component\HttpFoundation\Request; + /** * Implements hook_help(). */ -function config_help($path, $arg) { - switch ($path) { - case 'admin/help#config': +function config_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.config': $output = ''; $output .= '' . t('The Configuration manager module provides a user interface for importing and exporting configuration changes; i.e., for staging configuration data between multiple instances of this web site. For more information, see the online handbook entry for Configuration manager module', array( @@ -18,7 +20,7 @@ function config_help($path, $arg) { )) . '
'; return $output; - case 'admin/config/development/configuration/sync': + case 'config.sync': $output = ''; $output .= '' . t('Import configuration that is placed in your staging directory. All changes, deletions, renames, and additions are listed below.') . '
'; return $output; diff --git a/core/modules/config_translation/config_translation.module b/core/modules/config_translation/config_translation.module index 93dc90959e10da0c22d17a672c7d9a0895087bad..256bfba7a40def737ab69ceb86d14d0119c33609 100644 --- a/core/modules/config_translation/config_translation.module +++ b/core/modules/config_translation/config_translation.module @@ -7,14 +7,15 @@ use Drupal\config_translation\Plugin\Derivative\ConfigTranslationLocalTasks; use Drupal\Core\Entity\EntityInterface; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Exception\RouteNotFoundException; /** * Implements hook_help(). */ -function config_translation_help($path) { - switch ($path) { - case 'admin/help#config_translation': +function config_translation_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.config_translation': $output = ''; $output .= '' . t('The Configuration Translation module allows configurations to be translated into different languages. Views, your site name, contact module categories, vocabularies, menus, blocks, and so on are all stored within the unified configuration system and can be translated with this module. Content, such as nodes, taxonomy terms, custom blocks, and so on are translatable with the Content Translation module in Drupal core, while the built-in user interface (such as registration forms, content submission and administration interfaces) are translated with the Interface Translation module. Use these three modules effectively together to translate your whole site to different languages.') . '
'; @@ -25,7 +26,7 @@ function config_translation_help($path) { $output .= ''; return $output; - case 'admin/config/regional/config-translation': + case 'config_translation.mapper_list': $output = '' . t('This page lists all configuration items on your site which have translatable text, like your site name, role names, etc.') . '
'; return $output; } diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module index a8037ee88a6627250b97988adacfb94d378234fb..5fae4039adbb63d7ad4dad1e6619d7d716e42c9c 100644 --- a/core/modules/contact/contact.module +++ b/core/modules/contact/contact.module @@ -1,4 +1,5 @@ ' . t('About') . ''; $output .= '' . t('The Contact module allows visitors to contact site administrators and other users. Users specify a subject, write their message, and can have a copy of their message sent to their own e-mail address. For more information, see the online handbook entry for Contact module.', array('@contact' => 'http://drupal.org/documentation/modules/contact')) . '
'; @@ -26,7 +27,8 @@ function contact_help($path, $arg) { $output .= '' . t('Add one or more categories on this page to set up your site-wide contact form.', array('@form' => url('contact'))) . '
'; $output .= '' . t('A Contact menu item is added to the Footer menu, which you can modify on the Menus administration page.', array('@menu-settings' => url('admin/structure/menu'))) . '
'; $output .= '' . t('If you would like additional text to appear on the site-wide contact page, use a block. You can create and edit blocks on the Blocks administration page.', array('@blocks' => url('admin/structure/block'))) . '
'; diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module index 1f174eb956ff226b16200e64ba14ee85e98c7ce4..8c769833c5a9c6bc20ed25f7684f3a935889f7ea 100644 --- a/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -15,13 +15,14 @@ use Drupal\Core\Session\AccountInterface; use Drupal\Core\TypedData\TranslatableInterface; use Drupal\node\NodeInterface; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function content_translation_help($path, $arg) { - switch ($path) { - case 'admin/help#content_translation': +function content_translation_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.content_translation': $output = ''; $output .= '' . t('The Content Translation module allows you to create and manage translations for your Drupal site content. You can specify which elements need to be translated at the content-type level for content items and comments, at the vocabulary level for taxonomy terms, and at the site level for user accounts. Other modules may provide additional elements that can be translated. For more information, see the online handbook entry for Content Translation.', array('!url' => 'http://drupal.org/documentation/modules/translation_entity')) . '
'; @@ -41,7 +42,7 @@ function content_translation_help($path, $arg) { $output .= ''; return $output; - case 'admin/config/regional/content-language': + case 'language.content_settings_page': $output = ''; if (!\Drupal::languageManager()->isMultilingual()) { $output .= '' . t('The Contextual Links module displays links related to regions of pages on your site to users with access contextual links permission. For more information, see the online handbook entry for Contextual Links module.', array('@contextual' => 'http://drupal.org/documentation/modules/contextual')) . '
'; diff --git a/core/modules/dblog/dblog.module b/core/modules/dblog/dblog.module index 392057964c0c91e60bf57f1b794d966e71162d77..56ce643b195026a6b2526a3a5459706adbe8d93c 100644 --- a/core/modules/dblog/dblog.module +++ b/core/modules/dblog/dblog.module @@ -12,13 +12,14 @@ */ use Drupal\Core\Database\Database; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function dblog_help($path, $arg) { - switch ($path) { - case 'admin/help#dblog': +function dblog_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.dblog': $output = ''; $output .= '' . t('The Database Logging module logs system events in the Drupal database. For more information, see the online handbook entry for the Database Logging module.', array('!dblog' => 'http://drupal.org/documentation/modules/dblog')) . '
'; @@ -30,7 +31,8 @@ function dblog_help($path, $arg) { $output .= '' . t('The Database Logging module monitors your website, capturing system events in a log (shown here) to be reviewed by an authorized individual at a later time. This log is a list of recorded events containing usage data, performance data, errors, warnings and operational information. It is vital to check the Recent log messages report on a regular basis, as it is often the only way to tell what is going on.') . '
'; } } diff --git a/core/modules/editor/editor.module b/core/modules/editor/editor.module index 717355e0d8fcc6a24e026b1e0cca56c7046fb1db..9da1540e4f631a260a640bba6fdd52f7583d6b01 100644 --- a/core/modules/editor/editor.module +++ b/core/modules/editor/editor.module @@ -13,13 +13,14 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\filter\FilterFormatInterface; use Drupal\filter\Plugin\FilterInterface; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function editor_help($path, $arg) { - switch ($path) { - case 'admin/help#editor': +function editor_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.editor': $output = ''; $output .= '' . t('The Text Editor module provides a framework that other modules (such as CKEditor module) can use to provide toolbars and other functionality that allow users to format text more easily than typing HTML tags directly. For more information, see the online documentation for the Text Editor module.', array('!documentation' => 'https://drupal.org/documentation/modules/editor', '!ckeditor' => \Drupal::url('help.page', array('name' => 'ckeditor')))) . '
'; diff --git a/core/modules/entity/entity.module b/core/modules/entity/entity.module index 1fa38525d8218464d3274d93a1e23d94052ae654..deadbf8c641c8f8937585cc90b1c065f132fe5ab 100644 --- a/core/modules/entity/entity.module +++ b/core/modules/entity/entity.module @@ -9,13 +9,14 @@ */ use Drupal\Core\Config\Entity\ConfigEntityStorage; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function entity_help($path, $arg) { - switch ($path) { - case 'admin/help#entity': +function entity_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.entity': $output = ''; $output .= '' . t('The Entity module manages various types of content and configuration for the website. This information is collectively know as "entities", which are grouped into "entity types" (such as the main site content, comments, custom blocks, taxonomy terms, user accounts, and views configuration). Some entity types are further grouped into sub-types (for example, you could have article and page content types within the main site content entity type, and tag and category vocabularies within the taxonomy term entity type); other entity types, such as user accounts, do not have sub-types.') . '
'; diff --git a/core/modules/entity_reference/entity_reference.module b/core/modules/entity_reference/entity_reference.module index 846a723ace6f33a30a695a120d1d00b1a3a610a1..28db9c408f69f1c567b27eb28982d6b296f71c6f 100644 --- a/core/modules/entity_reference/entity_reference.module +++ b/core/modules/entity_reference/entity_reference.module @@ -11,13 +11,14 @@ use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Render\Element; use Drupal\field\FieldConfigInterface; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function entity_reference_help($path, $arg) { - switch ($path) { - case 'admin/help#entity_reference': +function entity_reference_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.entity_reference': $output = ''; $output .= '' . t('The Entity Reference module allows you to create fields that contain links to other entities (such as content items, taxonomy terms, etc.) within the site. This allows you, for example, to include a link to a user within a content item. For more information, see the online documentation for the Entity Reference module, the Entity module help page, and the Field module help page.', array('!field_help' => \Drupal::url('help.page', array('name' => 'field')),'!entity_help' => \Drupal::url('help.page', array('name' => 'entity')), '!er_do' => 'https://drupal.org/documentation/modules/entityreference')) . '
'; diff --git a/core/modules/field/field.module b/core/modules/field/field.module index cc3063335db1c1799a3a9f463629a92cca5705dd..dba9af777f91c517ed3de0b0861afa545ae9febf 100644 --- a/core/modules/field/field.module +++ b/core/modules/field/field.module @@ -10,6 +10,7 @@ use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Extension\Extension; use Drupal\field\Field; +use Symfony\Component\HttpFoundation\Request; /* * Load all public Field API functions. Drupal currently has no @@ -78,9 +79,9 @@ /** * Implements hook_help(). */ -function field_help($path, $arg) { - switch ($path) { - case 'admin/help#field': +function field_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.field': $output = ''; $output .= '' . t('The Field module allows custom data fields to be defined for entity types (entities include content items, comments, user accounts, and taxonomy terms). The Field module takes care of storing, loading, editing, and rendering field data. Most users will not interact with the Field module directly, but will instead use the Field UI module user interface. Module developers can use the Field API to make new entity types "fieldable" and thus allow fields to be attached to them. For more information, see the online handbook entry for Field module.', array('@field-ui-help' => url('admin/help/field_ui'), '@field' => 'http://drupal.org/documentation/modules/field')) . '
'; diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module index e68df343e27b41250753cce8d849f7962f38044d..84078a2428726500bb99871ba51f6832948debe3 100644 --- a/core/modules/field_ui/field_ui.module +++ b/core/modules/field_ui/field_ui.module @@ -10,13 +10,14 @@ use Drupal\entity\EntityViewModeInterface; use Drupal\field_ui\FieldUI; use Drupal\field_ui\Plugin\Derivative\FieldUiLocalTask; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function field_ui_help($path, $arg) { - switch ($path) { - case 'admin/help#field_ui': +function field_ui_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.field_ui': $output = ''; $output .= '' . t('The Field UI module provides an administrative user interface (UI) for attaching and managing fields. Fields can be defined at the content-type level for content items and comments, at the vocabulary level for taxonomy terms, and at the site level for user accounts. Other modules may also enable fields to be defined for their data. Field types (text, image, number, etc.) are defined by modules, and collected and managed by the Field module. For more information, see the online handbook entry for Field UI module.', array('@field' => url('admin/help/field'), '@field_ui' => 'http://drupal.org/documentation/modules/field-ui')) . '
'; @@ -48,7 +49,7 @@ function field_ui_help($path, $arg) { $output .= ''; return $output; - case 'admin/reports/fields': + case 'field_ui.list': return '' . t('This list shows all fields currently in use for easy reference.') . '
'; } } diff --git a/core/modules/file/file.module b/core/modules/file/file.module index 9fb3c60dd7c92f55fb7535a42f87d83b07bbc395..e58e06ce709f1973a80227efc0c26eeb98b764d6 100644 --- a/core/modules/file/file.module +++ b/core/modules/file/file.module @@ -12,6 +12,7 @@ use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Template\Attribute; use Drupal\file\FileUsage\FileUsageInterface; +use Symfony\Component\HttpFoundation\Request; // Load all Field module hooks for File. require_once __DIR__ . '/file.field.inc'; @@ -19,9 +20,9 @@ /** * Implements hook_help(). */ -function file_help($path, $arg) { - switch ($path) { - case 'admin/help#file': +function file_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.file': $output = ''; $output .= '' . t('The File module allows you to create fields that contain files. See the Field module help and the Field UI help pages for general information on fields and how to create and manage them. For more information, see the online documentation for the File module.', array('!field' => \Drupal::url('help.page', array('name' => 'field')), '!field_ui' => \Drupal::url('help.page', array('name' => 'field_ui')), '!file_documentation' => 'https://drupal.org/documentation/modules/file')) . '
'; diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module index 40eda672c75012ec7d6edd1ae13984ab2bb040fb..cb17c44e45f676315618bed3df912168d67f85bc 100644 --- a/core/modules/filter/filter.module +++ b/core/modules/filter/filter.module @@ -15,13 +15,14 @@ use Drupal\Core\Template\Attribute; use Drupal\filter\FilterFormatInterface; use Drupal\filter\Plugin\FilterInterface; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function filter_help($path, $arg) { - switch ($path) { - case 'admin/help#filter': +function filter_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.filter': $output = ''; $output .= '' . t('The Filter module allows administrators to configure text formats. Text formats define the HTML tags, codes, and other input allowed in text entered in the site and they defend your web site against potentially damaging input from malicious users. A visual text editor can be associated with the text formats by using the Text Editor module. For more information, see the online documentation for the Filter module.', array('!filter_do' => 'https://drupal.org/documentation/modules/filter/','!editor_help' => \Drupal::url('help.page', array('name' => 'editor')))) . '
'; @@ -41,12 +42,12 @@ function filter_help($path, $arg) { $output .= ''; return $output; - case 'admin/config/content/formats': + case 'filter.admin_overview': $output = '' . t('Text formats define the HTML tags, code, and other formatting that can be used when entering text. Improper text format configuration is a security risk. Learn more on the Filter module help page.', array('@filterhelp' => url('admin/help/filter'))) . '
'; $output .= '' . t('Text formats are presented on content editing pages in the order defined on this page. The first format available to a user will be selected by default.') . '
'; return $output; - case 'admin/config/content/formats/manage/%': + case 'filter.format_edit': $output = '' . t('A text format contains filters that change the user input, for example stripping out malicious HTML or making URLs clickable. Filters are executed from top to bottom and the order is important, since one filter may prevent another filter from doing its job. For example, when URLs are converted into links before disallowed HTML tags are removed, all links may be removed. When this happens, the order of filters may need to be re-arranged.') . '
'; return $output; } diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index 21c4d2e5e4789a2ab9be2c68f606e8ce75c74b94..56bcaecba2d6a7007ab94d340dd1068732e077b4 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -10,13 +10,14 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Component\Utility\String; use Drupal\field\Field; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function forum_help($path, $arg) { - switch ($path) { - case 'admin/help#forum': +function forum_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.forum': $output = ''; $output .= '' . t('The Forum module lets you create threaded discussion forums with functionality similar to other message board systems. Forums are useful because they allow community members to discuss topics with one another while ensuring those conversations are archived for later reference. In a forum, users post topics and threads in nested hierarchies, allowing discussions to be categorized and grouped. The forum hierarchy consists of:') . '
'; @@ -44,7 +45,8 @@ function forum_help($path, $arg) { $output .= '' . t('Forums contain forum topics. Use containers to group related forums.') . '
'; $more_help_link = array( '#type' => 'link', @@ -61,11 +63,14 @@ function forum_help($path, $arg) { ); $output .= drupal_render($container); return $output; - case 'admin/structure/forum/add/container': + + case 'forum.add_container': return '' . t('Use containers to group related forums.') . '
'; - case 'admin/structure/forum/add/forum': + + case 'forum.add_forum': return '' . t('A forum holds related forum topics.') . '
'; - case 'admin/structure/forum/settings': + + case 'forum.settings': return '' . t('Adjust the display of your forum topics. Organize the forums on the forum structure page.', array('!forum-structure' => \Drupal::url('forum.overview'))) . '
'; } } diff --git a/core/modules/hal/hal.module b/core/modules/hal/hal.module index c124fb1a33ed465d4230f9241e660a4c87dc8ec1..0f026e5af710bd5cffe85c513c6d91fdf4422c46 100644 --- a/core/modules/hal/hal.module +++ b/core/modules/hal/hal.module @@ -5,12 +5,14 @@ * Adds support for serializing entities to Hypertext Application Language. */ +use Symfony\Component\HttpFoundation\Request; + /** * Implements hook_help(). */ -function hal_help($path, $arg) { - switch ($path) { - case 'admin/help#hal': +function hal_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.hal': $output = ''; $output .= '' . t('Hypertext Application Language (HAL) is a format that supports the linking required for hypermedia APIs.', array('!hal_spec' => 'http://stateless.co/hal_specification.html')) . '
'; diff --git a/core/modules/help/help.api.php b/core/modules/help/help.api.php index 8b75a784f2b4ff89ee9fa04c67deba387dafc8c7..ede6b4ca7afdc04cdce45abcc46189e435e401b6 100644 --- a/core/modules/help/help.api.php +++ b/core/modules/help/help.api.php @@ -20,40 +20,24 @@ * * For a detailed usage example, see page_example.module. * - * @param $path - * The router menu path, as defined in hook_menu(), for the help that is - * being requested; e.g., 'admin/people' or 'user/register'. If the router - * path includes a wildcard, then this will appear in $path as %, even if it - * is a named %autoloader wildcard in the hook_menu() implementation; for - * example, node pages would have $path equal to 'node/%' or 'node/%/view'. - * To provide a help page for a whole module with a listing on admin/help, - * your hook implementation should match a path with a special descriptor - * after a "#" sign: - * 'admin/help#modulename' - * The main module help text, displayed on the admin/help/modulename - * page and linked to from the admin/help page. - * @param $arg - * An array that corresponds to the return value of the arg() function, for - * modules that want to provide help that is specific to certain values - * of wildcards in $path. For example, you could provide help for the path - * 'user/1' by looking for the path 'user/%' and $arg[1] == '1'. This given - * array should always be used rather than directly invoking arg(), because - * your hook implementation may be called for other purposes besides building - * the current page's help. Note that depending on which module is invoking - * hook_help, $arg may contain only empty strings. Regardless, $arg[0] to - * $arg[11] will always be set. + * @param string $route_name + * For a specific page, use the route name as identified in the module's + * routing.yml file. For the help overview page, the route name will be in the + * form of "help.page.$modulename". + * @param \Symfony\Component\HttpFoundation\Request $request + * The current request. * - * @return + * @return string * A localized string containing the help text. */ -function hook_help($path, $arg) { - switch ($path) { +function hook_help($route_name, \Symfony\Component\HttpFoundation\Request $request) { + switch ($route_name) { // Main module help for the block module. - case 'admin/help#block': + case 'help.page.block': return '' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Bartik, for example, implements the regions "Sidebar first", "Sidebar second", "Featured", "Content", "Header", "Footer", etc., and a block may appear in any one of these areas. The blocks administration page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('@blocks' => url('admin/structure/block'))) . '
'; // Help for another path in the block module. - case 'admin/structure/block': + case 'block.admin_display': return '' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the Save blocks button at the bottom of the page.') . '
'; } } diff --git a/core/modules/help/help.module b/core/modules/help/help.module index b02085a60e4daecc04f7d983200cb6e95d29d444..a8447ccdeb62eb49b3ca6b0409efefac60bff62f 100644 --- a/core/modules/help/help.module +++ b/core/modules/help/help.module @@ -5,12 +5,14 @@ * Manages displaying online help. */ +use Symfony\Component\HttpFoundation\Request; + /** * Implements hook_help(). */ -function help_help($path, $arg) { - switch ($path) { - case 'admin/help': +function help_help($route_name, Request $request) { + switch ($route_name) { + case 'help.main': $output = '' . t('Follow these steps to set up and start using your website:') . '
'; $output .= '' . t('For more information, refer to the subjects listed in the Help Topics section or to the online documentation and support pages at drupal.org.', array('!docs' => 'https://drupal.org/documentation', '!support' => 'https://drupal.org/support', '!drupal' => 'https://drupal.org')) . '
'; return $output; - case 'admin/help#help': + + case 'help.page.help': $output = ''; $output .= '' . t('The Help module provides Help reference pages and context-sensitive advice to guide you through the use and configuration of modules. It is a starting point for Drupal.org online documentation pages that contain more extensive and up-to-date information, are annotated with user-contributed comments, and serve as the definitive reference point for all Drupal documentation. For more information, see the online documentation for the Help module.', array('!help' => 'https://drupal.org/documentation/modules/help/', '!handbook' => 'https://drupal.org/documentation', '!help-page' => \Drupal::url('help.main'))) . '
'; diff --git a/core/modules/help/lib/Drupal/help/Controller/HelpController.php b/core/modules/help/lib/Drupal/help/Controller/HelpController.php index 59cf945e3ab2e73d326cca640219eccb912293ca..f9389bf950fa0a2cfabc5ceba693cd0637853359 100644 --- a/core/modules/help/lib/Drupal/help/Controller/HelpController.php +++ b/core/modules/help/lib/Drupal/help/Controller/HelpController.php @@ -8,6 +8,7 @@ namespace Drupal\help\Controller; use Drupal\Core\Controller\ControllerBase; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Drupal\Component\Utility\String; @@ -19,15 +20,18 @@ class HelpController extends ControllerBase { /** * Prints a page listing a glossary of Drupal terminology. * + * @param \Symfony\Component\HttpFoundation\Request $request + * The current request. + * * @return string * An HTML string representing the contents of help page. */ - public function helpMain() { + public function helpMain(Request $request) { $output = array( '#attached' => array( 'css' => array(drupal_get_path('module', 'help') . '/css/help.module.css'), ), - '#markup' => '' . $this->t('Help is available on the following items:') . '
' . $this->helpLinksAsList(), + '#markup' => '' . $this->t('Help is available on the following items:') . '
' . $this->helpLinksAsList($request), ); return $output; } @@ -35,16 +39,18 @@ public function helpMain() { /** * Provides a formatted list of available help topics. * + * @param \Symfony\Component\HttpFoundation\Request $request + * The current request. + * * @return string * A string containing the formatted list. */ - protected function helpLinksAsList() { - $empty_arg = drupal_help_arg(); + protected function helpLinksAsList(Request $request) { $module_info = system_rebuild_module_data(); $modules = array(); foreach ($this->moduleHandler()->getImplementations('help') as $module) { - if ($this->moduleHandler()->invoke($module, 'help', array("admin/help#$module", $empty_arg))) { + if ($this->moduleHandler()->invoke($module, 'help', array("help.page.$module", $request))) { $modules[$module] = $module_info[$module]->info['name']; } } @@ -72,19 +78,21 @@ protected function helpLinksAsList() { * * @param string $name * A module name to display a help page for. + * @param \Symfony\Component\HttpFoundation\Request $request + * The current request. * * @return array * A render array as expected by drupal_render(). * * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException */ - public function helpPage($name) { + public function helpPage($name, Request $request) { $build = array(); if ($this->moduleHandler()->implementsHook($name, 'help')) { $info = system_get_info('module'); $build['#title'] = String::checkPlain($info[$name]['name']); - $temp = $this->moduleHandler()->invoke($name, 'help', array("admin/help#$name", drupal_help_arg())); + $temp = $this->moduleHandler()->invoke($name, 'help', array("help.page.$name", $request)); if (empty($temp)) { $build['top']['#markup'] = $this->t('No help is available for module %module.', array('%module' => $info[$name]['name'])); } diff --git a/core/modules/history/history.module b/core/modules/history/history.module index e7ab0736a0f6f1b4b47982f5b34ff0973620f75a..c019d9d60a4651f307ed88b876f441c9df5ec907 100644 --- a/core/modules/history/history.module +++ b/core/modules/history/history.module @@ -11,6 +11,7 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\Display\EntityViewDisplayInterface; +use Symfony\Component\HttpFoundation\Request; /** * Entities changed before this time are always shown as read. @@ -23,9 +24,9 @@ /** * Implements hook_help(). */ -function history_help($path, $arg) { - switch ($path) { - case 'admin/help#history': +function history_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.history': $output = '' . t('The History module keeps track of which content a user has read. It marks content as new or updated depending on the last time the user viewed it. History records that are older than one month are removed during cron, which means that content older than one month is always considered read. The History module does not have a user interface but it provides a filter to Views to show new or updated content. For more information, see the online documentation for the History module.', array('!views-help' => \Drupal::url('help.page', array ('name' => 'views')), '!url' => 'https://drupal.org/documentation/modules/history')) . '
'; return $output; diff --git a/core/modules/image/image.module b/core/modules/image/image.module index 61b30b92079f654d8605ebdff046f95a201d0288..9c9e82cd5e9f8a28f56cbb1ee82c7a2ff4fce06d 100644 --- a/core/modules/image/image.module +++ b/core/modules/image/image.module @@ -12,6 +12,7 @@ use Drupal\file\Entity\File; use Drupal\field\FieldConfigInterface; use Drupal\field\FieldInstanceConfigInterface; +use Symfony\Component\HttpFoundation\Request; /** * Image style constant for user presets in the database. @@ -49,9 +50,9 @@ /** * Implements hook_help(). */ -function image_help($path, $arg) { - switch ($path) { - case 'admin/help#image': +function image_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.image': $output = ''; $output .= '' . t('The Image module allows you to manipulate images on your website. It exposes a setting for using the Image toolkit, allows you to configure Image styles that can be used for resizing or adjusting images on display, and provides an Image field for attaching images to content. For more information, see the online handbook entry for Image module.', array('@image' => 'http://drupal.org/documentation/modules/image')) . '
'; @@ -66,18 +67,16 @@ function image_help($path, $arg) { $output .= '' . t('Image styles commonly provide thumbnail sizes by scaling and cropping images, but can also add various effects before an image is displayed. When an image is displayed with a style, a new file is created and the original image is left unchanged.') . '
'; - case 'admin/config/media/image-styles/manage/%/add/%': - $effect = \Drupal::service('plugin.manager.image.effect')->getDefinition($arg[7]); + + case 'image.effect_add_form': + $effect = \Drupal::service('plugin.manager.image.effect')->getDefinition($request->attributes->get('image_effect')); return isset($effect['description']) ? ('' . $effect['description'] . '
') : NULL; - case 'admin/config/media/image-styles/manage/%/effects/%': - try { - $effect = entity_load('image_style', $arg[5])->getEffect($arg[7]); - } - catch (PluginNotFoundException $e) { - return NULL; - } + + case 'image.effect_edit_form': + $effect = $request->attributes->get('image_style')->getEffect($request->attributes->get('image_effect')); $effect_definition = $effect->getPluginDefinition(); return isset($effect_definition['description']) ? ('' . $effect_definition['description'] . '
') : NULL; } diff --git a/core/modules/language/language.module b/core/modules/language/language.module index cf24723f02ef11f4ad86caffa091c8cf76f1808b..f35da4d37e6a0d3b0ea51513dfbe09e11fea2c7d 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -14,13 +14,14 @@ use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl; use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrlFallback; use Drupal\node\NodeTypeInterface; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function language_help($path, $arg) { - switch ($path) { - case 'admin/help#language': +function language_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.language': $output = ''; $output .= '' . t('The Language module allows you to maintain a list of languages used on your Drupal site for providing language information for content and for interface translation (using the Locale module). For more information, see the online handbook entry for Language module.', array('@language' => 'http://drupal.org/documentation/modules/language')) . '
'; @@ -33,38 +34,43 @@ function language_help($path, $arg) { $output .= ''; return $output; - case 'admin/config/regional/language': + case 'language.admin_overview': return '' . t('Reorder the added languages to set their order in the language switcher block and, when editing content, in the list of selectable languages. This ordering does not impact detection and selection.', array('@detection' => url('admin/config/regional/language/detection'))) . '
'; - case 'admin/config/regional/language/add': + case 'language.add': return '' . t('Add a language to be supported by your site. If your desired language is not available, pick Custom language... at the end and provide a language code and other details manually.') . '
'; - case 'admin/config/regional/language/detection': + case 'language.negotiation': $output = '' . t('Define how to decide which language is used to display page elements (primarily text provided by Drupal and modules, such as field labels and help text). This decision is made by evaluating a series of detection methods for languages; the first detection method that gets a result will determine which language is used for that type of text. Be aware that some language negotiation methods are unreliable under certain conditions, such as browser detection when page-caching is enabled and a user is not currently logged in. Define the order of evaluation of language detection methods on this page. Default language can be changed at the Regional settings page.', array('@region-settings' => url('admin/config/regional/settings'))) . '
'; return $output; - case 'admin/config/regional/language/detection/session': + case 'language.negotiation_session': $output = '' . t('Determine the language from a request/session parameter. Example: "http://example.com?language=de" sets language to German based on the use of "de" within the "language" parameter.') . '
'; return $output; - case 'admin/config/regional/language/detection/browser': + case 'language.negotiation_browser': $output = '' . t('Browsers use different language codes to refer to the same languages. You can add and edit mappings from browser language codes to the languages used by Drupal.', array('@configure-languages' => url('admin/config/regional/language'))) . '
'; return $output; - case 'admin/config/regional/language/detection/selected': + case 'language.negotiation_selected': $output = '' . t('Changing the selected language here (and leaving this option as the last among the detection and selection options) is the easiest way to change the fallback language for the website, if you need to change how your site works by default (eg. when using an empty path prefix or using the default domain). Changing the site\'s default language itself might have other undesired side effects. ', array('@admin-change-language' => url('admin/config/regional/language'))) . '
'; return $output; - case 'admin/structure/block/manage/%': - case 'admin/structure/block/add/%/%': - if ($arg[4] == 'language' && $arg[5] == 'language_interface') { + case 'block.admin_edit': + if (($block = $request->attributes->get('block')) && $block->get('plugin') == 'language_block:language_interface') { return '' . t('With multiple languages added, registered users can select their preferred language and authors can assign a specific language to content.') . '
'; } break; - case 'admin/config/regional/content-language': + case 'block.admin_add': + if ($request->attributes->get('plugin_id') == 'language_block:language_interface') { + return '' . t('With multiple languages added, registered users can select their preferred language and authors can assign a specific language to content.') . '
'; + } + break; + + case 'language.content_settings_page': return t('Change language settings for content types, taxonomy vocabularies, user profiles, or any other supported element on your site. By default, language settings hide the language selector and the language is the site\'s default language.'); } } diff --git a/core/modules/link/link.module b/core/modules/link/link.module index 2c06c5d1ba3324796992bc095274aa8ce17fe929..a791a151e98d02b7af9ca4de9a81469bed3b7709 100644 --- a/core/modules/link/link.module +++ b/core/modules/link/link.module @@ -6,13 +6,14 @@ */ use Drupal\Component\Utility\String; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function link_help($path, $arg) { - switch ($path) { - case 'admin/help#link': +function link_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.link': $output = ''; $output .= '' . t('The Link module allows you to create fields that contain internal or external URLs and optional link text. See the Field module help and the Field UI help pages for general information on fields and how to create and manage them. For more information, see the online documentation for the Link module.', array('!field' => \Drupal::url('help.page', array('name' => 'field')), '!field_ui' => \Drupal::url('help.page', array('name' => 'field_ui')), '!link_documentation' => 'https://drupal.org/documentation/modules/link')) . '
'; @@ -29,7 +30,7 @@ function link_help($path, $arg) { $output .= '' . t('The Interface Translation module allows you to translate interface text (strings) into different languages, and to switch between them for the display of interface text. It uses the functionality provided by the Language module. For more information, see the online documentation for the Interface Translation module.', array('!doc-url' => 'https://drupal.org/documentation/modules/locale/', '!language' => \Drupal::url('help.page', array('name' => 'language')))) . '
'; @@ -151,20 +152,20 @@ function locale_help($path, $arg) { $output .= ''; return $output; - case 'admin/config/regional/language': + case 'language.admin_overview': return '' . t('Interface translations are automatically imported when a language is added, or when new modules or themes are enabled. The report, Available translation updates, shows the status. Interface text can be customized.', array('@update' => url('admin/reports/translations'), '@translate' => url('admin/config/regional/translate'))) . '
'; - case 'admin/config/regional/translate': + case 'locale.translate_page': $output = '' . t('This page allows a translator to search for specific translated and untranslated strings, and is used when creating or editing translations. (Note: Because translation tasks involves many strings, it may be more convenient to export strings for offline editing in a desktop Gettext translation editor). Searches may be limited to strings in a specific language.', array('@export' => url('admin/config/regional/translate/export'))) . '
'; return $output; - case 'admin/config/regional/translate/import': + case 'locale.translate_import': $output = '' . t('Translation files are automatically downloaded and imported when languages are added, or when modules or themes are enabled.', array('@language' => url('admin/config/regional/language'))). '
'; $output .= '' . t('This page allows translators to manually import translated strings contained in a Gettext Portable Object (.po) file. Manual import may be used for customized translations or for the translation of custom modules and themes. To customize translations you can download a translation file from the Drupal translation server or export translations from the site, customize the translations using a Gettext translation editor, and import the result using this page.', array('@url' => 'http://localize.drupal.org', '@export' => url('admin/config/regional/translate/export'))) . '
'; $output .= '' . t('Note that importing large .po files may take several minutes.') . '
'; return $output; - case 'admin/config/regional/translate/export': + case 'locale.translate_export': return '' . t('This page exports the translated strings used by your site. An export file may be in Gettext Portable Object (.po) form, which includes both the original string and the translation (used to share translations with others), or in Gettext Portable Object Template (.pot) form, which includes the original strings only (used to create new translations with a Gettext translation editor).') . '
'; } } diff --git a/core/modules/menu_link/menu_link.module b/core/modules/menu_link/menu_link.module index c8e49e1d6afa7257b22a7014c2bd9e135d79fe2f..ee273d82be17a0d6855a90949a94a84aa16b6cfb 100644 --- a/core/modules/menu_link/menu_link.module +++ b/core/modules/menu_link/menu_link.module @@ -9,10 +9,11 @@ use Drupal\menu_link\Entity\MenuLink; use Drupal\menu_link\MenuLinkInterface; use Symfony\Cmf\Component\Routing\RouteObjectInterface; +use Symfony\Component\HttpFoundation\Request; -function menu_link_help($path, $arg) { - switch ($path) { - case 'admin/help#menu_link': +function menu_link_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.menu_link': $output = ''; $output .= '' . t('The Menu Link module allows users to create menu links. It is required by the Menu UI module, which provides an interface for managing menus. See the Menu UI module help page for more information.', array('!menu-help' => \Drupal::url('help.page', array('name' => 'menu_ui')))) . '
'; diff --git a/core/modules/menu_ui/menu_ui.module b/core/modules/menu_ui/menu_ui.module index 03238756ab77f9e4583ee36c7d5057d7a0aa3ec3..b12baee4db3b718c60b933861282bcc3e9710635 100644 --- a/core/modules/menu_ui/menu_ui.module +++ b/core/modules/menu_ui/menu_ui.module @@ -20,6 +20,7 @@ use Drupal\menu_link\Entity\MenuLink; use Drupal\menu_link\MenuLinkStorage; use Drupal\node\NodeInterface; +use Symfony\Component\HttpFoundation\Request; /** * Maximum length of menu name as entered by the user. Database length is 32 @@ -30,9 +31,9 @@ /** * Implements hook_help(). */ -function menu_ui_help($path, $arg) { - switch ($path) { - case 'admin/help#menu_ui': +function menu_ui_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.menu_ui': $output = ''; $output .= '' . t('The Menu UI module provides an interface for managing menus. A menu is a hierarchical collection of links, which can be within or external to the site, generally used for navigation. For more information, see the online documentation for the Menu UI module.', array('!menu' => 'https://drupal.org/documentation/modules/menu/')) . '
'; @@ -45,10 +46,10 @@ function menu_ui_help($path, $arg) { $output .= ''; return $output; } - if ($path == 'admin/structure/menu/add' && \Drupal::moduleHandler()->moduleExists('block')) { - return '' . t('You can enable the newly-created block for this menu on the Block layout page.', array('!blocks' => \Drupal::url('block.admin_display'))) . '
'; + if ($route_name == 'menu_ui.menu_add' && \Drupal::moduleHandler()->moduleExists('block')) { + return '' . t('You can enable the newly-created block for this menu on the Block layout page.', array('!blocks' => \Drupal::url('block.admin_display'))) . '
'; } - elseif ($path == 'admin/structure/menu' && \Drupal::moduleHandler()->moduleExists('block')) { + elseif ($route_name == 'menu_ui.overview_page' && \Drupal::moduleHandler()->moduleExists('block')) { return '' . t('Each menu has a corresponding block that is managed on the Block layout page.', array('!blocks' => \Drupal::url('block.admin_display'))) . '
'; } } diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 8973c7eaac303cb8b5822cadf9d982c1c9f0d7f8..e749f86e49937f727effe2e53d6aceae81b6c1ad 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -12,6 +12,7 @@ use Drupal\Core\Language\Language; use Drupal\Core\Render\Element; use Drupal\Core\Url; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Drupal\Core\Cache\Cache; use Drupal\Core\Database\Query\AlterableInterface; @@ -85,13 +86,13 @@ /** * Implements hook_help(). */ -function node_help($path, $arg) { +function node_help($route_name, Request $request) { // Remind site administrators about the {node_access} table being flagged // for rebuild. We don't need to issue the message on the confirm form, or // while the rebuild is being processed. - if ($path != 'admin/reports/status/rebuild' && $path != 'batch' && strpos($path, '#') === FALSE - && user_access('access administration pages') && node_access_needs_rebuild()) { - if ($path == 'admin/reports/status') { + if ($route_name != 'node.configure_rebuild_confirm' && $route_name != 'system.batch_page.normal' && $route_name != 'help.page.node' && $route_name != 'help.main' + && user_access('access administration pages') && node_access_needs_rebuild()) { + if ($route_name == 'system.status') { $message = t('The content access permissions need to be rebuilt.'); } else { @@ -100,8 +101,8 @@ function node_help($path, $arg) { drupal_set_message($message, 'error'); } - switch ($path) { - case 'admin/help#node': + switch ($route_name) { + case 'help.page.node': $output = ''; $output .= '' . t('The Node module manages the creation, editing, deletion, settings, and display of the main site content. Content items managed by the Node module are typically displayed as pages on your site, and include a title, some meta-data (author, creation time, content type, etc.), and optional fields containing text or other data (fields are managed by the Field module). For more information, see the online documentation for the Node module.', array('!node' => 'https://drupal.org/documentation/modules/node', '!field' => \Drupal::url('help.page', array('name' => 'field')))) . '
'; @@ -120,30 +121,31 @@ function node_help($path, $arg) { $output .= ''; return $output; - case 'admin/structure/types/add': + case 'node.type_add': return '' . t('Individual content types can have different fields, behaviors, and permissions assigned to them.') . '
'; - case 'admin/structure/types/manage/%/form-display': - $type = entity_load('node_type', $arg[4]); + case 'field_ui.form_display_overview_node': + case 'field_ui.form_display_overview_form_mode_node': + $type = $request->attributes->get('node_type'); return '' . t('Content items can be edited using different form modes. Here, you can define which fields are shown and hidden when %type content is edited in each form mode, and define how the field form widgets are displayed in each form mode.', array('%type' => $type->label())) . '
' ; - case 'admin/structure/types/manage/%/display': - $type = entity_load('node_type', $arg[4]); + case 'field_ui.display_overview_node': + case 'field_ui.display_overview_view_mode_node': + $type = $request->attributes->get('node_type'); return '' . t('Content items can be displayed using different view modes: Teaser, Full content, Print, RSS, etc. Teaser is a short format that is typically used in lists of multiple content items. Full content is typically used when the content is displayed on its own page.') . '
' . '' . t('Here, you can define which fields are shown and hidden when %type content is displayed in each view mode, and define how the fields are displayed in each view mode.', array('%type' => $type->label())) . '
'; - case 'node/%/revisions': + case 'node.revision_overview': return '' . t('Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.') . '
'; - case 'node/%/edit': - $node = node_load($arg[1]); - $type = node_type_load($node->bundle()); + case 'node.page_edit': + $node = $request->attributes->get('node'); + $type = $node->getType(); return (!empty($type->help) ? Xss::filterAdmin($type->help) : ''); - } - if ($arg[0] == 'node' && $arg[1] == 'add' && $arg[2]) { - $type = node_type_load($arg[2]); - return (!empty($type->help) ? Xss::filterAdmin($type->help) : ''); + case 'node.add': + $type = $request->attributes->get('node_type'); + return (!empty($type->help) ? Xss::filterAdmin($type->help) : ''); } } diff --git a/core/modules/options/options.module b/core/modules/options/options.module index 66fcb424daae9c5d14ae5b622e9d39d7f3b04401..71bbf33b291276f2d8aa17da09bb14eda59fe7a9 100644 --- a/core/modules/options/options.module +++ b/core/modules/options/options.module @@ -9,13 +9,14 @@ use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\field\FieldConfigInterface; use Drupal\field\FieldConfigUpdateForbiddenException; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function options_help($path, $arg) { - switch ($path) { - case 'admin/help#options': +function options_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.options': $output = ''; $output .= '' . t('The Options module allows you to create fields where data values are selected from a fixed list of options. Usually these items are entered through a select list, checkboxes, or radio buttons. See the Field module help and the Field UI help pages for general information on fields and how to create and manage them. For more information, see the online documentation for the Options module.', array('!field' => \Drupal::url('help.page', array('name' => 'field')), '!field_ui' => \Drupal::url('help.page', array('name' => 'field_ui')), '!options_do' => 'https://drupal.org/documentation/modules/options')) . '
'; diff --git a/core/modules/path/path.module b/core/modules/path/path.module index 9be6cbd80f93dca15ce31ad3bde3c57abffdcb27..ab102a95d786cc60d7306ba568f195f39a896663 100644 --- a/core/modules/path/path.module +++ b/core/modules/path/path.module @@ -10,13 +10,14 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Field\FieldDefinition; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function path_help($path, $arg) { - switch ($path) { - case 'admin/help#path': +function path_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.path': $output = ''; $output .= '' . t('The Path module allows you to specify an alias, or custom URL, for any existing internal system path. Aliases should not be confused with URL redirects, which allow you to forward a changed or inactive URL to a new URL. In addition to making URLs more readable, aliases also help search engines index content more effectively. Multiple aliases may be used for a single internal system path. To automate the aliasing of paths, you can install the contributed module Pathauto. For more information, see the online handbook entry for the Path module.', array('@path' => 'http://drupal.org/documentation/modules/path', '@pathauto' => 'http://drupal.org/project/pathauto')) . '
'; @@ -32,10 +33,10 @@ function path_help($path, $arg) { $output .= ''; return $output; - case 'admin/config/search/path': + case 'path.admin_overview': return '' . t("An alias defines a different name for an existing URL path - for example, the alias 'about' for the URL path 'node/1'. A URL path can have multiple aliases.") . '
'; - case 'admin/config/search/path/add': + case 'path.admin_add': return '' . t('Enter the path you wish to create the alias for, followed by the name of the new alias.') . '
'; } } diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module index bf8c60e606a918115e404d46f9c9130d1033acd5..8ea735b51ec923e66e03043d6c116a35b0231646 100644 --- a/core/modules/rdf/rdf.module +++ b/core/modules/rdf/rdf.module @@ -7,13 +7,14 @@ use Drupal\Core\Template\Attribute; use Symfony\Cmf\Component\Routing\RouteObjectInterface; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function rdf_help($path, $arg) { - switch ($path) { - case 'admin/help#rdf': +function rdf_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.rdf': $output = ''; $output .= '' . t('The RDF module enriches your content with metadata to let other applications (e.g., search engines, aggregators, and so on) better understand its relationships and attributes. This semantically enriched, machine-readable output for Drupal sites uses the RDFa specification, which allows RDF data to be embedded in HTML markup. Other modules can define mappings of their data to RDF terms, and the RDF module makes this RDF data available to the theme. The core Drupal modules define RDF mappings for their data model, and the core Drupal themes output this RDF metadata information along with the human-readable visual information. For more information, see the online documentation for the RDF module.', array('!rdfa' => 'http://www.w3.org/TR/xhtml-rdfa-primer/', '!rdf' => 'https://drupal.org/documentation/modules/rdf')) . '
'; diff --git a/core/modules/responsive_image/responsive_image.module b/core/modules/responsive_image/responsive_image.module index be888b466cbbb213d1523ad5d978231a953644cd..82ecafef81ea374fbbfbe819a487f4a0d2c4146a 100644 --- a/core/modules/responsive_image/responsive_image.module +++ b/core/modules/responsive_image/responsive_image.module @@ -7,14 +7,15 @@ use Drupal\responsive_image\Entity\ResponsiveImageMapping; use \Drupal\Core\Template\Attribute; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function responsive_image_help($path, $arg) { +function responsive_image_help($route_name, Request $request) { $output = ''; - switch ($path) { - case 'admin/help#responsive_image': + switch ($route_name) { + case 'help.page.responsive_image': $output .= '' . t('The Responsive Image module provides an image formatter and breakpoint mappings to output responsive images using the HTML5 picture tag. For more information, see the online documentation for the Responsive Image module.', array( '!responsive_image' => 'https://drupal.org/documentation/modules/responsive_image')) . '
'; $output .= '' . t('A responsive image mapping associates an image style with each breakpoint defined by your theme.') . '
'; break; diff --git a/core/modules/rest/rest.module b/core/modules/rest/rest.module index 086961af362989841790fcdae437ae563dbdfb73..a3cf32b5d0d2697f762bbbfbc17b4ff7afc535c4 100644 --- a/core/modules/rest/rest.module +++ b/core/modules/rest/rest.module @@ -5,6 +5,8 @@ * RESTful web services module. */ +use Symfony\Component\HttpFoundation\Request; + /** * Implements hook_permission(). */ @@ -24,10 +26,9 @@ function rest_permission() { /** * Implements hook_help(). */ -function rest_help($path, $arg) { - switch ($path) { - // Main module help for the REST module. - case 'admin/help#rest': +function rest_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.rest': $output = ''; $output .= '' . t('The REST module provides a framework for exposing Drupal\'s data structures as RESTful web services. It can be used to read and write resources remotely, such as entity types like nodes or users. For more information, see the online handbook entry for the RESTful web services module.', array('@rest' => 'http://drupal.org/documentation/modules/rest')) . '
'; diff --git a/core/modules/search/lib/Drupal/search/Controller/SearchController.php b/core/modules/search/lib/Drupal/search/Controller/SearchController.php index ec7d8bfd97b7e78fd0baab3ec2911034f017f9f8..bd434f50508fdf018d3a81ea597f8f2fcb29dff4 100644 --- a/core/modules/search/lib/Drupal/search/Controller/SearchController.php +++ b/core/modules/search/lib/Drupal/search/Controller/SearchController.php @@ -93,12 +93,17 @@ public function view(Request $request, SearchPageInterface $entity) { ); } + $no_results = t('' . t('The Search module provides the ability to index and search for content by exact keywords, and for users by username or e-mail. For more information, see the online handbook entry for Search module.', array('@search-module' => 'http://drupal.org/documentation/modules/search', '@search' => url('search'))) . '
'; @@ -87,14 +88,9 @@ function search_help($path, $arg) { $output .= '' . t('The search engine maintains an index of words found in your site\'s content. To build and maintain this index, a correctly configured cron maintenance task is required. Indexing behavior can be adjusted using the settings below.', array('@cron' => url('admin/reports/status'))) . '
'; - case 'search#noresults': - return t('' . t('The Serialization module provides a service for serializing and deserializing data to and from formats such as JSON and XML.') . '
'; diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module index ed180b6db9f94edc5b5ad7d9d91c2c234fe73b83..a565e808aab369afc2e250af4c91242818dff040 100644 --- a/core/modules/shortcut/shortcut.module +++ b/core/modules/shortcut/shortcut.module @@ -15,11 +15,9 @@ /** * Implements hook_help(). */ -function shortcut_help($path, $arg) { - $user = \Drupal::currentUser(); - - switch ($path) { - case 'admin/help#shortcut': +function shortcut_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.shortcut': $output = '' . t('The Shortcut module allows users to create sets of shortcut links to commonly-visited pages of the site. Shortcuts are contained within sets. Each user with Select any shortcut set permission can select a shortcut set created by anyone at the site. For more information, see the online handbook entry for Shortcut module.', array('!shortcut' => 'http://drupal.org/documentation/modules/shortcut')) . '
'; $output .= '' . t('Define which shortcut set you are using on the Shortcuts tab of your account page.', array('@shortcut-link' => url("user/{$user->id()}/shortcuts"))) . '
'; return $output; diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module index dbf1dff84901c893848e0e13bc9c6a0467924225..914228e98d81bdf6040781f8ac82759fe7e41c0e 100644 --- a/core/modules/simpletest/simpletest.module +++ b/core/modules/simpletest/simpletest.module @@ -5,6 +5,7 @@ use Drupal\Core\Extension\ExtensionDiscovery; use Drupal\Core\Render\Element; use Drupal\simpletest\TestBase; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Process\PhpExecutableFinder; /** @@ -15,9 +16,9 @@ /** * Implements hook_help(). */ -function simpletest_help($path, $arg) { - switch ($path) { - case 'admin/help#simpletest': +function simpletest_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.simpletest': $output = ''; $output .= '' . t('The Testing module provides a framework for running automated tests. It can be used to verify a working state of Drupal before and after any code changes, or as a means for developers to write and execute tests for their modules. For more information, see the online documentation for the Testing module.', array('!simpletest' => 'https://drupal.org/documentation/modules/simpletest')) . '
'; @@ -29,7 +30,7 @@ function simpletest_help($path, $arg) { $output .= ''; return $output; - case 'admin/config/development/testing': + case 'simpletest.test_form': $output = t('Select the test(s) or test group(s) you would like to run, and click Run tests.'); return $output; } diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module index 5215204189273648a21ba8cdfa28cb1d79b67c1c..e5828c365ba4d0709176ba8cc53507404a5eefbc 100644 --- a/core/modules/statistics/statistics.module +++ b/core/modules/statistics/statistics.module @@ -8,13 +8,14 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\Display\EntityViewDisplayInterface; use Drupal\node\NodeInterface; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function statistics_help($path, $arg) { - switch ($path) { - case 'admin/help#statistics': +function statistics_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.statistics': $output = ''; $output .= '' . t('The Statistics module shows you how often content is viewed. This is useful in determining which pages of your site are most popular. For more information, see the online documentation for the Statistics module.', array('!statistics_do' => 'https://drupal.org/documentation/modules/statistics/')) . '
'; @@ -26,7 +27,8 @@ function statistics_help($path, $arg) { $output .= '' . t('Settings for the statistical information that Drupal will keep about the site.') . '
'; } } diff --git a/core/modules/syslog/syslog.module b/core/modules/syslog/syslog.module index a93ee93c58dcc0a69c139b7da98a950d2d9a860d..ba54118e577ce4d8478c76d77791d752b5a5831e 100644 --- a/core/modules/syslog/syslog.module +++ b/core/modules/syslog/syslog.module @@ -5,12 +5,14 @@ * Redirects logging messages to syslog. */ +use Symfony\Component\HttpFoundation\Request; + /** * Implements hook_help(). */ -function syslog_help($path, $arg) { - switch ($path) { - case 'admin/help#syslog': +function syslog_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.syslog': $output = ''; $output .= '' . t("The Syslog module logs events by sending messages to the logging facility of your web server's operating system. Syslog is an operating system administrative logging tool that provides valuable information for use in system management and security auditing. Most suited to medium and large sites, Syslog provides filtering tools that allow messages to be routed by type and severity. For more information, see the online documentation for the Syslog module, as well as PHP's documentation pages for the openlog and syslog functions.", array('!syslog' => 'https://drupal.org/documentation/modules/syslog', '!php_openlog' => 'http://www.php.net/manual/function.openlog.php', '!php_syslog' => 'http://www.php.net/manual/function.syslog.php')) . '
'; diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php index 1966bb5efd68b50a4da3a72461ec7b0b0c3d6ce8..d061495280f7a1caeab5a669f275b7dcec6d0ea5 100644 --- a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php @@ -207,14 +207,10 @@ protected function buildRow(array $modules, Extension $module, $distribution) { $row['description']['#markup'] = $this->t($module->info['description']); $row['version']['#markup'] = $module->info['version']; - // Add links for each module. - // Used when checking if a module implements a help page. - $help = $this->moduleHandler->moduleExists('help') ? drupal_help_arg() : FALSE; - // Generate link for module's help page, if there is one. $row['links']['help'] = array(); - if ($help && $module->status && in_array($module->getName(), $this->moduleHandler->getImplementations('help'))) { - if ($this->moduleHandler->invoke($module->getName(), 'help', array('admin/help#' . $module->getName(), $help))) { + if ($this->moduleHandler->moduleExists('help') && $module->status && in_array($module->getName(), $this->moduleHandler->getImplementations('help'))) { + if ($this->moduleHandler->invoke($module->getName(), 'help', array('help.page.' . $module->getName(), $this->getRequest()))) { $row['links']['help'] = array( '#type' => 'link', '#title' => $this->t('Help'), diff --git a/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php b/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php index 7105a3031fa0871504d62148267962d8751442c9..d15cfc6da8cb364648f4d3ffbc7427d4067f605d 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php +++ b/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php @@ -11,6 +11,7 @@ use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Session\AccountInterface; +use Symfony\Cmf\Component\Routing\RouteObjectInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; @@ -89,23 +90,14 @@ public function access(AccountInterface $account) { * The current request. */ protected function getActiveHelp(Request $request) { - $output = ''; - $router_path = $request->attributes->get('_system_path'); // Do not show on a 403 or 404 page. if ($request->attributes->has('exception')) { return ''; } - $arg = drupal_help_arg(explode('/', $router_path)); - - foreach ($this->moduleHandler->getImplementations('help') as $module) { - $function = $module . '_help'; - // Lookup help for this path. - if ($help = $function($router_path, $arg)) { - $output .= $help . "\n"; - } - } - return $output; + $route_name = $request->attributes->get(RouteObjectInterface::ROUTE_NAME); + $help = $this->moduleHandler->invokeAll('help', array($route_name, $request)); + return $help ? implode("\n", $help) : ''; } /** diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 6fd6ba45679cc3723f88ee40a7f28d60ed94b8c9..bef03495f3cd0518d75d9392a570852a7fd5fa99 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -13,6 +13,7 @@ use Drupal\user\UserInterface; use Symfony\Component\HttpFoundation\RedirectResponse; use GuzzleHttp\Exception\RequestException; +use Symfony\Component\HttpFoundation\Request; /** * New users will be set to the default time zone at registration. @@ -73,11 +74,11 @@ /** * Implements hook_help(). */ -function system_help($path, $arg) { +function system_help($route_name, Request $request) { global $base_url; - switch ($path) { - case 'admin/help#system': + switch ($route_name) { + case 'help.page.system': $output = ''; $output .= '' . t('The System module is integral to the site, and provides basic but extensible functionality for use by other modules and themes. Some integral elements of Drupal are contained in and managed by the System module, including caching, enabling and disabling modules and themes, preparing and displaying the administrative page, and configuring fundamental site settings. A number of key system maintenance operations are also part of the System module. For more information, see the online handbook entry for System module.', array('@system' => 'http://drupal.org/documentation/modules/system')) . '
'; @@ -95,18 +96,23 @@ function system_help($path, $arg) { $output .= '' . t('This page shows you all available administration tasks for each module.') . '
'; - case 'admin/appearance': + + case 'system.themes_page': $output = '' . t('Set and configure the default theme for your website. Alternative themes are available.', array('@themes' => 'http://drupal.org/project/themes')) . '
'; return $output; - case 'admin/appearance/settings/' . $arg[3]: + + case 'system.theme_settings_theme': $theme_list = list_themes(); - $theme = $theme_list[$arg[3]]; + $theme = $theme_list[$request->attributes->get('theme')]; return '' . t('These options control the display settings for the %name theme. When your site is displayed using this theme, these settings will be used.', array('%name' => $theme->info['name'])) . '
'; - case 'admin/appearance/settings': + + case 'system.theme_settings': return '' . t('These options control the default display settings for your entire site, across all themes. Unless they have been overridden by a specific theme, these settings will be used.') . '
'; - case 'admin/modules': + + case 'system.modules_list': $output = '' . t('Download additional contributed modules to extend Drupal\'s functionality.', array('@modules' => 'http://drupal.org/project/modules')) . '
'; if (\Drupal::moduleHandler()->moduleExists('update')) { if (update_manager_access()) { @@ -120,19 +126,29 @@ function system_help($path, $arg) { $output .= '' . t('Regularly review available updates to maintain a secure and current site. Always run the update script each time a module is updated. Enable the Update Manager module to update and install modules and themes.', array('@update-php' => $base_url . '/core/update.php')) . '
'; } return $output; - case 'admin/modules/uninstall': + + case 'system.modules_uninstall': return '' . t('The uninstall process removes all data related to a module.') . '
'; - case 'admin/structure/block/manage': - if ($arg[4] == 'system' && $arg[5] == 'powered-by') { + + case 'block.admin_edit': + if (($block = $request->attributes->get('block')) && $block->get('plugin') == 'system_powered_by_block') { return '' . t('The Powered by Drupal block is an optional link to the home page of the Drupal project. While there is absolutely no requirement that sites feature this link, it may be used to show support for Drupal.') . '
'; } break; - case 'admin/config/development/maintenance': + + case 'block.admin_add': + if ($request->attributes->get('plugin_id') == 'system_powered_by_block') { + return '' . t('The Powered by Drupal block is an optional link to the home page of the Drupal project. While there is absolutely no requirement that sites feature this link, it may be used to show support for Drupal.') . '
'; + } + break; + + case 'system.site_maintenance_mode': if (\Drupal::currentUser()->id() == 1) { return '' . t('Use maintenance mode when making major updates, particularly if the updates could disrupt visitors or the update process. Examples include upgrading, importing or exporting content, modifying a theme, modifying content types, and making backups.') . '
'; } break; - case 'admin/reports/status': + + case 'system.status': return '' . t("Here you can find a short overview of your site's parameters as well as any problems detected with your installation. It may be useful to copy and paste this information into support requests filed on drupal.org's support forums and project issue queues. Before filing a support request, ensure that your web server meets the system requirements.", array('@system-requirements' => 'http://drupal.org/requirements')) . '
'; } } diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index 69bb53075404c2b79c238f493937d8a77b9e7c0d..7dff5d99d6e4877199cbbcb22cd2e44473380322 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -16,6 +16,7 @@ use Drupal\taxonomy\Entity\Vocabulary; use Drupal\taxonomy\VocabularyInterface; use Drupal\Component\Utility\String; +use Symfony\Component\HttpFoundation\Request; /** * Denotes that no term in the vocabulary has a parent. @@ -43,9 +44,9 @@ /** * Implements hook_help(). */ -function taxonomy_help($path, $arg) { - switch ($path) { - case 'admin/help#taxonomy': +function taxonomy_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.taxonomy': $output = ''; $output .= '' . t('The Taxonomy module allows you to classify the content of your website. To classify content, you define vocabularies that contain related terms, and then assign the vocabularies to content types. For more information, see the online handbook entry for the Taxonomy module.', array('@taxonomy' => 'http://drupal.org/documentation/modules/taxonomy')) . '
'; @@ -72,11 +73,13 @@ function taxonomy_help($path, $arg) { $output .= '' . t('Taxonomy is for categorizing content. Terms are grouped into vocabularies. For example, a vocabulary called "Fruit" would contain the terms "Apple" and "Banana".') . '
'; return $output; - case 'admin/structure/taxonomy/manage/%': - $vocabulary = entity_load('taxonomy_vocabulary', $arg[4]); + + case 'taxonomy.overview_terms': + $vocabulary = $request->attributes->get('taxonomy_vocabulary'); switch ($vocabulary->hierarchy) { case TAXONOMY_HIERARCHY_DISABLED: return '' . t('You can reorganize the terms in %capital_name using their drag-and-drop handles, and group terms under a parent term by sliding them under and to the right of the parent.', array('%capital_name' => drupal_ucfirst($vocabulary->name), '%name' => $vocabulary->name)) . '
'; diff --git a/core/modules/telephone/telephone.module b/core/modules/telephone/telephone.module index eee9213969642f962556d063b7d8a533edc4b53f..f7dbc4ecd30ea29f5dfea2238562b689213fe452 100644 --- a/core/modules/telephone/telephone.module +++ b/core/modules/telephone/telephone.module @@ -5,12 +5,14 @@ * Defines a simple telephone number field type. */ +use Symfony\Component\HttpFoundation\Request; + /** * Implements hook_help(). */ -function telephone_help($path, $arg) { - switch ($path) { - case 'admin/help#telephone': +function telephone_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.telephone': $output = ''; $output .= '' . t('The Telephone module allows you to create fields that contain telephone numbers. See the Field module help and the Field UI help pages for general information on fields and how to create and manage them. For more information, see the online documentation for the Telephone module.', array('!field' => \Drupal::url('help.page', array('name' => 'field')), '!field_ui' => \Drupal::url('help.page', array('name' => 'field_ui')), '!telephone_documentation' => 'https://drupal.org/documentation/modules/telephone')) . '
'; diff --git a/core/modules/text/text.module b/core/modules/text/text.module index 339d9dace58a3c671437f580c3abb265387f1dd7..37db348d48b7dda47bef46f7a7c8e18303eab305 100644 --- a/core/modules/text/text.module +++ b/core/modules/text/text.module @@ -7,13 +7,14 @@ use Drupal\Component\Utility\Html; use Drupal\Core\Entity\EntityInterface; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function text_help($path, $arg) { - switch ($path) { - case 'admin/help#text': +function text_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.text': $output = ''; $output .= '' . t('The Text module allows you to create short and long text fields with optional summaries. See the Field module help and the Field UI help pages for general information on fields and how to create and manage them. For more information, see the online documentation for the Text module.', array('!field' => \Drupal::url('help.page', array('name' => 'field')), '!field_ui' => \Drupal::url('help.page', array('name' => 'field_ui')), '!text_documentation' => 'https://drupal.org/documentation/modules/text')) . '
'; diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module index 0f58cb277aef11911cb7d40bc4dbb35e15367401..2a76441b93eb128d8a2ca00525de0dd7f389d249 100644 --- a/core/modules/toolbar/toolbar.module +++ b/core/modules/toolbar/toolbar.module @@ -10,6 +10,7 @@ use Drupal\Core\Render\Element; use Drupal\Core\Template\Attribute; use Drupal\Component\Utility\Crypt; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Drupal\menu_link\MenuLinkInterface; use Drupal\user\RoleInterface; @@ -18,9 +19,9 @@ /** * Implements hook_help(). */ -function toolbar_help($path, $arg) { - switch ($path) { - case 'admin/help#toolbar': +function toolbar_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.toolbar': $output = '' . t('The Toolbar module displays links to top-level administration menu items and links from other modules at the top of the screen. For more information, see the online handbook entry for Toolbar module.', array('@toolbar' => 'http://drupal.org/documentation/modules/toolbar')) . '
'; $output .= '' . t("The Tour module provides users with guided tours of the site interface. Each tour consists of several tips that highlight elements of the user interface, guide the user through a workflow, or explain key concepts of the website. For more information, see the online documentation for the Tour module.", array('!tour' => 'https://drupal.org/documentation/modules/tour')) . '
'; diff --git a/core/modules/tracker/tracker.module b/core/modules/tracker/tracker.module index 96aecbf01f7c27b2001f15a8760113a5915b1fee..98042f50aa169fde05b75068793cb7575975a71f 100644 --- a/core/modules/tracker/tracker.module +++ b/core/modules/tracker/tracker.module @@ -9,13 +9,14 @@ use Drupal\comment\CommentInterface; use Drupal\node\NodeInterface; use Drupal\Core\Session\AccountInterface; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function tracker_help($path, $arg) { - switch ($path) { - case 'admin/help#tracker': +function tracker_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.tracker': $output = '' . t('The Tracker module displays the most recently added and updated content on your site, and allows you to follow new content created by each user. This module has no configuration options. For more information, see the online handbook entry for Tracker module.', array('@tracker' => 'http://drupal.org/documentation/modules/tracker')) . '
'; $output .= '' . t('Here you can find information about available updates for your installed modules and themes. Note that each module or theme is part of a "project", which may or may not have the same name, and might include multiple modules or themes within it.') . '
'; - - case 'admin/help#update': +function update_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.update': $output = ''; $output .= '' . t("The Update Manager module periodically checks for new versions of your site's software (including contributed modules and themes), and alerts administrators to available updates. In order to provide update information, anonymous usage statistics are sent to Drupal.org. If desired, you may disable the Update Manager module from the Module administration page. For more information, see the online handbook entry for Update Manager module.", array('@update' => 'http://drupal.org/documentation/modules/update', '@modules' => url('admin/modules'))) . '
'; @@ -89,6 +87,9 @@ function update_help($path, $arg) { } $output .= ''; return $output; + + case 'update.status': + return '' . t('Here you can find information about available updates for your installed modules and themes. Note that each module or theme is part of a "project", which may or may not have the same name, and might include multiple modules or themes within it.') . '
'; } } diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 08b5de3d40c6de1552c7f2220f1cd0b9d3d036e5..955f644c61b9fe7083eb29fbf1a4d911f26f2726 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -14,6 +14,7 @@ use Drupal\Core\Template\Attribute; use Drupal\Core\TypedData\DataDefinition; use Symfony\Component\HttpFoundation\RedirectResponse; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Drupal\menu_link\Entity\MenuLink; @@ -46,9 +47,9 @@ /** * Implement hook_help(). */ -function user_help($path, $arg) { - switch ($path) { - case 'admin/help#user': +function user_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.user': $output = ''; $output .= '' . t('The User module allows users to register, log in, and log out. It also allows users with proper permissions to manage user roles and permissions. For more information, see the online documentation for the User module.', array('!user_docs' => 'https://drupal.org/documentation/modules/user')) . '
'; @@ -66,11 +67,14 @@ function user_help($path, $arg) { $output .= '' . t("This web page allows administrators to register new users. Users' e-mail addresses and usernames must be unique.") . '
'; - case 'admin/people/permissions': + + case 'user.admin_permissions': return '' . t('Permissions let you control what users can do and see on your site. You can define a specific set of permissions for each role. (See the Roles page to create a role). Two important roles to consider are Authenticated Users and Administrators. Any permissions granted to the Authenticated Users role will be given to any user who can log into your site. You can make any role the Administrator role for the site, meaning this will be granted all new permissions automatically. You can do this on the User Settings page. You should be careful to ensure that only trusted users are given this access and level of control of your site.', array('@role' => url('admin/people/roles'), '@settings' => url('admin/config/people/accounts'))) . '
'; - case 'admin/people/roles': + + case 'user.role_list': $output = '' . t('Roles allow you to fine tune the security and administration of Drupal. A role defines a group of users that have certain privileges as defined on the permissions page. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the names and order of the roles on your site. It is recommended to order your roles from least permissive (anonymous user) to most permissive (administrator). To delete a role choose "edit role".', array('@permissions' => url('admin/people/permissions'))) . '
'; $output .= '' . t('Drupal has three special user roles:') . '
'; $output .= '' . t('This form lets administrators add and edit fields for storing user data.') . '
'; - case 'admin/config/people/accounts/form-display': + + case 'field_ui.form_display_overview_user': return '' . t('This form lets administrators configure how form fields should be displayed when editing a user profile.') . '
'; - case 'admin/config/people/accounts/display': + + case 'field_ui.display_overview_user': return '' . t('This form lets administrators configure how fields should be displayed when rendering a user profile page.') . '
'; - case 'admin/people/search': - return '' . t('Enter a simple pattern ("*" may be used as a wildcard match) to search for a username or e-mail address. For example, one may search for "br" and Drupal might return "brian", "brad", and "brenda@example.com".') . '
'; } } diff --git a/core/modules/views/views.module b/core/modules/views/views.module index 9d6e4af08c30d62fec5353e8ad1935a3f9c4fc9f..216bc934515e6dba39c03518d018e030582a5047 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -21,13 +21,14 @@ use Drupal\views\Entity\View; use Drupal\views\Views; use Drupal\field\FieldInstanceConfigInterface; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function views_help($path, $arg) { - switch($path) { - case 'admin/help#views': +function views_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.views': $output = ''; $output .= '' . t('The Views module provides a back end to fetch information from content, user accounts, taxonomy terms, and other entities from the database and present it to the user as a grid, HTML list, table, unformatted list, etc. The resulting displays are known generally as views.') . '
'; diff --git a/core/modules/views_ui/views_ui.module b/core/modules/views_ui/views_ui.module index a8cdfd5619963602f193e75840df05321b348f42..a39fa71c376378868764890ce44d91caa0ea180e 100644 --- a/core/modules/views_ui/views_ui.module +++ b/core/modules/views_ui/views_ui.module @@ -12,14 +12,14 @@ use Drupal\views\Analyzer; use Drupal\Core\Ajax\AjaxResponse; use Drupal\Core\Ajax\ReplaceCommand; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_help(). */ -function views_ui_help($path, $arg) { - - switch ($path) { - case 'admin/help#views_ui': +function views_ui_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.views_ui': $output = ''; $output .= '' . t('The Views UI module provides an interface for managing views for the Views module. For more information, see the online documentation for the Views UI module.', array('@views' => \Drupal::url('help.page', array('name' => 'views')), '@handbook' => 'https://drupal.org/documentation/modules/views_ui')) . '
'; diff --git a/core/modules/xmlrpc/xmlrpc.module b/core/modules/xmlrpc/xmlrpc.module index 187da853446e0c112db509598e85cf465f10b734..bc82806d3e635894e34fd00991be34b9237da7d3 100644 --- a/core/modules/xmlrpc/xmlrpc.module +++ b/core/modules/xmlrpc/xmlrpc.module @@ -5,12 +5,14 @@ * Enables XML-RPC functionality. */ +use Symfony\Component\HttpFoundation\Request; + /** * Implements hook_help(). */ -function xmlrpc_help($path, $args) { - switch ($path) { - case 'admin/help#xmlrpc': +function xmlrpc_help($route_name, Request $request) { + switch ($route_name) { + case 'help.page.xmlrpc': $output = ''; $output .= '' . t('The XML-RPC module gives external systems the opportunity to communicate with the site through the XML-RPC protocol. An XML-RPC client can communicate with the site by making a request to xmlrpc.php. For more information, see the online documentation for the XML-RPC module.', array('!xrphp' => \Drupal::url('xmlrpc.php'),'!xrdocs' => 'https://drupal.org/documentation/modules/xmlrpc')) . '
';