Commit eef067b5 authored by webchick's avatar webchick

Issue #2183113 by jhodgdon, effulgentsia, tim.plunkett, herom, larowlan:...

Issue #2183113 by jhodgdon, effulgentsia, tim.plunkett, herom, larowlan: Update hook_help signature to use route_name instead of path.
parent b619a2c6
...@@ -364,14 +364,6 @@ function theme_menu_local_action($variables) { ...@@ -364,14 +364,6 @@ function theme_menu_local_action($variables) {
return $output; return $output;
} }
/**
* Generates elements for the $arg array in the help hook.
*/
function drupal_help_arg($arg = array()) {
// Note - the number of empty elements should be > MENU_MAX_PARTS.
return $arg + array('', '', '', '', '', '', '', '', '', '', '', '');
}
/** /**
* Returns an array containing the names of system-defined (default) menus. * Returns an array containing the names of system-defined (default) menus.
*/ */
......
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
* This is the Actions module for executing stored actions. * This is the Actions module for executing stored actions.
*/ */
use Symfony\Component\HttpFoundation\Request;
/** /**
* Implements hook_help(). * Implements hook_help().
*/ */
function action_help($path, $arg) { function action_help($route_name, Request $request) {
switch ($path) { switch ($route_name) {
case 'admin/help#action': case 'help.page.action':
$output = ''; $output = '';
$output .= '<h3>' . t('About') . '</h3>'; $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>'; $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) { ...@@ -23,12 +25,11 @@ function action_help($path, $arg) {
$output .= '</dl>'; $output .= '</dl>';
return $output; return $output;
case 'admin/config/system/actions': case 'action.admin':
case 'admin/config/system/actions/manage':
$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>'; $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; 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.'); 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.');
} }
} }
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
use Drupal\aggregator\FeedInterface; use Drupal\aggregator\FeedInterface;
use Drupal\Component\Utility\Xss; use Drupal\Component\Utility\Xss;
use Symfony\Component\HttpFoundation\Request;
/** /**
* Denotes that a feed's items should never expire. * Denotes that a feed's items should never expire.
...@@ -16,9 +17,9 @@ ...@@ -16,9 +17,9 @@
/** /**
* Implements hook_help(). * Implements hook_help().
*/ */
function aggregator_help($path, $arg) { function aggregator_help($route_name, Request $request) {
switch ($path) { switch ($route_name) {
case 'admin/help#aggregator': case 'help.page.aggregator':
$output = ''; $output = '';
$output .= '<h3>' . t('About') . '</h3>'; $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>'; $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) { ...@@ -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 .= '<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>'; $output .= '</dl>';
return $output; return $output;
case 'admin/config/services/aggregator':
case 'aggregator.admin_overview':
// Don't use placeholders for possibility to change URLs for translators. // 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('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>'; $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; 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>'; 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>'; 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>';
} }
} }
......
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
* Allows to ban individual IP addresses. * Allows to ban individual IP addresses.
*/ */
use Symfony\Component\HttpFoundation\Request;
/** /**
* Implements hook_help(). * Implements hook_help().
*/ */
function ban_help($path, $arg) { function ban_help($route_name, Request $request) {
switch ($path) { switch ($route_name) {
case 'admin/help#ban': case 'help.page.ban':
$output = ''; $output = '';
$output .= '<h3>' . t('About') . '</h3>'; $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>'; $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) { ...@@ -21,7 +23,7 @@ function ban_help($path, $arg) {
$output .= '</dl>'; $output .= '</dl>';
return $output; 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>'; 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>';
} }
} }
......
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
* Provides an HTTP Basic authentication provider. * Provides an HTTP Basic authentication provider.
*/ */
use Symfony\Component\HttpFoundation\Request;
/** /**
* Implements hook_help(). * Implements hook_help().
*/ */
function basic_auth_help($path, $arg) { function basic_auth_help($route_name, Request $request) {
switch ($path) { switch ($route_name) {
case 'admin/help#basic_auth': case 'help.page.basic_auth':
$output = ''; $output = '';
$output .= '<h3>' . t('About') . '</h3>'; $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>'; $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>';
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
use Drupal\language\Entity\Language; use Drupal\language\Entity\Language;
use Drupal\system\Entity\Menu; use Drupal\system\Entity\Menu;
use Symfony\Cmf\Component\Routing\RouteObjectInterface; use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Symfony\Component\HttpFoundation\Request;
/** /**
* Shows this block on every page except the listed pages. * Shows this block on every page except the listed pages.
...@@ -30,9 +31,9 @@ ...@@ -30,9 +31,9 @@
/** /**
* Implements hook_help(). * Implements hook_help().
*/ */
function block_help($path, $arg) { function block_help($route_name, Request $request) {
switch ($path) { switch ($route_name) {
case 'admin/help#block': case 'help.page.block':
$output = ''; $output = '';
$output .= '<h3>' . t('About') . '</h3>'; $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>'; $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) { ...@@ -53,13 +54,8 @@ function block_help($path, $arg) {
$output .= '</dl>'; $output .= '</dl>';
return $output; return $output;
} }
if ($arg[0] == 'admin' && $arg[1] == 'structure' && $arg['2'] == 'block' && (empty($arg[3]) || $arg[3] == 'list') && empty($arg[5])) { if ($route_name == 'block.admin_display' || $route_name == 'block.admin_display_theme') {
if (!empty($arg[4])) { $demo_theme = $request->attributes->get('theme', \Drupal::config('system.theme')->get('default'));
$demo_theme = $arg[4];
}
else {
$demo_theme = \Drupal::config('system.theme')->get('default');
}
$themes = list_themes(); $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>' . 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>'; $output .= '<p>' . l(t('Demonstrate block regions (!theme)', array('!theme' => $themes[$demo_theme]->info['name'])), 'admin/structure/block/demo/' . $demo_theme) . '</p>';
......
...@@ -7,13 +7,14 @@ ...@@ -7,13 +7,14 @@
use Drupal\custom_block\Entity\CustomBlockType; use Drupal\custom_block\Entity\CustomBlockType;
use Drupal\custom_block\Entity\CustomBlock; use Drupal\custom_block\Entity\CustomBlock;
use Symfony\Component\HttpFoundation\Request;
/** /**
* Implements hook_help(). * Implements hook_help().
*/ */
function custom_block_help($path, $arg) { function custom_block_help($route_name, Request $request) {
switch ($path) { switch ($route_name) {
case 'admin/help#custom_block': case 'help.page.custom_block':
$output = ''; $output = '';
$output .= '<h3>' . t('About') . '</h3>'; $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>'; $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) { ...@@ -26,11 +27,11 @@ function custom_block_help($path, $arg) {
$output .= '</dl>'; $output .= '</dl>';
return $output; 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>'; $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; 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>'; $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; return $output;
......
...@@ -14,13 +14,14 @@ ...@@ -14,13 +14,14 @@
use Drupal\Core\Language\Language; use Drupal\Core\Language\Language;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface; use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Template\Attribute; use Drupal\Core\Template\Attribute;
use Symfony\Component\HttpFoundation\Request;
/** /**
* Implements hook_help(). * Implements hook_help().
*/ */
function book_help($path, $arg) { function book_help($route_name, Request $request) {
switch ($path) { switch ($route_name) {
case 'admin/help#book': case 'help.page.book':
$output = '<h3>' . t('About') . '</h3>'; $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 .= '<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>'; $output .= '<h3>' . t('Uses') . '</h3>';
...@@ -35,9 +36,11 @@ function book_help($path, $arg) { ...@@ -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 .= '<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>'; $output .= '</dl>';
return $output; 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>'; 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>'; 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>';
} }
} }
......
...@@ -8,13 +8,14 @@ ...@@ -8,13 +8,14 @@
use Drupal\breakpoint\Entity\Breakpoint; use Drupal\breakpoint\Entity\Breakpoint;
use Drupal\breakpoint\Entity\BreakpointGroup; use Drupal\breakpoint\Entity\BreakpointGroup;
use Drupal\Core\Config\Entity\ConfigEntityStorage; use Drupal\Core\Config\Entity\ConfigEntityStorage;
use Symfony\Component\HttpFoundation\Request;
/** /**
* Implements hook_help(). * Implements hook_help().
*/ */
function breakpoint_help($path, $arg) { function breakpoint_help($route_name, Request $request) {
switch ($path) { switch ($route_name) {
case 'admin/help#breakpoint': case 'help.page.breakpoint':
$output = ''; $output = '';
$output .= '<h3>' . t('About') . '</h3>'; $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>'; $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>';
......
...@@ -6,13 +6,14 @@ ...@@ -6,13 +6,14 @@
*/ */
use Drupal\editor\Entity\Editor; use Drupal\editor\Entity\Editor;
use Symfony\Component\HttpFoundation\Request;
/** /**
* Implements hook_help(). * Implements hook_help().
*/ */
function ckeditor_help($path, $arg) { function ckeditor_help($route_name, Request $request) {
switch ($path) { switch ($route_name) {
case 'admin/help#ckeditor': case 'help.page.ckeditor':
$output = ''; $output = '';
$output .= '<h3>' . t('About') . '</h3>'; $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>'; $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>';
......
...@@ -6,13 +6,14 @@ ...@@ -6,13 +6,14 @@
use Drupal\Core\Asset\CssOptimizer; use Drupal\Core\Asset\CssOptimizer;
use Drupal\Component\Utility\String; use Drupal\Component\Utility\String;
use Symfony\Component\HttpFoundation\Request;
/** /**
* Implements hook_help(). * Implements hook_help().
*/ */
function color_help($path, $arg) { function color_help($route_name, Request $request) {
switch ($path) { switch ($route_name) {
case 'admin/help#color': case 'help.page.color':
$output = '<h3>' . t('About') . '</h3>'; $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 .= '<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>'; $output .= '<h3>' . t('Uses') . '</h3>';
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
use Drupal\file\FileInterface; use Drupal\file\FileInterface;
use Drupal\user\EntityOwnerInterface; use Drupal\user\EntityOwnerInterface;
use Drupal\node\NodeInterface; use Drupal\node\NodeInterface;
use Symfony\Component\HttpFoundation\Request;
/** /**
* Comments are displayed in a flat list - expanded. * Comments are displayed in a flat list - expanded.
...@@ -72,9 +73,9 @@ ...@@ -72,9 +73,9 @@
/** /**
* Implements hook_help(). * Implements hook_help().
*/ */
function comment_help($path, $arg) { function comment_help($route_name, Request $request) {
switch ($path) { switch ($route_name) {
case 'admin/help#comment': case 'help.page.comment':
$output = '<h3>' . t('About') . '</h3>'; $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 .= '<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>'; $output .= '<h3>' . t('Uses') . '</h3>';
...@@ -86,7 +87,7 @@ function comment_help($path, $arg) { ...@@ -86,7 +87,7 @@ function comment_help($path, $arg) {
$output .= '</dl>'; $output .= '</dl>';
return $output; 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>'; $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; return $output;
} }
......
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
* Allows site administrators to modify configuration. * Allows site administrators to modify configuration.
*/ */
use Symfony\Component\HttpFoundation\Request;
/** /**
* Implements hook_help(). * Implements hook_help().
*/ */
function config_help($path, $arg) { function config_help($route_name, Request $request) {
switch ($path) { switch ($route_name) {
case 'admin/help#config': case 'help.page.config':
$output = ''; $output = '';
$output .= '<h3>' . t('About') . '</h3>'; $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( $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) { ...@@ -18,7 +20,7 @@ function config_help($path, $arg) {
)) . '</p>'; )) . '</p>';
return $output; return $output;
case 'admin/config/development/configuration/sync': case 'config.sync':
$output = ''; $output = '';
$output .= '<p>' . t('Import configuration that is placed in your staging directory. All changes, deletions, renames, and additions are listed below.') . '</p>'; $output .= '<p>' . t('Import configuration that is placed in your staging directory. All changes, deletions, renames, and additions are listed below.') . '</p>';
return $output; return $output;
......
...@@ -7,14 +7,15 @@ ...@@ -7,14 +7,15 @@
use Drupal\config_translation\Plugin\Derivative\ConfigTranslationLocalTasks; use Drupal\config_translation\Plugin\Derivative\ConfigTranslationLocalTasks;
use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Exception\RouteNotFoundException; use Symfony\Component\Routing\Exception\RouteNotFoundException;
/** /**
* Implements hook_help(). * Implements hook_help().
*/ */
function config_translation_help($path) { function config_translation_help($route_name, Request $request) {
switch ($path) { switch ($route_name) {
case 'admin/help#config_translation': case 'help.page.config_translation':
$output = ''; $output = '';
$output .= '<h3>' . t('About') . '</h3>'; $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>'; $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) { ...@@ -25,7 +26,7 @@ function config_translation_help($path) {
$output .= '</dl>'; $output .= '</dl>';
return $output; 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>'; $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; return $output;
} }
......
<?php <?php
use Symfony\Component\HttpFoundation\Request;
/** /**
* @file * @file
...@@ -8,9 +9,9 @@ ...@@ -8,9 +9,9 @@
/** /**
* Implements hook_help(). * Implements hook_help().
*/ */
function contact_help($path, $arg) { function contact_help($route_name, Request $request) {
switch ($path) { switch ($route_name) {
case 'admin/help#contact': case 'help.page.contact':
$output = ''; $output = '';
$output .= '<h3>' . t('About') . '</h3>'; $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>'; $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) { ...@@ -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 .= '<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>'; $output .= '</dl>';
return $output; 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('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('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>'; $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>';
......
...@@ -15,13 +15,14 @@ ...@@ -15,13 +15,14 @@
use Drupal\Core\Session\AccountInterface; use Drupal\Core\Session\AccountInterface;
use Drupal\Core\TypedData\TranslatableInterface; use Drupal\Core\TypedData\TranslatableInterface;
use Drupal\node\NodeInterface; use Drupal\node\NodeInterface;
use Symfony\Component\HttpFoundation\Request;
/** /**
* Implements hook_help(). * Implements hook_help().
*/ */
function content_translation_help($path, $arg) { function content_translation_help($route_name, Request $request) {
switch ($path) { switch ($route_name) {
case 'admin/help#content_translation': case 'help.page.content_translation':
$output = ''; $output = '';
$output .= '<h3>' . t('About') . '</h3>'; $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>'; $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) { ...@@ -41,7 +42,7 @@ function content_translation_help($path, $arg) {
$output .= '</dl>'; $output .= '</dl>';
return $output; return $output;
case 'admin/config/regional/content-language': case 'language.content_settings_page':
$output = ''; $output = '';
if (!\Drupal::languageManager()->isMultilingual()) { 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'))); $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')));
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
use Drupal\Component\Serialization\Json; use Drupal\Component\Serialization\Json;
use Drupal\Component\Utility\UrlHelper; use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Template\Attribute; use Drupal\Core\Template\Attribute;
use Symfony\Component\HttpFoundation\Request;
/** /**
* Implements hook_toolbar(). * Implements hook_toolbar().
...@@ -63,9 +64,9 @@ function contextual_page_build(&$page) { ...@@ -63,9 +64,9 @@ function contextual_page_build(&$page) {
/** /**
* Implements hook_help(). * Implements hook_help().
*/ */
function contextual_help($path, $arg) { function contextual_help($route_name, Request $request) {
switch ($path) { switch ($route_name) {
case 'admin/help#contextual': case 'help.page.contextual':
$output = ''; $output = '';
$output .= '<h3>' . t('About') . '</h3>'; $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>'; $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>';
......
...@@ -12,13 +12,14 @@ ...@@ -12,13 +12,14 @@
*/ */
use Drupal\Core\Database\Database; use Drupal\Core\Database\Database;
use Symfony\Component\HttpFoundation\Request;
/** /**
* Implements hook_help(). * Implements hook_help().
*/ */
function dblog_help($path, $arg) { function dblog_help($route_name, Request $request) {
switch ($path) { switch ($route_name) {
case 'admin/help#dblog': case 'help.page.dblog':
$output = ''; $output = '';
$output .= '<h3>' . t('About') . '</h3>'; $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>'; $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) { ...@@ -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 .= '<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>';