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) {
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.
*/
......
......@@ -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.');
}
}
......
......@@ -7,6 +7,7 @@
use Drupal\aggregator\FeedInterface;
use Drupal\Component\Utility\Xss;
use Symfony\Component\HttpFoundation\Request;
/**
* Denotes that a feed's items should never expire.
......@@ -16,9 +17,9 @@
/**
* Implements hook_help().
*/
function aggregator_help($path, $arg) {
switch ($path) {
case 'admin/help#aggregator':
function aggregator_help($route_name, Request $request) {
switch ($route_name) {
case 'help.page.aggregator':
$output = '';
$output .= '<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>';
}
}
......
......@@ -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>';
}
}
......
......@@ -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>';
......
......@@ -10,6 +10,7 @@
use Drupal\language\Entity\Language;
use Drupal\system\Entity\Menu;
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Symfony\Component\HttpFoundation\Request;
/**
* Shows this block on every page except the listed pages.
......@@ -30,9 +31,9 @@
/**
* Implements hook_help().
*/
function block_help($path, $arg) {
switch ($path) {
case 'admin/help#block':
function block_help($route_name, Request $request) {
switch ($route_name) {
case 'help.page.block':
$output = '';
$output .= '<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>';
......
......@@ -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;
......
......@@ -14,13 +14,14 @@
use Drupal\Core\Language\Language;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Template\Attribute;
use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
function book_help($path, $arg) {
switch ($path) {
case 'admin/help#book':
function book_help($route_name, Request $request) {
switch ($route_name) {
case 'help.page.book':
$output = '<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>';
}
}
......
......@@ -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>';
......
......@@ -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>';
......
......@@ -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>';
......
......@@ -22,6 +22,7 @@
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 @@
/**
* 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;
}
......
......@@ -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;
......
......@@ -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;
}
......
<?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>';
......
......@@ -15,13 +15,14 @@
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\TypedData\TranslatableInterface;
use Drupal\node\NodeInterface;
use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
function content_translation_help($path, $arg) {
switch ($path) {
case 'admin/help#content_translation':
function content_translation_help($route_name, Request $request) {
switch ($route_name) {
case 'help.page.content_translation':
$output = '';
$output .= '<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')));
......
......@@ -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>';
......
......@@ -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>';
}
}
......
......@@ -13,13 +13,14 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\filter\FilterFormatInterface;
use Drupal\filter\Plugin\FilterInterface;
use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
function editor_help($path, $arg) {
switch ($path) {
case 'admin/help#editor':
function editor_help($route_name, Request $request) {
switch ($route_name) {
case 'help.page.editor':
$output = '';
$output .= '<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>';
......
......@@ -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>';
......
......@@ -11,13 +11,14 @@
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Render\Element;
use Drupal\field\FieldConfigInterface;
use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
function entity_reference_help($path, $arg) {
switch ($path) {
case 'admin/help#entity_reference':
function entity_reference_help($route_name, Request $request) {
switch ($route_name) {
case 'help.page.entity_reference':
$output = '';
$output .= '<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>';
......
......@@ -10,6 +10,7 @@
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Extension\Extension;
use Drupal\field\Field;
use Symfony\Component\HttpFoundation\Request;
/*
* Load all public Field API functions. Drupal currently has no
......@@ -78,9 +79,9 @@
/**
* Implements hook_help().
*/
function field_help($path, $arg) {
switch ($path) {
case 'admin/help#field':
function field_help($route_name, Request $request) {
switch ($route_name) {
case 'help.page.field':
$output = '';
$output .= '<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>';
......
......@@ -10,13 +10,14 @@
use Drupal\entity\EntityViewModeInterface;
use Drupal\field_ui\FieldUI;
use Drupal\field_ui\Plugin\Derivative\FieldUiLocalTask;
use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
function field_ui_help($path, $arg) {
switch ($path) {
case 'admin/help#field_ui':
function field_ui_help($route_name, Request $request) {
switch ($route_name) {
case 'help.page.field_ui':
$output = '';
$output .= '<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>';
}
}
......
......@@ -12,6 +12,7 @@
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Template\Attribute;
use Drupal\file\FileUsage\FileUsageInterface;
use Symfony\Component\HttpFoundation\Request;
// Load all Field module hooks for File.
require_once __DIR__ . '/file.field.inc';
......@@ -19,9 +20,9 @@
/**
* Implements hook_help().
*/
function file_help($path, $arg) {
switch ($path) {
case 'admin/help#file':
function file_help($route_name, Request $request) {
switch ($route_name) {
case 'help.page.file':
$output = '';
$output .= '<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>';
......
......@@ -15,13 +15,14 @@
use Drupal\Core\Template\Attribute;
use Drupal\filter\FilterFormatInterface;
use Drupal\filter\Plugin\FilterInterface;
use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
function filter_help($path, $arg) {
switch ($path) {
case 'admin/help#filter':
function filter_help($route_name, Request $request) {
switch ($route_name) {
case 'help.page.filter':
$output = '';
$output .= '<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;
}
......
......@@ -10,13 +10,14 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Component\Utility\String;
use Drupal\field\Field;
use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
function forum_help($path, $arg) {
switch ($path) {
case 'admin/help#forum':
function forum_help($route_name, Request $request) {
switch ($route_name) {
case 'help.page.forum':
$output = '';
$output .= '<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>';