Commit 94e0188a authored by webchick's avatar webchick
Browse files

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

parent a36a116d
......@@ -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 = '';
......
......@@ -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 @@
/**
* 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 = '';
......
......@@ -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 = '';
......
......@@ -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 = '';
......
......@@ -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>';
......
......@@ -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 = '';
......
......@@ -9,17 +9,17 @@
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>';
......
......@@ -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 = '';
......
......@@ -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 = '';
......
......@@ -8,12 +8,12 @@
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>';
......
......@@ -17,6 +17,7 @@
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\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 @@
/**
* 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>';
......
......@@ -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 = '';
......
......@@ -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 = '';
......
<?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 = '';
......
......@@ -10,15 +10,15 @@
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 = '';
......
......@@ -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 = '';
......
......@@ -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 @@
/**
* 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>';
......
......@@ -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 = '';
......
......@@ -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 = '';
......
......@@ -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 = '';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment