summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2014-05-07 02:04:53 (GMT)
committerwebchick2014-05-07 02:04:53 (GMT)
commiteef067b5a5d867174482abde5e4a7d7882a3d540 (patch)
tree6e00844584285adb00aa7b36f0362571be6f2356
parentb619a2c619428ebd873426b9f24f31b387886163 (diff)
Issue #2183113 by jhodgdon, effulgentsia, tim.plunkett, herom, larowlan: Update hook_help signature to use route_name instead of path.
-rw-r--r--core/includes/menu.inc8
-rw-r--r--core/modules/action/action.module13
-rw-r--r--core/modules/aggregator/aggregator.module16
-rw-r--r--core/modules/ban/ban.module10
-rw-r--r--core/modules/basic_auth/basic_auth.module8
-rw-r--r--core/modules/block/block.module16
-rw-r--r--core/modules/block/custom_block/custom_block.module11
-rw-r--r--core/modules/book/book.module13
-rw-r--r--core/modules/breakpoint/breakpoint.module7
-rw-r--r--core/modules/ckeditor/ckeditor.module7
-rw-r--r--core/modules/color/color.module7
-rw-r--r--core/modules/comment/comment.module9
-rw-r--r--core/modules/config/config.module10
-rw-r--r--core/modules/config_translation/config_translation.module9
-rw-r--r--core/modules/contact/contact.module10
-rw-r--r--core/modules/content_translation/content_translation.module9
-rw-r--r--core/modules/contextual/contextual.module7
-rw-r--r--core/modules/dblog/dblog.module10
-rw-r--r--core/modules/editor/editor.module7
-rw-r--r--core/modules/entity/entity.module7
-rw-r--r--core/modules/entity_reference/entity_reference.module7
-rw-r--r--core/modules/field/field.module7
-rw-r--r--core/modules/field_ui/field_ui.module9
-rw-r--r--core/modules/file/file.module7
-rw-r--r--core/modules/filter/filter.module11
-rw-r--r--core/modules/forum/forum.module19
-rw-r--r--core/modules/hal/hal.module8
-rw-r--r--core/modules/help/help.api.php38
-rw-r--r--core/modules/help/help.module11
-rw-r--r--core/modules/help/lib/Drupal/help/Controller/HelpController.php22
-rw-r--r--core/modules/history/history.module7
-rw-r--r--core/modules/image/image.module25
-rw-r--r--core/modules/language/language.module32
-rw-r--r--core/modules/link/link.module9
-rw-r--r--core/modules/locale/locale.module15
-rw-r--r--core/modules/menu_link/menu_link.module7
-rw-r--r--core/modules/menu_ui/menu_ui.module13
-rw-r--r--core/modules/node/node.module40
-rw-r--r--core/modules/options/options.module7
-rw-r--r--core/modules/path/path.module11
-rw-r--r--core/modules/rdf/rdf.module7
-rw-r--r--core/modules/responsive_image/responsive_image.module10
-rw-r--r--core/modules/rest/rest.module9
-rw-r--r--core/modules/search/lib/Drupal/search/Controller/SearchController.php7
-rw-r--r--core/modules/search/search.module16
-rw-r--r--core/modules/serialization/serialization.module13
-rw-r--r--core/modules/shortcut/shortcut.module14
-rw-r--r--core/modules/simpletest/simpletest.module9
-rw-r--r--core/modules/statistics/statistics.module10
-rw-r--r--core/modules/syslog/syslog.module8
-rw-r--r--core/modules/system/lib/Drupal/system/Form/ModulesListForm.php8
-rw-r--r--core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php16
-rw-r--r--core/modules/system/system.module44
-rw-r--r--core/modules/taxonomy/taxonomy.module15
-rw-r--r--core/modules/telephone/telephone.module8
-rw-r--r--core/modules/text/text.module7
-rw-r--r--core/modules/toolbar/toolbar.module7
-rw-r--r--core/modules/tour/tour.module7
-rw-r--r--core/modules/tracker/tracker.module7
-rw-r--r--core/modules/update/update.module13
-rw-r--r--core/modules/user/user.module27
-rw-r--r--core/modules/views/views.module7
-rw-r--r--core/modules/views_ui/views_ui.module8
-rw-r--r--core/modules/xmlrpc/xmlrpc.module8
64 files changed, 430 insertions, 354 deletions
diff --git a/core/includes/menu.inc b/core/includes/menu.inc
index 7a6828c..0fefe74 100644
--- a/core/includes/menu.inc
+++ b/core/includes/menu.inc
@@ -365,14 +365,6 @@ function theme_menu_local_action($variables) {
}
/**
- * 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.
*/
function menu_list_system_menus() {
diff --git a/core/modules/action/action.module b/core/modules/action/action.module
index 85ccee9..80c513b 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="!documentation">online documentation for the Action module</a>.', array('!documentation' => 'https://drupal.org/documentation/modules/action')) . '</p>';
@@ -23,12 +25,11 @@ function action_help($path, $arg) {
$output .= '</dl>';
return $output;
- case 'admin/config/system/actions':
- case 'admin/config/system/actions/manage':
+ case 'action.admin':
$output = '<p>' . 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 <em>Create</em> button.') . '</p>';
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 <em>Description</em> 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 47f2173..db175a6 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 @@ const AGGREGATOR_CLEAR_NEVER = 0;
/**
* 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="!aggregator-module">online documentation for the Aggregator module</a>.', array('!aggregator-module' => 'https://drupal.org/documentation/modules/aggregator')) . '</p>';
@@ -34,14 +35,17 @@ function aggregator_help($path, $arg) {
$output .= '<dd>' . t('A correctly configured <a href="!cron">cron maintenance task</a> is required to update feeds automatically.', array('!cron' => \Drupal::url('system.cron_settings'))) . '</dd>';
$output .= '</dl>';
return $output;
- case 'admin/config/services/aggregator':
+
+ case 'aggregator.admin_overview':
// Don't use placeholders for possibility to change URLs for translators.
$output = '<p>' . 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 <a href="http://cyber.law.harvard.edu/rss/">RSS</a>, <a href="http://www.w3.org/RDF/">RDF</a>, and <a href="http://www.atomenabled.org">Atom</a>.') . '</p>';
$output .= '<p>' . t('Current feeds are listed below, and <a href="!addfeed">new feeds may be added</a>. At the <a href="!block">blocks administration page</a> you can enable for each feed the block <em>Aggregator feed</em> that contains the <em>latest items</em> .', array('!addfeed' => \Drupal::url('aggregator.feed_add'), '!block' => \Drupal::url('block.admin_display'))) . '</p>';
return $output;
- case 'aggregator/sources/add':
+
+ case 'aggregator.feed_add':
return '<p>' . t('Add a feed in RSS, RDF or Atom format. A feed may only have one entry.') . '</p>';
- case 'admin/config/services/aggregator/add/opml':
+
+ case 'aggregator.opml_add':
return '<p>' . t('<abbr title="Outline Processor Markup Language">OPML</abbr> 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.') . '</p>';
}
}
diff --git a/core/modules/ban/ban.module b/core/modules/ban/ban.module
index 5e6ba65..f36a265 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Ban module allows administrators to ban visits to their site from individual IP addresses. For more information, see <a href="!url">the online documentation for the Ban module</a>.', array('!url' => 'https://drupal.org/documentation/modules/ban')) . '</p>';
@@ -21,7 +23,7 @@ function ban_help($path, $arg) {
$output .= '</dl>';
return $output;
- case 'admin/config/people/ban':
+ case 'ban.admin_page':
return '<p>' . 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.') . '</p>';
}
}
diff --git a/core/modules/basic_auth/basic_auth.module b/core/modules/basic_auth/basic_auth.module
index c7e0221..f8fd225 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The HTTP Basic Authentication module supplies an <a href="http://en.wikipedia.org/wiki/Basic_access_authentication">HTTP Basic authentication</a> 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 <a href="!rest_help">RESTful Web Services module</a>). For more information, see <a href="!hba_do">the online documentation for the HTTP Basic Authentication module</a>.', array('!hba_do' => 'https://drupal.org/documentation/modules/basic_auth', '!rest_help' => \Drupal::url('help.page', array('name' => 'rest')))) . '</p>';
diff --git a/core/modules/block/block.module b/core/modules/block/block.module
index 5190436..88b6ecc 100644
--- a/core/modules/block/block.module
+++ b/core/modules/block/block.module
@@ -10,6 +10,7 @@ use Drupal\Component\Plugin\Exception\PluginException;
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 @@ const BLOCK_VISIBILITY_PHP = 2;
/**
* 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Block module allows you to place blocks in regions and to configure their settings. For more information, see <a href="!blocks-documentation">the online documentation for the Blocks module</a>.', array('!blocks-documentation' => 'https://drupal.org/documentation/modules/block/')) . '</p>';
@@ -53,13 +54,8 @@ function block_help($path, $arg) {
$output .= '</dl>';
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 = '<p>' . 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 <em>Place blocks</em>. 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 <em>Save blocks</em> button at the bottom of the page.') . '</p>';
$output .= '<p>' . l(t('Demonstrate block regions (!theme)', array('!theme' => $themes[$demo_theme]->info['name'])), 'admin/structure/block/demo/' . $demo_theme) . '</p>';
diff --git a/core/modules/block/custom_block/custom_block.module b/core/modules/block/custom_block/custom_block.module
index 620611c..b20d2d0 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="!field-help">Field module help</a> for more information. Once created, custom blocks can be placed like blocks provided by other modules; see the <a href="!blocks">Block module help page</a> for details. For more information, see <a href="!online-help">the online documentation for the Custom Block module</a>.', 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')) . '</p>';
@@ -26,11 +27,11 @@ function custom_block_help($path, $arg) {
$output .= '</dl>';
return $output;
- case 'admin/structure/block/custom-blocks':
+ case 'custom_block.list':
$output = '<p>' . 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.') . '</p>';
return $output;
- case 'admin/structure/block/custom-blocks/types':
+ case 'custom_block.type_list':
$output = '<p>' . 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.') . '</p>';
return $output;
diff --git a/core/modules/book/book.module b/core/modules/book/book.module
index e5bb818..9cc4835 100644
--- a/core/modules/book/book.module
+++ b/core/modules/book/book.module
@@ -14,13 +14,14 @@ use Drupal\node\NodeTypeInterface;
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 = '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="!book">online documentation for the Book module</a>.', array('!book' => 'https://drupal.org/documentation/modules/book')) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
@@ -35,9 +36,11 @@ function book_help($path, $arg) {
$output .= '<dd>' . t("Users with the <em>View printer-friendly books</em> permission can select the <em>printer-friendly version</em> link visible at the bottom of a book page's content to generate a printer-friendly display of the page and all of its subsections.") . '</dd>';
$output .= '</dl>';
return $output;
- case 'admin/structure/book':
+
+ case 'book.admin':
return '<p>' . 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.') . '</p>';
- case 'node/%/outline':
+
+ case 'book.outline':
return '<p>' . t('The outline feature allows you to include pages in the <a href="!book">Book hierarchy</a>, as well as move them within the hierarchy or to <a href="!book-admin">reorder an entire book</a>.', array('!book' => \Drupal::url('book.render'), '!book-admin' => \Drupal::url('book.admin'))) . '</p>';
}
}
diff --git a/core/modules/breakpoint/breakpoint.module b/core/modules/breakpoint/breakpoint.module
index 19fe29f..8d6283b 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="!breakpoint_ui">Breakpoint UI</a> may provide one. For more information, see the <a href="!docs">online documentation for the Breakpoint module</a>.', array('!docs' => 'https://drupal.org/documentation/modules/breakpoint', '!breakpoint_ui' => 'https://drupal.org/project/breakpoint_ui')) . '</p>';
diff --git a/core/modules/ckeditor/ckeditor.module b/core/modules/ckeditor/ckeditor.module
index 7000dbf..8f640df 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="!text_editor">Text Editor module</a>. It requires JavaScript to be enabled in the browser. For more information, see <a href="!doc_url">the online documentation for the CKEditor module</a> and the <a href="!cke_url">CKEditor website</a>.', array( '!doc_url' => 'https://drupal.org/documentation/modules/ckeditor', '!cke_url' => 'http://ckeditor.com', '!text_editor' => \Drupal::url('help.page', array('name' => 'editor')))) . '</p>';
diff --git a/core/modules/color/color.module b/core/modules/color/color.module
index 02cabf3..5ac6340 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 = '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Color module allows users with the <em>Administer site configuration</em> 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 <a href="!color_do">the online documentation for the Color module</a>.', array('!color_do' => 'https://drupal.org/documentation/modules/color')) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index 4d35ff5..9cc9a8b 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -22,6 +22,7 @@ use Drupal\field\FieldConfigInterface;
use Drupal\file\FileInterface;
use Drupal\user\EntityOwnerInterface;
use Drupal\node\NodeInterface;
+use Symfony\Component\HttpFoundation\Request;
/**
* Comments are displayed in a flat list - expanded.
@@ -72,9 +73,9 @@ define('COMMENT_NEW_LIMIT', REQUEST_TIME - 30 * 24 * 60 * 60);
/**
* Implements hook_help().
*/
-function comment_help($path, $arg) {
- switch ($path) {
- case 'admin/help#comment':
+function comment_help($route_name, Request $request) {
+ switch ($route_name) {
+ case 'help.page.comment':
$output = '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="@comment">Comment module</a>.', array('@comment' => 'http://drupal.org/documentation/modules/comment')) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
@@ -86,7 +87,7 @@ function comment_help($path, $arg) {
$output .= '</dl>';
return $output;
- case 'admin/structure/comments':
+ case 'comment.bundle_list':
$output = '<p>' . 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.') . '</p>';
return $output;
}
diff --git a/core/modules/config/config.module b/core/modules/config/config.module
index 900e124..8819fdb 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="!url">Configuration manager module</a>', array(
@@ -18,7 +20,7 @@ function config_help($path, $arg) {
)) . '</p>';
return $output;
- case 'admin/config/development/configuration/sync':
+ case 'config.sync':
$output = '';
$output .= '<p>' . t('Import configuration that is placed in your staging directory. All changes, deletions, renames, and additions are listed below.') . '</p>';
return $output;
diff --git a/core/modules/config_translation/config_translation.module b/core/modules/config_translation/config_translation.module
index 93dc909..256bfba 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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.') . '</p>';
@@ -25,7 +26,7 @@ function config_translation_help($path) {
$output .= '</dl>';
return $output;
- case 'admin/config/regional/config-translation':
+ case 'config_translation.mapper_list':
$output = '<p>' . t('This page lists all configuration items on your site which have translatable text, like your site name, role names, etc.') . '</p>';
return $output;
}
diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module
index a8037ee..5fae403 100644
--- a/core/modules/contact/contact.module
+++ b/core/modules/contact/contact.module
@@ -1,4 +1,5 @@
<?php
+use Symfony\Component\HttpFoundation\Request;
/**
* @file
@@ -8,9 +9,9 @@
/**
* Implements hook_help().
*/
-function contact_help($path, $arg) {
- switch ($path) {
- case 'admin/help#contact':
+function contact_help($route_name, Request $request) {
+ switch ($route_name) {
+ case 'help.page.contact':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="@contact">Contact module</a>.', array('@contact' => 'http://drupal.org/documentation/modules/contact')) . '</p>';
@@ -26,7 +27,8 @@ function contact_help($path, $arg) {
$output .= '<dd>' . t('If you would like additional text to appear on the site-wide or personal contact page, use a block. You can create and edit blocks on the <a href="@blocks">Blocks administration page</a>.', array('@blocks' => url('admin/structure/block'))) . '</dd>';
$output .= '</dl>';
return $output;
- case 'admin/structure/contact':
+
+ case 'contact.category_list':
$output = '<p>' . t('Add one or more categories on this page to set up your site-wide <a href="@form">contact form</a>.', array('@form' => url('contact'))) . '</p>';
$output .= '<p>' . t('A <em>Contact</em> menu item is added to the <em>Footer</em> menu, which you can modify on the <a href="@menu-settings">Menus administration page</a>.', array('@menu-settings' => url('admin/structure/menu'))) . '</p>';
$output .= '<p>' . 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 <a href="@blocks">Blocks administration page</a>.', array('@blocks' => url('admin/structure/block'))) . '</p>';
diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module
index 1f174eb..8c76983 100644
--- a/core/modules/content_translation/content_translation.module
+++ b/core/modules/content_translation/content_translation.module
@@ -15,13 +15,14 @@ use Drupal\Core\Language\Language;
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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="!url">Content Translation</a>.', array('!url' => 'http://drupal.org/documentation/modules/translation_entity')) . '</p>';
@@ -41,7 +42,7 @@ function content_translation_help($path, $arg) {
$output .= '</dl>';
return $output;
- case 'admin/config/regional/content-language':
+ case 'language.content_settings_page':
$output = '';
if (!\Drupal::languageManager()->isMultilingual()) {
$output .= '<br/>' . t('Before you can translate content, there must be at least two languages added on the <a href="!url">languages administration</a> page.', array('!url' => url('admin/config/regional/language')));
diff --git a/core/modules/contextual/contextual.module b/core/modules/contextual/contextual.module
index 943a5af..a04792f 100644
--- a/core/modules/contextual/contextual.module
+++ b/core/modules/contextual/contextual.module
@@ -8,6 +8,7 @@
use Drupal\Component\Serialization\Json;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Template\Attribute;
+use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_toolbar().
@@ -63,9 +64,9 @@ function contextual_page_build(&$page) {
/**
* Implements hook_help().
*/
-function contextual_help($path, $arg) {
- switch ($path) {
- case 'admin/help#contextual':
+function contextual_help($route_name, Request $request) {
+ switch ($route_name) {
+ case 'help.page.contextual':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Contextual Links module displays links related to regions of pages on your site to users with <em>access contextual links</em> permission. For more information, see the online handbook entry for <a href="@contextual">Contextual Links module</a>.', array('@contextual' => 'http://drupal.org/documentation/modules/contextual')) . '</p>';
diff --git a/core/modules/dblog/dblog.module b/core/modules/dblog/dblog.module
index 3920579..56ce643 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Database Logging module logs system events in the Drupal database. For more information, see the online handbook entry for the <a href="!dblog">Database Logging module</a>.', array('!dblog' => 'http://drupal.org/documentation/modules/dblog')) . '</p>';
@@ -30,7 +31,8 @@ function dblog_help($path, $arg) {
$output .= '<dd>' . t('In case of errors or problems with the site, the <a href="!dblog">Recent log messages</a> page can be useful for debugging, since it shows the sequence of events. The log messages include usage information, warnings, and errors.', array('!dblog' => \Drupal::url('dblog.overview'))) . '</dd>';
$output .= '</dl>';
return $output;
- case 'admin/reports/dblog':
+
+ case 'dblog.overview':
return '<p>' . 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.') . '</p>';
}
}
diff --git a/core/modules/editor/editor.module b/core/modules/editor/editor.module
index 717355e..9da1540 100644
--- a/core/modules/editor/editor.module
+++ b/core/modules/editor/editor.module
@@ -13,13 +13,14 @@ use Drupal\Component\Utility\NestedArray;
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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Text Editor module provides a framework that other modules (such as <a href="!ckeditor">CKEditor module</a>) 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 <a href="!documentation">online documentation for the Text Editor module</a>.', array('!documentation' => 'https://drupal.org/documentation/modules/editor', '!ckeditor' => \Drupal::url('help.page', array('name' => 'ckeditor')))) . '</p>';
diff --git a/core/modules/entity/entity.module b/core/modules/entity/entity.module
index 1fa3852..deadbf8 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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.') . '</p>';
diff --git a/core/modules/entity_reference/entity_reference.module b/core/modules/entity_reference/entity_reference.module
index 846a723..28db9c4 100644
--- a/core/modules/entity_reference/entity_reference.module
+++ b/core/modules/entity_reference/entity_reference.module
@@ -11,13 +11,14 @@ use Drupal\Core\Entity\EntityInterface;
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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="!er_do">the online documentation for the Entity Reference module</a>, the <a href="!entity_help">Entity module help page</a>, and the <a href="!field_help">Field module help page</a>.', 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')) . '</p>';
diff --git a/core/modules/field/field.module b/core/modules/field/field.module
index cc30633..dba9af7 100644
--- a/core/modules/field/field.module
+++ b/core/modules/field/field.module
@@ -10,6 +10,7 @@ use Drupal\Core\Config\ConfigImporter;
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 @@ require_once __DIR__ . '/field.deprecated.inc';
/**
* 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Field module allows custom data fields to be defined for <em>entity</em> 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 <a href="@field-ui-help">Field UI module</a> 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 <a href="@field">Field module</a>.', array('@field-ui-help' => url('admin/help/field_ui'), '@field' => 'http://drupal.org/documentation/modules/field')) . '</p>';
diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module
index e68df34..84078a24 100644
--- a/core/modules/field_ui/field_ui.module
+++ b/core/modules/field_ui/field_ui.module
@@ -10,13 +10,14 @@ use Drupal\Core\Render\Element;
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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="@field">Field module</a>. For more information, see the online handbook entry for <a href="@field_ui" target="_blank">Field UI module</a>.', array('@field' => url('admin/help/field'), '@field_ui' => 'http://drupal.org/documentation/modules/field-ui')) . '</p>';
@@ -48,7 +49,7 @@ function field_ui_help($path, $arg) {
$output .= '</dl>';
return $output;
- case 'admin/reports/fields':
+ case 'field_ui.list':
return '<p>' . t('This list shows all fields currently in use for easy reference.') . '</p>';
}
}
diff --git a/core/modules/file/file.module b/core/modules/file/file.module
index 9fb3c60..e58e06c 100644
--- a/core/modules/file/file.module
+++ b/core/modules/file/file.module
@@ -12,6 +12,7 @@ use Drupal\Component\Utility\Unicode;
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 @@ require_once __DIR__ . '/file.field.inc';
/**
* 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The File module allows you to create fields that contain files. See the <a href="!field">Field module help</a> and the <a href="!field_ui">Field UI help</a> pages for general information on fields and how to create and manage them. For more information, see the <a href="!file_documentation">online documentation for the File module</a>.', 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')) . '</p>';
diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module
index 40eda67..cb17c44 100644
--- a/core/modules/filter/filter.module
+++ b/core/modules/filter/filter.module
@@ -15,13 +15,14 @@ use Drupal\Core\Session\AccountInterface;
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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="!editor_help">Text Editor module</a>. For more information, see <a href="!filter_do">the online documentation for the Filter module</a>.', array('!filter_do' => 'https://drupal.org/documentation/modules/filter/','!editor_help' => \Drupal::url('help.page', array('name' => 'editor')))) . '</p>';
@@ -41,12 +42,12 @@ function filter_help($path, $arg) {
$output .= '</dl>';
return $output;
- case 'admin/config/content/formats':
+ case 'filter.admin_overview':
$output = '<p>' . t('Text formats define the HTML tags, code, and other formatting that can be used when entering text. <strong>Improper text format configuration is a security risk</strong>. Learn more on the <a href="@filterhelp">Filter module help page</a>.', array('@filterhelp' => url('admin/help/filter'))) . '</p>';
$output .= '<p>' . 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.') . '</p>';
return $output;
- case 'admin/config/content/formats/manage/%':
+ case 'filter.format_edit':
$output = '<p>' . 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.') . '</p>';
return $output;
}
diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module
index 21c4d2e..56bcaec 100644
--- a/core/modules/forum/forum.module
+++ b/core/modules/forum/forum.module
@@ -10,13 +10,14 @@ use Drupal\Component\Utility\Xss;
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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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:') . '</p>';
@@ -44,7 +45,8 @@ function forum_help($path, $arg) {
$output .= '<dd>' . t('Selecting <em>Closed</em> under <em>Comment settings</em> while editing a forum topic will lock (prevent new comments on) the thread. Selecting <em>Hidden</em> under <em>Comment settings</em> while editing a forum topic will hide all existing comments on the thread, and prevent new ones.') . '</dd>';
$output .= '</dl>';
return $output;
- case 'admin/structure/forum':
+
+ case 'forum.overview':
$output = '<p>' . t('Forums contain forum topics. Use containers to group related forums.') . '</p>';
$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 '<p>' . t('Use containers to group related forums.') . '</p>';
- case 'admin/structure/forum/add/forum':
+
+ case 'forum.add_forum':
return '<p>' . t('A forum holds related forum topics.') . '</p>';
- case 'admin/structure/forum/settings':
+
+ case 'forum.settings':
return '<p>' . t('Adjust the display of your forum topics. Organize the forums on the <a href="!forum-structure">forum structure page</a>.', array('!forum-structure' => \Drupal::url('forum.overview'))) . '</p>';
}
}
diff --git a/core/modules/hal/hal.module b/core/modules/hal/hal.module
index c124fb1..0f026e5 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('<a href="!hal_spec">Hypertext Application Language (HAL)</a> is a format that supports the linking required for hypermedia APIs.', array('!hal_spec' => 'http://stateless.co/hal_specification.html')) . '</p>';
diff --git a/core/modules/help/help.api.php b/core/modules/help/help.api.php
index 8b75a78..ede6b4c 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 '<p>' . 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 <a href="@blocks">blocks administration page</a> 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'))) . '</p>';
// Help for another path in the block module.
- case 'admin/structure/block':
+ case 'block.admin_display':
return '<p>' . 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 <em>Save blocks</em> button at the bottom of the page.') . '</p>';
}
}
diff --git a/core/modules/help/help.module b/core/modules/help/help.module
index b02085a..a8447cc 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 = '<h2>' . t('Getting Started') . '</h2>';
$output .= '<p>' . t('Follow these steps to set up and start using your website:') . '</p>';
$output .= '<ol>';
@@ -24,7 +26,8 @@ function help_help($path, $arg) {
$output .= '</ol>';
$output .= '<p>' . t('For more information, refer to the subjects listed in the Help Topics section or to the <a href="!docs">online documentation</a> and <a href="!support">support</a> pages at <a href="!drupal">drupal.org</a>.', array('!docs' => 'https://drupal.org/documentation', '!support' => 'https://drupal.org/support', '!drupal' => 'https://drupal.org')) . '</p>';
return $output;
- case 'admin/help#help':
+
+ case 'help.page.help':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Help module provides <a href="!help-page">Help reference pages</a> and context-sensitive advice to guide you through the use and configuration of modules. It is a starting point for <a href="!handbook">Drupal.org online documentation</a> 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 <a href="!help">online documentation for the Help module</a>.', array('!help' => 'https://drupal.org/documentation/modules/help/', '!handbook' => 'https://drupal.org/documentation', '!help-page' => \Drupal::url('help.main'))) . '</p>';
diff --git a/core/modules/help/lib/Drupal/help/Controller/HelpController.php b/core/modules/help/lib/Drupal/help/Controller/HelpController.php
index 59cf945..f9389bf 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' => '<h2>' . $this->t('Help topics') . '</h2><p>' . $this->t('Help is available on the following items:') . '</p>' . $this->helpLinksAsList(),
+ '#markup' => '<h2>' . $this->t('Help topics') . '</h2><p>' . $this->t('Help is available on the following items:') . '</p>' . $this->helpLinksAsList($request),
);
return $output;
}
@@ -35,16 +39,18 @@ class HelpController extends ControllerBase {
/**
* 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 @@ class HelpController extends ControllerBase {
*
* @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 e7ab073..c019d9d 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 @@ define('HISTORY_READ_LIMIT', REQUEST_TIME - 30 * 24 * 60 * 60);
/**
* 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 = '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The History module keeps track of which content a user has read. It marks content as <em>new</em> or <em>updated</em> 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 <em>read</em>. The History module does not have a user interface but it provides a filter to <a href="!views-help">Views</a> to show new or updated content. For more information, see the <a href="!url">online documentation for the History module</a>.', array('!views-help' => \Drupal::url('help.page', array ('name' => 'views')), '!url' => 'https://drupal.org/documentation/modules/history')) . '</p>';
return $output;
diff --git a/core/modules/image/image.module b/core/modules/image/image.module
index 61b30b9..9c9e82c 100644
--- a/core/modules/image/image.module
+++ b/core/modules/image/image.module
@@ -12,6 +12,7 @@ use Drupal\field\Entity\FieldInstanceConfig;
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 @@ require_once __DIR__ . '/image.field.inc';
/**
* 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Image module allows you to manipulate images on your website. It exposes a setting for using the <em>Image toolkit</em>, allows you to configure <em>Image styles</em> that can be used for resizing or adjusting images on display, and provides an <em>Image</em> field for attaching images to content. For more information, see the online handbook entry for <a href="@image">Image module</a>.', array('@image' => 'http://drupal.org/documentation/modules/image')) . '</p>';
@@ -66,18 +67,16 @@ function image_help($path, $arg) {
$output .= '<dd>' . t("Image module also allows you to attach images to content as fields. To add an image field to a <a href='@content-type'>content type</a>, go to the content type's <em>manage fields</em> page, and add a new field of type <em>Image</em>. Attaching images to content this way allows image styles to be applied and maintained, and also allows you more flexibility when theming.", array('@content-type' => url('admin/structure/types'))) . '</dd>';
$output .= '</dl>';
return $output;
- case 'admin/config/media/image-styles':
+
+ case 'image.style_list':
return '<p>' . 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.') . '</p>';
- 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']) ? ('<p>' . $effect['description'] . '</p>') : 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']) ? ('<p>' . $effect_definition['description'] . '</p>') : NULL;
}
diff --git a/core/modules/language/language.module b/core/modules/language/language.module
index cf24723..f35da4d 100644
--- a/core/modules/language/language.module
+++ b/core/modules/language/language.module
@@ -14,13 +14,14 @@ use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUI;
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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="@language">Language module</a>.', array('@language' => 'http://drupal.org/documentation/modules/language')) . '</p>';
@@ -33,38 +34,43 @@ function language_help($path, $arg) {
$output .= '</dl>';
return $output;
- case 'admin/config/regional/language':
+ case 'language.admin_overview':
return '<p>' . 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 <a href="@detection">detection and selection</a>.', array('@detection' => url('admin/config/regional/language/detection'))) . '</p>';
- case 'admin/config/regional/language/add':
+ case 'language.add':
return '<p>' . t('Add a language to be supported by your site. If your desired language is not available, pick <em>Custom language...</em> at the end and provide a language code and other details manually.') . '</p>';
- case 'admin/config/regional/language/detection':
+ case 'language.negotiation':
$output = '<p>' . 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 <a href="@region-settings">Regional settings</a> page.', array('@region-settings' => url('admin/config/regional/settings'))) . '</p>';
return $output;
- case 'admin/config/regional/language/detection/session':
+ case 'language.negotiation_session':
$output = '<p>' . 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.') . '</p>';
return $output;
- case 'admin/config/regional/language/detection/browser':
+ case 'language.negotiation_browser':
$output = '<p>' . t('Browsers use different language codes to refer to the same languages. You can add and edit mappings from browser language codes to the <a href="@configure-languages">languages used by Drupal</a>.', array('@configure-languages' => url('admin/config/regional/language'))) . '</p>';
return $output;
- case 'admin/config/regional/language/detection/selected':
+ case 'language.negotiation_selected':
$output = '<p>' . 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). <a href="@admin-change-language">Changing the site\'s default language</a> itself might have other undesired side effects.
', array('@admin-change-language' => url('admin/config/regional/language'))) . '</p>';
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 '<p>' . t('With multiple languages added, registered users can select their preferred language and authors can assign a specific language to content.') . '</p>';
}
break;
- case 'admin/config/regional/content-language':
+ case 'block.admin_add':
+ if ($request->attributes->get('plugin_id') == 'language_block:language_interface') {
+ return '<p>' . t('With multiple languages added, registered users can select their preferred language and authors can assign a specific language to content.') . '</p>';
+ }
+ break;
+
+ case 'language.content_settings_page':
return t('Change language settings for <em>content types</em>, <em>taxonomy vocabularies</em>, <em>user profiles</em>, 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 2c06c5d..a791a15 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Link module allows you to create fields that contain internal or external URLs and optional link text. See the <a href="!field">Field module help</a> and the <a href="!field_ui">Field UI help</a> pages for general information on fields and how to create and manage them. For more information, see the <a href="!link_documentation">online documentation for the Link module</a>.', 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')) . '</p>';
@@ -29,7 +30,7 @@ function link_help($path, $arg) {
$output .= '<dt>' . t('Validating URLs') . '</dt>';
$output .= '<dd>' . t('All links are validated after a link field is filled in. They can include anchors or query strings.') . '</dd>';
$output .= '</dl>';
- return $output;
+ return $output;
}
}
diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module
index 039d51a..d3e05dc 100644
--- a/core/modules/locale/locale.module
+++ b/core/modules/locale/locale.module
@@ -17,6 +17,7 @@ use Drupal\Core\Cache\Cache;
use Drupal\Core\Language\Language;
use Drupal\language\Entity\Language as LanguageEntity;
use Drupal\Component\Utility\Crypt;
+use Symfony\Component\HttpFoundation\Request;
/**
* Regular expression pattern used to localize JavaScript strings.
@@ -134,9 +135,9 @@ const LOCALE_TRANSLATION_CURRENT = 'current';
/**
* Implements hook_help().
*/
-function locale_help($path, $arg) {
- switch ($path) {
- case 'admin/help#locale':
+function locale_help($route_name, Request $request) {
+ switch ($route_name) {
+ case 'help.page.locale':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Interface Translation module allows you to translate interface text (<em>strings</em>) into different languages, and to switch between them for the display of interface text. It uses the functionality provided by the <a href="!language">Language module</a>. For more information, see the <a href="!doc-url">online documentation for the Interface Translation module</a>.', array('!doc-url' => 'https://drupal.org/documentation/modules/locale/', '!language' => \Drupal::url('help.page', array('name' => 'language')))) . '</p>';
@@ -151,20 +152,20 @@ function locale_help($path, $arg) {
$output .= '</dl>';
return $output;
- case 'admin/config/regional/language':
+ case 'language.admin_overview':
return '<p>' . t('Interface translations are automatically imported when a language is added, or when new modules or themes are enabled. The report, <a href="@update">Available translation updates</a>, shows the status. Interface text can be <a href="@translate">customized</a>.', array('@update' => url('admin/reports/translations'), '@translate' => url('admin/config/regional/translate'))) . '</p>';
- case 'admin/config/regional/translate':
+ case 'locale.translate_page':
$output = '<p>' . 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 <a href="@export">export</a> 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'))) . '</p>';
return $output;
- case 'admin/config/regional/translate/import':
+ case 'locale.translate_import':
$output = '<p>' . t('Translation files are automatically downloaded and imported when <a href="@language">languages</a> are added, or when modules or themes are enabled.', array('@language' => url('admin/config/regional/language'))). '</p>';
$output .= '<p>' . 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 <a href="@url">Drupal translation server</a> or <a href="@export">export</a> 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'))) . '</p>';
$output .= '<p>' . t('Note that importing large .po files may take several minutes.') . '</p>';
return $output;
- case 'admin/config/regional/translate/export':
+ case 'locale.translate_export':
return '<p>' . t('This page exports the translated strings used by your site. An export file may be in Gettext Portable Object (<em>.po</em>) form, which includes both the original string and the translation (used to share translations with others), or in Gettext Portable Object Template (<em>.pot</em>) form, which includes the original strings only (used to create new translations with a Gettext translation editor).') . '</p>';
}
}
diff --git a/core/modules/menu_link/menu_link.module b/core/modules/menu_link/menu_link.module
index c8e49e1..ee273d8 100644
--- a/core/modules/menu_link/menu_link.module
+++ b/core/modules/menu_link/menu_link.module
@@ -9,10 +9,11 @@ use Drupal\Core\Url;
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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="!menu-help">Menu UI module help page</a> for more information.', array('!menu-help' => \Drupal::url('help.page', array('name' => 'menu_ui')))) . '</p>';
diff --git a/core/modules/menu_ui/menu_ui.module b/core/modules/menu_ui/menu_ui.module
index 0323875..b12baee 100644
--- a/core/modules/menu_ui/menu_ui.module
+++ b/core/modules/menu_ui/menu_ui.module
@@ -20,6 +20,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
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 @@ const MENU_MAX_MENU_NAME_LENGTH_UI = 27;
/**
* 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="!menu">online documentation for the Menu UI module</a>.', array('!menu' => 'https://drupal.org/documentation/modules/menu/')) . '</p>';
@@ -45,10 +46,10 @@ function menu_ui_help($path, $arg) {
$output .= '</dl>';
return $output;
}
- if ($path == 'admin/structure/menu/add' && \Drupal::moduleHandler()->moduleExists('block')) {
- return '<p>' . t('You can enable the newly-created block for this menu on the <a href="!blocks">Block layout page</a>.', array('!blocks' => \Drupal::url('block.admin_display'))) . '</p>';
+ if ($route_name == 'menu_ui.menu_add' && \Drupal::moduleHandler()->moduleExists('block')) {
+ return '<p>' . t('You can enable the newly-created block for this menu on the <a href="!blocks">Block layout page</a>.', array('!blocks' => \Drupal::url('block.admin_display'))) . '</p>';
}
- elseif ($path == 'admin/structure/menu' && \Drupal::moduleHandler()->moduleExists('block')) {
+ elseif ($route_name == 'menu_ui.overview_page' && \Drupal::moduleHandler()->moduleExists('block')) {
return '<p>' . t('Each menu has a corresponding block that is managed on the <a href="!blocks">Block layout page</a>.', array('!blocks' => \Drupal::url('block.admin_display'))) . '</p>';
}
}
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 8973c7e..e749f86 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -12,6 +12,7 @@ use Drupal\Component\Utility\Xss;
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 @@ const NODE_ACCESS_IGNORE = NULL;
/**
* 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="!field">Field module</a>). For more information, see <a href="!node">the online documentation for the Node module</a>.', array('!node' => 'https://drupal.org/documentation/modules/node', '!field' => \Drupal::url('help.page', array('name' => 'field')))) . '</p>';
@@ -120,30 +121,31 @@ function node_help($path, $arg) {
$output .= '</dl>';
return $output;
- case 'admin/structure/types/add':
+ case 'node.type_add':
return '<p>' . t('Individual content types can have different fields, behaviors, and permissions assigned to them.') . '</p>';
- 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 '<p>' . 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())) . '</p>' ;
- 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 '<p>' . t('Content items can be displayed using different view modes: Teaser, Full content, Print, RSS, etc. <em>Teaser</em> is a short format that is typically used in lists of multiple content items. <em>Full content</em> is typically used when the content is displayed on its own page.') . '</p>' .
'<p>' . 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())) . '</p>';
- case 'node/%/revisions':
+ case 'node.revision_overview':
return '<p>' . t('Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.') . '</p>';
- 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 66fcb42..71bbf33 100644
--- a/core/modules/options/options.module
+++ b/core/modules/options/options.module
@@ -9,13 +9,14 @@ use Drupal\Core\Entity\EntityInterface;
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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="!field">Field module help</a> and the <a href="!field_ui">Field UI help</a> pages for general information on fields and how to create and manage them. For more information, see the <a href="!options_do">online documentation for the Options module</a>.', 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')) . '</p>';
diff --git a/core/modules/path/path.module b/core/modules/path/path.module
index 9be6cbd..ab102a9 100644
--- a/core/modules/path/path.module
+++ b/core/modules/path/path.module
@@ -10,13 +10,14 @@ use Drupal\Core\Language\Language;
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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="@pathauto">Pathauto</a>. For more information, see the online handbook entry for the <a href="@path">Path module</a>.', array('@path' => 'http://drupal.org/documentation/modules/path', '@pathauto' => 'http://drupal.org/project/pathauto')) . '</p>';
@@ -32,10 +33,10 @@ function path_help($path, $arg) {
$output .= '</dl>';
return $output;
- case 'admin/config/search/path':
+ case 'path.admin_overview':
return '<p>' . 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.") . '</p>';
- case 'admin/config/search/path/add':
+ case 'path.admin_add':
return '<p>' . t('Enter the path you wish to create the alias for, followed by the name of the new alias.') . '</p>';
}
}
diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module
index bf8c60e..8ea735b 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="!rdfa">RDFa specification</a>, 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 <a href="!rdf">online documentation for the RDF module</a>.', array('!rdfa' => 'http://www.w3.org/TR/xhtml-rdfa-primer/', '!rdf' => 'https://drupal.org/documentation/modules/rdf')) . '</p>';
diff --git a/core/modules/responsive_image/responsive_image.module b/core/modules/responsive_image/responsive_image.module
index be888b4..82ecafe 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="!responsive_image">online documentation for the Responsive Image module</a>.', array( '!responsive_image' => 'https://drupal.org/documentation/modules/responsive_image')) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
@@ -25,7 +26,8 @@ function responsive_image_help($path, $arg) {
$output .= '<dd>' . t('After defining responsive image mappings, you can use them in the display settings for your Image fields, so that the site displays responsive images using the HTML5 picture tag. Open the Manage display page for the entity type (content type, taxonomy vocabulary, etc.) that the Image field is attached to. Choose the format <em>Responsive image</em>, click the Edit icon, and select one of the responsive image mappings that you have created. For general information on how to manage fields and their display see the <a href="!field_ui">help page of the Field UI module</a>. For information about entities see the <a href="!entity_help">help page of the Entity module</a>.', array('!field_ui' => \Drupal::url('help.page', array('name' => 'field_ui')),'!entity_help' => \Drupal::url('help.page', array('name' => 'entity')))) . '</dd>';
$output .= '</dl>';
break;
- case 'admin/config/media/responsive-image-mapping':
+
+ case 'responsive_image.mapping_page':
$output .= '<p>' . t('A responsive image mapping associates an image style with each breakpoint defined by your theme.') . '</p>';
break;
diff --git a/core/modules/rest/rest.module b/core/modules/rest/rest.module
index 086961a..a3cf32b 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="@rest">RESTful web services module</a>.', array('@rest' => 'http://drupal.org/documentation/modules/rest')) . '</p>';
diff --git a/core/modules/search/lib/Drupal/search/Controller/SearchController.php b/core/modules/search/lib/Drupal/search/Controller/SearchController.php
index ec7d8bf..bd434f5 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 @@ class SearchController extends ControllerBase {
);
}
+ $no_results = t('<ul>
+ <li>Check if your spelling is correct.</li>
+ <li>Remove quotes around phrases to search for each word individually. <em>bike shed</em> will often show more results than <em>&quot;bike shed&quot;</em>.</li>
+ <li>Consider loosening your query with <em>OR</em>. <em>bike OR shed</em> will often show more results than <em>bike shed</em>.</li>
+ </ul>');
$build['search_results'] = array(
'#theme' => array('item_list__search_results__' . $plugin->getPluginId(), 'item_list__search_results'),
'#items' => $results,
'#empty' => array(
// @todo Revisit where this help text is added.
- '#markup' => '<h3>' . $this->t('Your search yielded no results.') . '</h3>' . search_help('search#noresults', drupal_help_arg()),
+ '#markup' => '<h3>' . $this->t('Your search yielded no results.') . '</h3>' . $no_results,
),
'#list_type' => 'ol',
'#attributes' => array(
diff --git a/core/modules/search/search.module b/core/modules/search/search.module
index e7a725f..bbfed7d 100644
--- a/core/modules/search/search.module
+++ b/core/modules/search/search.module
@@ -6,6 +6,7 @@
*/
use Drupal\Component\Utility\Unicode;
+use Symfony\Component\HttpFoundation\Request;
/**
* Matches all 'N' Unicode character classes (numbers)
@@ -65,9 +66,9 @@ define('PREG_CLASS_CJK', '\x{1100}-\x{11FF}\x{3040}-\x{309F}\x{30A1}-\x{318E}' .
/**
* Implements hook_help().
*/
-function search_help($path, $arg) {
- switch ($path) {
- case 'admin/help#search':
+function search_help($route_name, Request $request) {
+ switch ($route_name) {
+ case 'help.page.search':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="@search-module">Search module</a>.', array('@search-module' => 'http://drupal.org/documentation/modules/search', '@search' => url('search'))) . '</p>';
@@ -87,14 +88,9 @@ function search_help($path, $arg) {
$output .= '<dd>' . t('By default, the Search module only supports exact keyword matching in content searches. You can modify this behavior by installing a language-specific stemming module for your language (such as <a href="@porterstemmer_url">Porter Stemmer</a> for American English), which allows words such as walk, walking, and walked to be matched in the Search module. Another approach is to use a third-party search technology with stemming or partial word matching features built in, such as <a href="@solr_url">Apache Solr</a> or <a href="@sphinx_url">Sphinx</a>. These and other <a href="@contrib-search">search-related contributed modules</a> can be downloaded by visiting Drupal.org.', array('@contrib-search' => 'http://drupal.org/project/modules?filters=tid%3A105', '@porterstemmer_url' => 'http://drupal.org/project/porterstemmer', '@solr_url' => 'http://drupal.org/project/apachesolr', '@sphinx_url' => 'http://drupal.org/project/sphinx')) . '</dd>';
$output .= '</dl>';
return $output;
- case 'admin/config/search/pages':
+
+ case 'search.settings':
return '<p>' . t('The search engine maintains an index of words found in your site\'s content. To build and maintain this index, a correctly configured <a href="@cron">cron maintenance task</a> is required. Indexing behavior can be adjusted using the settings below.', array('@cron' => url('admin/reports/status'))) . '</p>';
- case 'search#noresults':
- return t('<ul>
-<li>Check if your spelling is correct.</li>
-<li>Remove quotes around phrases to search for each word individually. <em>bike shed</em> will often show more results than <em>&quot;bike shed&quot;</em>.</li>
-<li>Consider loosening your query with <em>OR</em>. <em>bike OR shed</em> will often show more results than <em>bike shed</em>.</li>
-</ul>');
}
}
diff --git a/core/modules/serialization/serialization.module b/core/modules/serialization/serialization.module
index 7aa66dd..5169f93 100644
--- a/core/modules/serialization/serialization.module
+++ b/core/modules/serialization/serialization.module
@@ -1,11 +1,18 @@
<?php
/**
+ * @file
+ * Provides a service for (de)serializing data to/from formats such as JSON and XML.
+ */
+
+use Symfony\Component\HttpFoundation\Request;
+
+/**
* Implements hook_help().
*/
-function serialization_help($path, $arg) {
- switch ($path) {
- case 'admin/help#serialization':
+function serialization_help($route_name, Request $request) {
+ switch ($route_name) {
+ case 'help.page.serialization':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Serialization module provides a service for serializing and deserializing data to and from formats such as JSON and XML.') . '</p>';
diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module
index ed180b6..a565e80 100644
--- a/core/modules/shortcut/shortcut.module
+++ b/core/modules/shortcut/shortcut.module
@@ -15,11 +15,9 @@ use Symfony\Component\HttpFoundation\Request;
/**
* 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 = '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Shortcut module allows users to create sets of <em>shortcut</em> links to commonly-visited pages of the site. Shortcuts are contained within <em>sets</em>. Each user with <em>Select any shortcut set</em> permission can select a shortcut set created by anyone at the site. For more information, see the online handbook entry for <a href="!shortcut">Shortcut module</a>.', array('!shortcut' => 'http://drupal.org/documentation/modules/shortcut')) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
@@ -34,8 +32,10 @@ function shortcut_help($path, $arg) {
$output .= '</dl>';
return $output;
- case 'admin/config/user-interface/shortcut':
- case 'admin/config/user-interface/shortcut/%':
+ case 'shortcut.set_admin':
+ case 'shortcut.set_add':
+ case 'shortcut.set_edit':
+ $user = \Drupal::currentUser();
if ($user->hasPermission('switch shortcut sets')) {
$output = '<p>' . t('Define which shortcut set you are using on the <a href="@shortcut-link">Shortcuts tab</a> of your account page.', array('@shortcut-link' => url("user/{$user->id()}/shortcuts"))) . '</p>';
return $output;
diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index dbf1dff..914228e 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -5,6 +5,7 @@ use Drupal\Core\Page\HtmlPage;
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 @@ use Symfony\Component\Process\PhpExecutableFinder;
/**
* 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="!simpletest">the online documentation for the Testing module</a>.', array('!simpletest' => 'https://drupal.org/documentation/modules/simpletest')) . '</p>';
@@ -29,7 +30,7 @@ function simpletest_help($path, $arg) {
$output .= '</dl>';
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 <em>Run tests</em>.');
return $output;
}
diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module
index 5215204..e5828c3 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="!statistics_do">the online documentation for the Statistics module</a>.', array('!statistics_do' => 'https://drupal.org/documentation/modules/statistics/')) . '</p>';
@@ -26,7 +27,8 @@ function statistics_help($path, $arg) {
$output .= '<dd>' . t('The Statistics module includes a counter for each page that increases whenever the page is viewed. To use the counter, enable <em>Count content views</em> on the <a href="!statistics-settings">statistics settings page</a>, and set the necessary <a href="!permissions">permissions</a> (<em>View content hits</em>) so that the counter is visible to the users.', array('!statistics-settings' => \Drupal::url('statistics.settings'), '!permissions' => \Drupal::url('user.admin_permissions', array(), array('fragment' => 'module-statistics')))) . '</dd>';
$output .= '</dl>';
return $output;
- case 'admin/config/system/statistics':
+
+ case 'statistics.settings':
return '<p>' . t('Settings for the statistical information that Drupal will keep about the site.') . '</p>';
}
}
diff --git a/core/modules/syslog/syslog.module b/core/modules/syslog/syslog.module
index a93ee93..ba54118 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href='!syslog'>online documentation for the Syslog module</a>, as well as PHP's documentation pages for the <a href='!php_openlog'>openlog</a> and <a href='!php_syslog'>syslog</a> 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')) . '</p>';
diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php
index 1966bb5..d061495 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 @@ class ModulesListForm extends FormBase {
$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 7105a30..d15cfc6 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\block\BlockBase;
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 @@ class SystemHelpBlock extends BlockBase implements ContainerFactoryPluginInterfa
* 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 6fd6ba4..bef0349 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -13,6 +13,7 @@ use Drupal\block\BlockPluginInterface;
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 @@ const EMAIL_MAX_LENGTH = 254;
/**
* 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="@system">System module</a>.', array('@system' => 'http://drupal.org/documentation/modules/system')) . '</p>';
@@ -95,18 +96,23 @@ function system_help($path, $arg) {
$output .= '<dd>' . t('The System module also handles basic configuration options for your site, including <a href="@date-time-settings">Date and time settings</a>, <a href="@file-system">File system settings</a>, <a href="@site-info">Site name and other information</a>, and a <a href="@maintenance-mode">Maintenance mode</a> for taking your site temporarily offline.', array('@date-time-settings' => url('admin/config/regional/date-time'), '@file-system' => url('admin/config/media/file-system'), '@site-info' => url('admin/config/system/site-information'), '@maintenance-mode' => url('admin/config/development/maintenance'))) . '</dd>';
$output .= '</dl>';
return $output;
- case 'admin/index':
+
+ case 'system.admin_index':
return '<p>' . t('This page shows you all available administration tasks for each module.') . '</p>';
- case 'admin/appearance':
+
+ case 'system.themes_page':
$output = '<p>' . t('Set and configure the default theme for your website. Alternative <a href="@themes">themes</a> are available.', array('@themes' => 'http://drupal.org/project/themes')) . '</p>';
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 '<p>' . 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'])) . '</p>';
- case 'admin/appearance/settings':
+
+ case 'system.theme_settings':
return '<p>' . 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.') . '</p>';
- case 'admin/modules':
+
+ case 'system.modules_list':
$output = '<p>' . t('Download additional <a href="@modules">contributed modules</a> to extend Drupal\'s functionality.', array('@modules' => 'http://drupal.org/project/modules')) . '</p>';
if (\Drupal::moduleHandler()->moduleExists('update')) {
if (update_manager_access()) {
@@ -120,19 +126,29 @@ function system_help($path, $arg) {
$output .= '<p>' . t('Regularly review available updates to maintain a secure and current site. Always run the <a href="@update-php">update script</a> 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')) . '</p>';
}
return $output;
- case 'admin/modules/uninstall':
+
+ case 'system.modules_uninstall':
return '<p>' . t('The uninstall process removes all data related to a module.') . '</p>';
- 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 '<p>' . t('The <em>Powered by Drupal</em> 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.') . '</p>';
}
break;
- case 'admin/config/development/maintenance':
+
+ case 'block.admin_add':
+ if ($request->attributes->get('plugin_id') == 'system_powered_by_block') {
+ return '<p>' . t('The <em>Powered by Drupal</em> 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.') . '</p>';
+ }
+ break;
+
+ case 'system.site_maintenance_mode':
if (\Drupal::currentUser()->id() == 1) {
return '<p>' . 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.') . '</p>';
}
break;
- case 'admin/reports/status':
+
+ case 'system.status':
return '<p>' . 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 <a href=\"@system-requirements\">system requirements.</a>", array('@system-requirements' => 'http://drupal.org/requirements')) . '</p>';
}
}
diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module
index 69bb530..7dff5d9 100644
--- a/core/modules/taxonomy/taxonomy.module
+++ b/core/modules/taxonomy/taxonomy.module
@@ -16,6 +16,7 @@ use Drupal\taxonomy\Entity\Term;
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 @@ const TAXONOMY_HIERARCHY_MULTIPLE = 2;
/**
* 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Taxonomy module allows you to classify the content of your website. To classify content, you define <em>vocabularies</em> that contain related <em>terms</em>, and then assign the vocabularies to content types. For more information, see the online handbook entry for the <a href="@taxonomy">Taxonomy module</a>.', array('@taxonomy' => 'http://drupal.org/documentation/modules/taxonomy')) . '</p>';
@@ -72,11 +73,13 @@ function taxonomy_help($path, $arg) {
$output .= '<dd>' . t('There are <a href="@taxcontrib">many contributed modules</a> that extend the behavior of the Taxonomy module for both display and organization of terms.', array('@taxcontrib' => 'http://drupal.org/project/modules?filters=tid:71&solrsort=sis_project_release_usage%20desc'));
$output .= '</dl>';
return $output;
- case 'admin/structure/taxonomy':
+
+ case 'taxonomy.vocabulary_list':
$output = '<p>' . t('Taxonomy is for categorizing content. Terms are grouped into vocabularies. For example, a vocabulary called "Fruit" would contain the terms "Apple" and "Banana".') . '</p>';
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 '<p>' . 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)) . '</p>';
diff --git a/core/modules/telephone/telephone.module b/core/modules/telephone/telephone.module
index eee9213..f7dbc4e 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Telephone module allows you to create fields that contain telephone numbers. See the <a href="!field">Field module help</a> and the <a href="!field_ui">Field UI help</a> pages for general information on fields and how to create and manage them. For more information, see the <a href="!telephone_documentation">online documentation for the Telephone module</a>.', 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')) . '</p>';
diff --git a/core/modules/text/text.module b/core/modules/text/text.module
index 339d9da..37db348 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Text module allows you to create short and long text fields with optional summaries. See the <a href="!field">Field module help</a> and the <a href="!field_ui">Field UI help</a> pages for general information on fields and how to create and manage them. For more information, see the <a href="!text_documentation">online documentation for the Text module</a>.', 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')) . '</p>';
diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module
index 0f58cb2..2a76441 100644
--- a/core/modules/toolbar/toolbar.module
+++ b/core/modules/toolbar/toolbar.module
@@ -10,6 +10,7 @@ use Drupal\Core\Language\Language;
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 @@ use Drupal\user\UserInterface;
/**
* 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 = '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="@toolbar">Toolbar module</a>.', array('@toolbar' => 'http://drupal.org/documentation/modules/toolbar')) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
diff --git a/core/modules/tour/tour.module b/core/modules/tour/tour.module
index 610c025..ffe79c2 100644
--- a/core/modules/tour/tour.module
+++ b/core/modules/tour/tour.module
@@ -6,13 +6,14 @@
*/
use Drupal\Core\Cache\CacheBackendInterface;
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
+use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
-function tour_help($path, $arg) {
- switch ($path) {
- case 'admin/help#tour':
+function tour_help($route_name, Request $request) {
+ switch ($route_name) {
+ case 'help.page.tour':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href='!tour'>the online documentation for the Tour module</a>.", array('!tour' => 'https://drupal.org/documentation/modules/tour')) . '</p>';
diff --git a/core/modules/tracker/tracker.module b/core/modules/tracker/tracker.module
index 96aecbf..98042f5 100644
--- a/core/modules/tracker/tracker.module
+++ b/core/modules/tracker/tracker.module
@@ -9,13 +9,14 @@ use Drupal\Core\Entity\EntityInterface;
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 = '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="@tracker">Tracker module</a>.', array('@tracker' => 'http://drupal.org/documentation/modules/tracker')) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
diff --git a/core/modules/update/update.module b/core/modules/update/update.module
index 548ee63..6341857 100644
--- a/core/modules/update/update.module
+++ b/core/modules/update/update.module
@@ -12,6 +12,7 @@
*/
use Drupal\Core\Site\Settings;
+use Symfony\Component\HttpFoundation\Request;
// These are internally used constants for this code, do not modify.
@@ -63,12 +64,9 @@ const UPDATE_FETCH_PENDING = -4;
/**
* Implements hook_help().
*/
-function update_help($path, $arg) {
- switch ($path) {
- case 'admin/reports/updates':
- return '<p>' . 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.') . '</p>';
-
- case 'admin/help#update':
+function update_help($route_name, Request $request) {
+ switch ($route_name) {
+ case 'help.page.update':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href='@modules'>Module administration page</a>. For more information, see the online handbook entry for <a href='@update'>Update Manager module</a>.", array('@update' => 'http://drupal.org/documentation/modules/update', '@modules' => url('admin/modules'))) . '</p>';
@@ -89,6 +87,9 @@ function update_help($path, $arg) {
}
$output .= '</dl>';
return $output;
+
+ case 'update.status':
+ return '<p>' . 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.') . '</p>';
}
}
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index 08b5de3..955f644 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -14,6 +14,7 @@ use Drupal\user\RoleInterface;
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 @@ const USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL = 'visitors_admin_approval'
/**
* 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <a href="!user_docs">online documentation for the User module</a>.', array('!user_docs' => 'https://drupal.org/documentation/modules/user')) . '</p>';
@@ -66,11 +67,14 @@ function user_help($path, $arg) {
$output .= '<dd>' . t('Because User accounts are an <a href="!entity_help">entity type</a>, you can extend them by adding <a href="!field_help">fields</a> through the Manage fields tab on the <a href="!accounts">Account settings page</a>. By adding fields for e.g., a picture, a biography, or address, you can a create a custom profile for the users of the website.', array('!entity_help' => \Drupal::url('help.page', array('name' => 'entity')),'!field_help'=>\Drupal::url('help.page', array('name' => 'field')), '!accounts' => \Drupal::url('user.account_settings'))) . '</dd>';
$output .= '</dl>';
return $output;
- case 'admin/people/create':
+
+ case 'user.admin_create':
return '<p>' . t("This web page allows administrators to register new users. Users' e-mail addresses and usernames must be unique.") . '</p>';
- case 'admin/people/permissions':
+
+ case 'user.admin_permissions':
return '<p>' . 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 <a href="@role">Roles</a> 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 <a href="@settings">User Settings</a> 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'))) . '</p>';
- case 'admin/people/roles':
+
+ case 'user.role_list':
$output = '<p>' . 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 <a href="@permissions">permissions page</a>. 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'))) . '</p>';
$output .= '<p>' . t('Drupal has three special user roles:') . '</p>';
$output .= '<ul>';
@@ -79,14 +83,15 @@ function user_help($path, $arg) {
$output .= '<li>' . t('Administrator role: this role is automatically granted all new permissions when you install a new module. Configure which role is the administrator role on the <a href="@account_settings">Account settings page</a>.', array('@account_settings' => url('admin/config/people/accounts'))) . '</li>';
$output .= '</ul>';
return $output;
- case 'admin/config/people/accounts/fields':
+
+ case 'field_ui.overview_user':
return '<p>' . t('This form lets administrators add and edit fields for storing user data.') . '</p>';
- case 'admin/config/people/accounts/form-display':
+
+ case 'field_ui.form_display_overview_user':
return '<p>' . t('This form lets administrators configure how form fields should be displayed when editing a user profile.') . '</p>';
- case 'admin/config/people/accounts/display':
+
+ case 'field_ui.display_overview_user':
return '<p>' . t('This form lets administrators configure how fields should be displayed when rendering a user profile page.') . '</p>';
- case 'admin/people/search':
- return '<p>' . 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".') . '</p>';
}
}
diff --git a/core/modules/views/views.module b/core/modules/views/views.module
index 9d6e4af..216bc93 100644
--- a/core/modules/views/views.module
+++ b/core/modules/views/views.module
@@ -21,13 +21,14 @@ use Drupal\Component\Plugin\Exception\PluginException;
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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . 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 <em>views</em>.') . '</p>';
diff --git a/core/modules/views_ui/views_ui.module b/core/modules/views_ui/views_ui.module
index a8cdfd5..a39fa71 100644
--- a/core/modules/views_ui/views_ui.module
+++ b/core/modules/views_ui/views_ui.module
@@ -12,14 +12,14 @@ use Drupal\views_ui\ViewUI;
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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Views UI module provides an interface for managing views for the <a href="@views">Views module</a>. For more information, see the <a href="@handbook">online documentation for the Views UI module</a>.', array('@views' => \Drupal::url('help.page', array('name' => 'views')), '@handbook' => 'https://drupal.org/documentation/modules/views_ui')) . '</p>';
diff --git a/core/modules/xmlrpc/xmlrpc.module b/core/modules/xmlrpc/xmlrpc.module
index 187da85..bc82806 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 .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The XML-RPC module gives external systems the opportunity to communicate with the site through the <a href="http://en.wikipedia.org/wiki/XML-RPC">XML-RPC protocol</a>. An XML-RPC client can communicate with the site by making a request to <a href="!xrphp">xmlrpc.php</a>. For more information, see <a href="!xrdocs">the online documentation for the XML-RPC module</a>.', array('!xrphp' => \Drupal::url('xmlrpc.php'),'!xrdocs' => 'https://drupal.org/documentation/modules/xmlrpc')) . '</p>';