Issue #2294129 by xjm, tim.plunkett: Switch hook_help() to use RouteMatch instead of Request.

8.0.x
webchick 2014-06-29 20:33:08 -07:00
parent a36a116d75
commit 94e0188a10
64 changed files with 207 additions and 159 deletions

View File

@ -5,12 +5,12 @@
* This is the Actions module for executing stored actions.
*/
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function action_help($route_name, Request $request) {
function action_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.action':
$output = '';

View File

@ -8,7 +8,7 @@
use Drupal\aggregator\Entity\Feed;
use Drupal\aggregator\FeedInterface;
use Drupal\Component\Utility\Xss;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Denotes that a feed's items should never expire.
@ -18,7 +18,7 @@ const AGGREGATOR_CLEAR_NEVER = 0;
/**
* Implements hook_help().
*/
function aggregator_help($route_name, Request $request) {
function aggregator_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.aggregator':
$output = '';

View File

@ -5,12 +5,12 @@
* Allows to ban individual IP addresses.
*/
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function ban_help($route_name, Request $request) {
function ban_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.ban':
$output = '';

View File

@ -5,12 +5,12 @@
* Provides an HTTP Basic authentication provider.
*/
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function basic_auth_help($route_name, Request $request) {
function basic_auth_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.basic_auth':
$output = '';

View File

@ -6,14 +6,14 @@
*/
use Drupal\block\BlockInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\language\Entity\Language;
use Drupal\system\Entity\Menu;
use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
function block_help($route_name, Request $request) {
function block_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.block':
$output = '';
@ -37,7 +37,7 @@ function block_help($route_name, Request $request) {
return $output;
}
if ($route_name == 'block.admin_display' || $route_name == 'block.admin_display_theme') {
$demo_theme = $request->attributes->get('theme', \Drupal::config('system.theme')->get('default'));
$demo_theme = $route_match->getParameter('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>';

View File

@ -5,14 +5,14 @@
* Allows the creation of custom blocks through the user interface.
*/
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldInstanceConfig;
/**
* Implements hook_help().
*/
function block_content_help($route_name, Request $request) {
function block_content_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.block_content':
$output = '';

View File

@ -9,17 +9,17 @@ use Drupal\book\BookManagerInterface;
use Drupal\Component\Utility\String;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Render\Element;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\node\NodeInterface;
use Drupal\node\NodeTypeInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Template\Attribute;
use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
function book_help($route_name, Request $request) {
function book_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.book':
$output = '<h3>' . t('About') . '</h3>';

View File

@ -8,12 +8,12 @@
use Drupal\breakpoint\Entity\Breakpoint;
use Drupal\breakpoint\Entity\BreakpointGroup;
use Drupal\Core\Config\Entity\ConfigEntityStorage;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function breakpoint_help($route_name, Request $request) {
function breakpoint_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.breakpoint':
$output = '';

View File

@ -5,13 +5,13 @@
* Provides integration with the CKEditor WYSIWYG editor.
*/
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\editor\Entity\Editor;
use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
function ckeditor_help($route_name, Request $request) {
function ckeditor_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.ckeditor':
$output = '';

View File

@ -8,12 +8,12 @@ use Drupal\Core\Asset\CssOptimizer;
use Drupal\Component\Utility\Bytes;
use Drupal\Component\Utility\Environment;
use Drupal\Component\Utility\String;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function color_help($route_name, Request $request) {
function color_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.color':
$output = '<h3>' . t('About') . '</h3>';

View File

@ -17,6 +17,7 @@ use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
use Drupal\Component\Utility\String;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\entity\Entity\EntityViewDisplay;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
@ -28,7 +29,6 @@ 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.
@ -79,7 +79,7 @@ define('COMMENT_NEW_LIMIT', REQUEST_TIME - 30 * 24 * 60 * 60);
/**
* Implements hook_help().
*/
function comment_help($route_name, Request $request) {
function comment_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.comment':
$output = '<h3>' . t('About') . '</h3>';

View File

@ -5,12 +5,12 @@
* Allows site administrators to modify configuration.
*/
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function config_help($route_name, Request $request) {
function config_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.config':
$output = '';

View File

@ -7,13 +7,13 @@
use Drupal\config_translation\Plugin\Derivative\ConfigTranslationLocalTasks;
use Drupal\Core\Entity\EntityInterface;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
use Symfony\Component\Routing\Exception\RouteNotFoundException;
/**
* Implements hook_help().
*/
function config_translation_help($route_name, Request $request) {
function config_translation_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.config_translation':
$output = '';

View File

@ -1,15 +1,16 @@
<?php
use Symfony\Component\HttpFoundation\Request;
/**
* @file
* Enables the use of personal and site-wide contact forms.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function contact_help($route_name, Request $request) {
function contact_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.contact':
$output = '';

View File

@ -10,15 +10,15 @@ use Drupal\Core\Entity\EntityFormInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\field\Entity\FieldInstanceConfig;
use Drupal\field\FieldInstanceConfigInterface;
use Drupal\node\NodeInterface;
use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
function content_translation_help($route_name, Request $request) {
function content_translation_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.content_translation':
$output = '';

View File

@ -7,8 +7,8 @@
use Drupal\Component\Serialization\Json;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Template\Attribute;
use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_toolbar().
@ -64,7 +64,7 @@ function contextual_page_build(&$page) {
/**
* Implements hook_help().
*/
function contextual_help($route_name, Request $request) {
function contextual_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.contextual':
$output = '';

View File

@ -7,6 +7,7 @@
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Datetime\DrupalDateTime;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Template\Attribute;
use Drupal\datetime\DateHelper;
use Drupal\node\NodeInterface;
@ -29,8 +30,8 @@ const DATETIME_DATE_STORAGE_FORMAT = 'Y-m-d';
/**
* Implements hook_help().
*/
function datetime_help($path, $arg) {
switch ($path) {
function datetime_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.datetime':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';

View File

@ -11,12 +11,12 @@
* @see watchdog()
*/
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function dblog_help($route_name, Request $request) {
function dblog_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.dblog':
$output = '';

View File

@ -8,17 +8,17 @@
use Drupal\Component\Utility\Html;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Render\Element;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\editor\Entity\Editor;
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($route_name, Request $request) {
function editor_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.editor':
$output = '';

View File

@ -9,12 +9,12 @@
*/
use Drupal\Core\Config\Entity\ConfigEntityStorage;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function entity_help($route_name, Request $request) {
function entity_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.entity':
$output = '';

View File

@ -10,15 +10,15 @@ use Drupal\Core\Database\Query\AlterableInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Render\Element;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldInstanceConfig;
use Drupal\field\FieldConfigInterface;
use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
function entity_reference_help($route_name, Request $request) {
function entity_reference_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.entity_reference':
$output = '';

View File

@ -9,7 +9,7 @@ use Drupal\Component\Utility\Xss;
use Drupal\Core\Config\ConfigImporter;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Extension\Extension;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/*
* Load all public Field API functions. Drupal currently has no
@ -59,7 +59,7 @@ require_once __DIR__ . '/field.purge.inc';
/**
* Implements hook_help().
*/
function field_help($route_name, Request $request) {
function field_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.field':
$output = '';

View File

@ -7,15 +7,15 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Render\Element;
use Drupal\Core\Routing\RouteMatchInterface;
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($route_name, Request $request) {
function field_ui_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.field_ui':
$output = '';

View File

@ -8,13 +8,13 @@
use Drupal\Component\Utility\String;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Render\Element;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\file\Entity\File;
use Drupal\Component\Utility\NestedArray;
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';
@ -22,7 +22,7 @@ require_once __DIR__ . '/file.field.inc';
/**
* Implements hook_help().
*/
function file_help($route_name, Request $request) {
function file_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.file':
$output = '';

View File

@ -12,16 +12,16 @@ use Drupal\Component\Utility\String;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Render\Element;
use Drupal\Core\Routing\RouteMatchInterface;
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($route_name, Request $request) {
function filter_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.filter':
$output = '';

View File

@ -10,12 +10,12 @@ use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Component\Utility\String;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function forum_help($route_name, Request $request) {
function forum_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.forum':
$output = '';

View File

@ -5,12 +5,12 @@
* Adds support for serializing entities to Hypertext Application Language.
*/
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function hal_help($route_name, Request $request) {
function hal_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.hal':
$output = '';

View File

@ -5,12 +5,12 @@
* Manages displaying online help.
*/
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function help_help($route_name, Request $request) {
function help_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.main':
$output = '<h2>' . t('Getting Started') . '</h2>';

View File

@ -8,7 +8,8 @@
namespace Drupal\help\Controller;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Drupal\Component\Utility\String;
@ -18,20 +19,43 @@ use Drupal\Component\Utility\String;
class HelpController extends ControllerBase {
/**
* Prints a page listing a glossary of Drupal terminology.
* The current route match.
*
* @param \Symfony\Component\HttpFoundation\Request $request
* The current request.
* @var \Drupal\Core\Routing\RouteMatchInterface
*/
protected $routeMatch;
/**
* Creates a new HelpController.
*
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The current route match.
*/
public function __construct(RouteMatchInterface $route_match) {
$this->routeMatch = $route_match;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('current_route_match')
);
}
/**
* Prints a page listing a glossary of Drupal terminology.
*
* @return string
* An HTML string representing the contents of help page.
*/
public function helpMain(Request $request) {
public function helpMain() {
$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($request),
'#markup' => '<h2>' . $this->t('Help topics') . '</h2><p>' . $this->t('Help is available on the following items:') . '</p>' . $this->helpLinksAsList(),
);
return $output;
}
@ -39,18 +63,15 @@ 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(Request $request) {
protected function helpLinksAsList() {
$module_info = system_rebuild_module_data();
$modules = array();
foreach ($this->moduleHandler()->getImplementations('help') as $module) {
if ($this->moduleHandler()->invoke($module, 'help', array("help.page.$module", $request))) {
if ($this->moduleHandler()->invoke($module, 'help', array("help.page.$module", $this->routeMatch))) {
$modules[$module] = $module_info[$module]->info['name'];
}
}
@ -78,21 +99,19 @@ 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, Request $request) {
public function helpPage($name) {
$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("help.page.$name", $request));
$temp = $this->moduleHandler()->invoke($name, 'help', array("help.page.$name", $this->routeMatch));
if (empty($temp)) {
$build['top']['#markup'] = $this->t('No help is available for module %module.', array('%module' => $info[$name]['name']));
}

View File

@ -11,7 +11,7 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Entities changed before this time are always shown as read.
@ -24,7 +24,7 @@ define('HISTORY_READ_LIMIT', REQUEST_TIME - 30 * 24 * 60 * 60);
/**
* Implements hook_help().
*/
function history_help($route_name, Request $request) {
function history_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.history':
$output = '<h3>' . t('About') . '</h3>';

View File

@ -7,10 +7,10 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Component\Plugin\Exception\PluginNotFoundException;
use Drupal\Core\Routing\RouteMatchInterface;
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.
@ -48,7 +48,7 @@ require_once __DIR__ . '/image.field.inc';
/**
* Implements hook_help().
*/
function image_help($route_name, Request $request) {
function image_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.image':
$output = '';
@ -70,11 +70,11 @@ function image_help($route_name, Request $request) {
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 'image.effect_add_form':
$effect = \Drupal::service('plugin.manager.image.effect')->getDefinition($request->attributes->get('image_effect'));
$effect = \Drupal::service('plugin.manager.image.effect')->getDefinition($route_match->getParameter('image_effect'));
return isset($effect['description']) ? ('<p>' . $effect['description'] . '</p>') : NULL;
case 'image.effect_edit_form':
$effect = $request->attributes->get('image_style')->getEffect($request->attributes->get('image_effect'));
$effect = $route_match->getParameter('image_style')->getEffect($route_match->getParameter('image_effect'));
$effect_definition = $effect->getPluginDefinition();
return isset($effect_definition['description']) ? ('<p>' . $effect_definition['description'] . '</p>') : NULL;
}

View File

@ -7,6 +7,7 @@
use Drupal\Core\PhpStorage\PhpStorageFactory;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\language\ConfigurableLanguageManager;
use Drupal\language\ConfigurableLanguageManagerInterface;
use Drupal\language\Entity\Language as LanguageEntity;
@ -14,12 +15,11 @@ 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($route_name, Request $request) {
function language_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.language':
$output = '';
@ -73,13 +73,13 @@ function language_help($route_name, Request $request) {
return $output;
case 'block.admin_edit':
if (($block = $request->attributes->get('block')) && $block->get('plugin') == 'language_block:language_interface') {
if (($block = $route_match->getParameter('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 'block.admin_add':
if ($request->attributes->get('plugin_id') == 'language_block:language_interface') {
if ($route_match->getParameter('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;

View File

@ -6,12 +6,12 @@
*/
use Drupal\Component\Utility\String;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function link_help($route_name, Request $request) {
function link_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.link':
$output = '';

View File

@ -15,11 +15,11 @@ use Drupal\Component\Utility\UrlHelper;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Language\Language;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\StringTranslation\TranslationWrapper;
use Drupal\Core\Language\LanguageInterface;
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.
@ -137,7 +137,7 @@ const LOCALE_TRANSLATION_CURRENT = 'current';
/**
* Implements hook_help().
*/
function locale_help($route_name, Request $request) {
function locale_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.locale':
$output = '';

View File

@ -9,9 +9,8 @@ use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
use Drupal\menu_link\Entity\MenuLink;
use Drupal\menu_link\MenuLinkInterface;
use Symfony\Component\HttpFoundation\Request;
function menu_link_help($route_name, Request $request) {
function menu_link_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.menu_link':
$output = '';

View File

@ -14,13 +14,13 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\block\BlockPluginInterface;
use Drupal\Core\Render\Element;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\node\NodeTypeInterface;
use Drupal\system\Entity\Menu;
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
@ -31,7 +31,7 @@ const MENU_MAX_MENU_NAME_LENGTH_UI = 27;
/**
* Implements hook_help().
*/
function menu_ui_help($route_name, Request $request) {
function menu_ui_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.menu_ui':
$output = '';

View File

@ -11,8 +11,8 @@
use Drupal\Component\Utility\Xss;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Render\Element;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Drupal\Core\Database\Query\AlterableInterface;
use Drupal\Core\Database\Query\SelectInterface;
@ -88,7 +88,7 @@ const NODE_ACCESS_IGNORE = NULL;
/**
* Implements hook_help().
*/
function node_help($route_name, Request $request) {
function node_help($route_name, RouteMatchInterface $route_match) {
// 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.
@ -128,12 +128,12 @@ function node_help($route_name, Request $request) {
case 'field_ui.form_display_overview_node':
case 'field_ui.form_display_overview_form_mode_node':
$type = $request->attributes->get('node_type');
$type = $route_match->getParameter('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 'field_ui.display_overview_node':
case 'field_ui.display_overview_view_mode_node':
$type = $request->attributes->get('node_type');
$type = $route_match->getParameter('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>';
@ -141,12 +141,12 @@ function node_help($route_name, Request $request) {
return '<p>' . t('Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.') . '</p>';
case 'node.page_edit':
$node = $request->attributes->get('node');
$node = $route_match->getParameter('node');
$type = $node->getType();
return (!empty($type->help) ? Xss::filterAdmin($type->help) : '');
case 'node.add':
$type = $request->attributes->get('node_type');
$type = $route_match->getParameter('node_type');
return (!empty($type->help) ? Xss::filterAdmin($type->help) : '');
}
}

View File

@ -7,14 +7,14 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\field\FieldConfigInterface;
use Drupal\field\FieldConfigUpdateForbiddenException;
use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
function options_help($route_name, Request $request) {
function options_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.options':
$output = '';

View File

@ -9,12 +9,12 @@ use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Field\FieldDefinition;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function path_help($route_name, Request $request) {
function path_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.path':
$output = '';

View File

@ -13,12 +13,12 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function quickedit_help($route_name, Request $request) {
function quickedit_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.quickedit':
$output = '<h3>' . t('About') . '</h3>';

View File

@ -6,13 +6,13 @@
*/
use Drupal\Component\Utility\String;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Template\Attribute;
use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
function rdf_help($route_name, Request $request) {
function rdf_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.rdf':
$output = '';

View File

@ -6,13 +6,13 @@
*/
use Drupal\breakpoint\Entity\Breakpoint;
use Drupal\Core\Routing\RouteMatchInterface;
use \Drupal\Core\Template\Attribute;
use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
function responsive_image_help($route_name, Request $request) {
function responsive_image_help($route_name, RouteMatchInterface $route_match) {
$output = '';
switch ($route_name) {
case 'help.page.responsive_image':

View File

@ -5,7 +5,7 @@
* RESTful web services module.
*/
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_permission().
@ -26,7 +26,7 @@ function rest_permission() {
/**
* Implements hook_help().
*/
function rest_help($route_name, Request $request) {
function rest_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.rest':
$output = '';

View File

@ -7,7 +7,7 @@
use Drupal\Component\Utility\String;
use Drupal\Component\Utility\Unicode;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Matches all 'N' Unicode character classes (numbers)
@ -67,7 +67,7 @@ define('PREG_CLASS_CJK', '\x{1100}-\x{11FF}\x{3040}-\x{309F}\x{30A1}-\x{318E}' .
/**
* Implements hook_help().
*/
function search_help($route_name, Request $request) {
function search_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.search':
$output = '';

View File

@ -5,12 +5,12 @@
* Provides a service for (de)serializing data to/from formats such as JSON and XML.
*/
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function serialization_help($route_name, Request $request) {
function serialization_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.serialization':
$output = '';

View File

@ -7,16 +7,16 @@
use Drupal\Component\Utility\NestedArray;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Routing\UrlMatcher;
use Drupal\Core\Url;
use Drupal\shortcut\Entity\ShortcutSet;
use Drupal\shortcut\ShortcutSetInterface;
use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
function shortcut_help($route_name, Request $request) {
function shortcut_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.shortcut':
$output = '<h3>' . t('About') . '</h3>';

View File

@ -4,8 +4,8 @@ use Drupal\Core\Database\Database;
use Drupal\Core\Page\HtmlPage;
use Drupal\Core\Extension\ExtensionDiscovery;
use Drupal\Core\Render\Element;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\simpletest\TestBase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Process\PhpExecutableFinder;
/**
@ -16,7 +16,7 @@ use Symfony\Component\Process\PhpExecutableFinder;
/**
* Implements hook_help().
*/
function simpletest_help($route_name, Request $request) {
function simpletest_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.simpletest':
$output = '';

View File

@ -7,13 +7,13 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\node\NodeInterface;
use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
function statistics_help($route_name, Request $request) {
function statistics_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.statistics':
$output = '';

View File

@ -5,12 +5,12 @@
* Redirects logging messages to syslog.
*/
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function syslog_help($route_name, Request $request) {
function syslog_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.syslog':
$output = '';

View File

@ -17,6 +17,7 @@ use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Form\FormBase;
use Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface;
use Drupal\Core\Render\Element;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Session\AccountInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Access\AccessManager;
@ -66,6 +67,13 @@ class ModulesListForm extends FormBase {
*/
protected $queryFactory;
/**
* The current route match.
*
* @var \Drupal\Core\Routing\RouteMatchInterface
*/
protected $routeMatch;
/**
* {@inheritdoc}
*/
@ -76,7 +84,8 @@ class ModulesListForm extends FormBase {
$container->get('access_manager'),
$container->get('entity.manager'),
$container->get('entity.query'),
$container->get('current_user')
$container->get('current_user'),
$container->get('current_route_match')
);
}
@ -95,14 +104,17 @@ class ModulesListForm extends FormBase {
* The entity query factory.
* @param \Drupal\Core\Session\AccountInterface $current_user
* The current user.
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The current route match.
*/
public function __construct(ModuleHandlerInterface $module_handler, KeyValueStoreExpirableInterface $key_value_expirable, AccessManager $access_manager, EntityManagerInterface $entity_manager, QueryFactory $query_factory, AccountInterface $current_user) {
public function __construct(ModuleHandlerInterface $module_handler, KeyValueStoreExpirableInterface $key_value_expirable, AccessManager $access_manager, EntityManagerInterface $entity_manager, QueryFactory $query_factory, AccountInterface $current_user, RouteMatchInterface $route_match) {
$this->moduleHandler = $module_handler;
$this->keyValueExpirable = $key_value_expirable;
$this->accessManager = $access_manager;
$this->entityManager = $entity_manager;
$this->queryFactory = $query_factory;
$this->currentUser = $current_user;
$this->routeMatch = $route_match;
}
/**
@ -211,7 +223,7 @@ class ModulesListForm extends FormBase {
// Generate link for module's help page, if there is one.
$row['links']['help'] = array();
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()))) {
if ($this->moduleHandler->invoke($module->getName(), 'help', array('help.page.' . $module->getName(), $this->routeMatch))) {
$row['links']['help'] = array(
'#type' => 'link',
'#title' => $this->t('Help'),

View File

@ -10,8 +10,8 @@ namespace Drupal\system\Plugin\Block;
use Drupal\block\BlockBase;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Session\AccountInterface;
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
@ -46,6 +46,13 @@ class SystemHelpBlock extends BlockBase implements ContainerFactoryPluginInterfa
*/
protected $request;
/**
* The current route match.
*
* @var \Drupal\Core\Routing\RouteMatchInterface
*/
protected $routeMatch;
/**
* Creates a SystemHelpBlock instance.
*
@ -59,12 +66,15 @@ class SystemHelpBlock extends BlockBase implements ContainerFactoryPluginInterfa
* The current request.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler.
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The current route match.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, Request $request, ModuleHandlerInterface $module_handler) {
public function __construct(array $configuration, $plugin_id, $plugin_definition, Request $request, ModuleHandlerInterface $module_handler, RouteMatchInterface $route_match) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->request = $request;
$this->moduleHandler = $module_handler;
$this->routeMatch = $route_match;
}
/**
@ -72,7 +82,13 @@ class SystemHelpBlock extends BlockBase implements ContainerFactoryPluginInterfa
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static(
$configuration, $plugin_id, $plugin_definition, $container->get('request'), $container->get('module_handler'));
$configuration,
$plugin_id,
$plugin_definition,
$container->get('request'),
$container->get('module_handler'),
$container->get('current_route_match')
);
}
/**
@ -95,8 +111,7 @@ class SystemHelpBlock extends BlockBase implements ContainerFactoryPluginInterfa
return '';
}
$route_name = $request->attributes->get(RouteObjectInterface::ROUTE_NAME);
$help = $this->moduleHandler->invokeAll('help', array($route_name, $request));
$help = $this->moduleHandler->invokeAll('help', array($this->routeMatch->getRouteName(), $this->routeMatch));
return $help ? implode("\n", $help) : '';
}

View File

@ -1005,14 +1005,14 @@ function hook_permission() {
* For page-specific help, use the route name as identified in the
* module's routing.yml file. For module overview help, the route name
* will be in the form of "help.page.$modulename".
* @param \Symfony\Component\HttpFoundation\Request $request
* The current request. This can be used to generate different help
* @param Drupal\Core\Routing\RouteMatchInterface $route_match
* The current route match. This can be used to generate different help
* output for different pages that share the same route.
*
* @return string
* A localized string containing the help text.
*/
function hook_help($route_name, \Symfony\Component\HttpFoundation\Request $request) {
function hook_help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the block module.
case 'help.page.block':

View File

@ -8,13 +8,13 @@
use Drupal\Core\Cache\Cache;
use Drupal\Core\Extension\Extension;
use Drupal\Core\Extension\ExtensionDiscovery;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\StringTranslation\TranslationWrapper;
use Drupal\Core\Language\LanguageInterface;
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.
@ -75,7 +75,7 @@ const EMAIL_MAX_LENGTH = 254;
/**
* Implements hook_help().
*/
function system_help($route_name, Request $request) {
function system_help($route_name, RouteMatchInterface $route_match) {
global $base_url;
switch ($route_name) {
@ -109,7 +109,7 @@ function system_help($route_name, Request $request) {
case 'system.theme_settings_theme':
$theme_list = list_themes();
$theme = $theme_list[$request->attributes->get('theme')];
$theme = $theme_list[$route_match->getParameter('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 'system.theme_settings':
@ -134,13 +134,13 @@ function system_help($route_name, Request $request) {
return '<p>' . t('The uninstall process removes all data related to a module.') . '</p>';
case 'block.admin_edit':
if (($block = $request->attributes->get('block')) && $block->get('plugin') == 'system_powered_by_block') {
if (($block = $route_match->getParameter('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 'block.admin_add':
if ($request->attributes->get('plugin_id') == 'system_powered_by_block') {
if ($route_match->getParameter('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;

View File

@ -9,6 +9,7 @@ use Drupal\Component\Utility\Tags;
use Drupal\Core\Entity\ContentEntityDatabaseStorage;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Render\Element;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
use Drupal\file\FileInterface;
use Drupal\node\Entity\Node;
@ -16,7 +17,6 @@ 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.
@ -44,7 +44,7 @@ const TAXONOMY_HIERARCHY_MULTIPLE = 2;
/**
* Implements hook_help().
*/
function taxonomy_help($route_name, Request $request) {
function taxonomy_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.taxonomy':
$output = '';
@ -79,7 +79,7 @@ function taxonomy_help($route_name, Request $request) {
return $output;
case 'taxonomy.overview_terms':
$vocabulary = $request->attributes->get('taxonomy_vocabulary');
$vocabulary = $route_match->getParameter('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>';

View File

@ -5,12 +5,12 @@
* Defines a simple telephone number field type.
*/
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function telephone_help($route_name, Request $request) {
function telephone_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.telephone':
$output = '';

View File

@ -7,12 +7,12 @@
use Drupal\Component\Utility\Html;
use Drupal\Core\Entity\EntityInterface;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function text_help($route_name, Request $request) {
function text_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.text':
$output = '';

View File

@ -8,9 +8,9 @@
use Drupal\Component\Utility\String;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Render\Element;
use Drupal\Core\Routing\RouteMatchInterface;
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;
@ -19,7 +19,7 @@ use Drupal\user\UserInterface;
/**
* Implements hook_help().
*/
function toolbar_help($route_name, Request $request) {
function toolbar_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.toolbar':
$output = '<h3>' . t('About') . '</h3>';

View File

@ -4,13 +4,14 @@
* @file
* Main functions of the module.
*/
use Drupal\Core\Cache\CacheBackendInterface;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function tour_help($route_name, Request $request) {
function tour_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.tour':
$output = '';

View File

@ -7,14 +7,14 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\comment\CommentInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\node\NodeInterface;
use Drupal\Core\Session\AccountInterface;
use Symfony\Component\HttpFoundation\Request;
/**
* Implements hook_help().
*/
function tracker_help($route_name, Request $request) {
function tracker_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.tracker':
$output = '<h3>' . t('About') . '</h3>';

View File

@ -11,9 +11,9 @@
* ability to install contributed modules and themes via an user interface.
*/
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Site\Settings;
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Symfony\Component\HttpFoundation\Request;
// These are internally used constants for this code, do not modify.
@ -65,7 +65,7 @@ const UPDATE_FETCH_PENDING = -4;
/**
* Implements hook_help().
*/
function update_help($route_name, Request $request) {
function update_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.update':
$output = '';

View File

@ -4,6 +4,7 @@ use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\String;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Session\AnonymousUserSession;
use \Drupal\Core\Entity\Display\EntityViewDisplayInterface;
@ -16,7 +17,6 @@ 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;
@ -49,7 +49,7 @@ const USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL = 'visitors_admin_approval'
/**
* Implement hook_help().
*/
function user_help($route_name, Request $request) {
function user_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.user':
$output = '';

View File

@ -14,6 +14,7 @@ use Drupal\Core\Cache\Cache;
use Drupal\Core\Database\Query\AlterableInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Render\Element;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\views\Plugin\Derivative\ViewsLocalTask;
use Drupal\Core\Template\AttributeArray;
use Drupal\views\ViewExecutable;
@ -21,12 +22,11 @@ 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($route_name, Request $request) {
function views_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.views':
$output = '';

View File

@ -5,6 +5,7 @@
* Provide structure for the administrative interface to Views.
*/
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\views\Views;
use Drupal\views\ViewExecutable;
use Drupal\views\ViewStorageInterface;
@ -12,12 +13,11 @@ 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($route_name, Request $request) {
function views_ui_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.views_ui':
$output = '';

View File

@ -5,12 +5,12 @@
* Enables XML-RPC functionality.
*/
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function xmlrpc_help($route_name, Request $request) {
function xmlrpc_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.xmlrpc':
$output = '';