diff -u b/core/modules/aggregator/src/Tests/ImportOpmlTest.php b/core/modules/aggregator/src/Tests/ImportOpmlTest.php --- b/core/modules/aggregator/src/Tests/ImportOpmlTest.php +++ b/core/modules/aggregator/src/Tests/ImportOpmlTest.php @@ -33,7 +33,7 @@ */ function openImportForm() { // Enable the help block. - $this->drupalPlaceBlock('system_help_block', array('region' => 'help')); + $this->drupalPlaceBlock('contextual_help_block', array('region' => 'help')); $this->drupalGet('admin/config/services/aggregator/add/opml'); $this->assertText('A single OPML document may contain many feeds.', 'Found OPML help text.'); diff -u b/core/modules/block/src/Tests/BlockUiTest.php b/core/modules/block/src/Tests/BlockUiTest.php --- b/core/modules/block/src/Tests/BlockUiTest.php +++ b/core/modules/block/src/Tests/BlockUiTest.php @@ -80,7 +80,7 @@ * Test block demo page exists and functions correctly. */ public function testBlockDemoUiPage() { - $this->drupalPlaceBlock('system_help_block', array('region' => 'help')); + $this->drupalPlaceBlock('contextual_help_block', array('region' => 'help')); $this->drupalGet('admin/structure/block'); $this->clickLink(t('Demonstrate block regions (@theme)', array('@theme' => 'Classy'))); $elements = $this->xpath('//div[contains(@class, "region-highlighted")]/div[contains(@class, "block-region") and contains(text(), :title)]', array(':title' => 'Highlighted')); reverted: --- b/core/modules/help/src/Plugin/Block/SystemHelpBlock.php +++ a/core/modules/system/src/Plugin/Block/SystemHelpBlock.php @@ -2,10 +2,10 @@ /** * @file + * Contains \Drupal\system\Plugin\Block\SystemHelpBlock. - * Contains \Drupal\help\Plugin\Block\SystemHelpBlock. */ +namespace Drupal\system\Plugin\Block; -namespace Drupal\help\Plugin\Block; use Drupal\Core\Block\BlockBase; use Drupal\Core\Extension\ModuleHandlerInterface; diff -u b/core/modules/node/src/Tests/NodeTranslationUITest.php b/core/modules/node/src/Tests/NodeTranslationUITest.php --- b/core/modules/node/src/Tests/NodeTranslationUITest.php +++ b/core/modules/node/src/Tests/NodeTranslationUITest.php @@ -38,7 +38,7 @@ parent::setUp(); // Ensure the help message is shown even with prefixed paths. - $this->drupalPlaceBlock('system_help_block', array('region' => 'content')); + $this->drupalPlaceBlock('contextual_help_block', array('region' => 'content')); // Display the language selector. $this->drupalLogin($this->administrator); diff -u b/core/modules/system/system.module b/core/modules/system/system.module --- b/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -88,11 +88,9 @@ $output .= '
' . t('In order for the site and its modules to continue to operate well, a set of routine administrative operations must run on a regular basis. The System module manages this task by making use of a system cron job. You can verify the status of cron tasks by visiting the Status report page. For more information, see the online handbook entry for configuring cron jobs. You can set up cron job by visiting Cron configuration page', array('@status' => \Drupal::url('system.status'), '@handbook' => 'http://drupal.org/cron', '@cron' => \Drupal::url('system.cron_settings'))) . '
'; $output .= '
' . t('Configuring basic site settings') . '
'; $output .= '
' . t('The System module also handles basic configuration options for your site, including Date and time settings, File system settings, Site name and other information, and a Maintenance mode for taking your site temporarily offline.', array('@date-time-settings' => \Drupal::url('system.date_format_list'), '@file-system' => \Drupal::url('system.file_system_settings'), '@site-info' => \Drupal::url('system.site_information_settings'), '@maintenance-mode' => \Drupal::url('system.site_maintenance_mode'))) . '
'; - $output .= '
' . t('Providing administrative help') . '
'; - $output .= '
' . t('Page-specific administrative help text that is provided by the System module and other modules is displayed in the System Help block. This block can be placed and configured on the Block layout page.', array('!blocks' => (\Drupal::moduleHandler()->moduleExists('block')) ? \Drupal::url('block.admin_display') : '#')) . '
'; - $output .= ''; $output .= '
' . t('Disabling drag-and-drop functionality') . '
'; $output .= '
' . t('The default drag-and-drop user interface for ordering tables in Drupal presents a challenge for some users, including users of screen readers and other assistive technology. The drag-and-drop interface can be disabled in a table by clicking a link labeled "Show row weights" above the table. The replacement interface allows users to order the table by choosing numerical weights instead of dragging table rows.') . '
'; + $output .= ''; return $output; case 'system.admin_index': diff -u b/core/profiles/standard/config/install/block.block.bartik_help.yml b/core/profiles/standard/config/install/block.block.bartik_help.yml --- b/core/profiles/standard/config/install/block.block.bartik_help.yml +++ b/core/profiles/standard/config/install/block.block.bartik_help.yml @@ -4,10 +4,10 @@ status: true langcode: en region: help -plugin: system_help_block +plugin: contextual_help_block settings: - id: system_help_block - label: 'System Help' + id: contextual_help_block + label: 'Contextual Help' provider: help label_display: '0' dependencies: diff -u b/core/profiles/standard/config/install/block.block.seven_help.yml b/core/profiles/standard/config/install/block.block.seven_help.yml --- b/core/profiles/standard/config/install/block.block.seven_help.yml +++ b/core/profiles/standard/config/install/block.block.seven_help.yml @@ -4,10 +4,10 @@ status: true langcode: en region: help -plugin: system_help_block +plugin: contextual_help_block settings: - id: system_help_block - label: 'System Help' + id: contextual_help_block + label: 'Contextual Help' provider: help label_display: '0' dependencies: only in patch2: unchanged: --- a/core/modules/block/src/Tests/BlockTest.php +++ b/core/modules/block/src/Tests/BlockTest.php @@ -215,7 +215,7 @@ public function testBlockThemeSelector() { */ function testThemeName() { // Enable the help block. - $this->drupalPlaceBlock('system_help_block', array('region' => 'help')); + $this->drupalPlaceBlock('contextual_help_block', array('region' => 'help')); // Explicitly set the default and admin themes. $theme = 'block_test_specialchars_theme'; \Drupal::service('theme_handler')->install(array($theme)); only in patch2: unchanged: --- a/core/modules/forum/src/Tests/ForumTest.php +++ b/core/modules/forum/src/Tests/ForumTest.php @@ -99,7 +99,7 @@ protected function setUp() { 'skip comment approval', 'access comments', )); - $this->drupalPlaceBlock('system_help_block', array('region' => 'help')); + $this->drupalPlaceBlock('contextual_help_block', array('region' => 'help')); } /** only in patch2: unchanged: --- /dev/null +++ b/core/modules/help/help.api.php @@ -0,0 +1,57 @@ +/** + * @file + * Hooks for the Help system. + */ + +/** + * @addtogroup hooks + * @{ + */ + +/** + * Provide online user help. + * + * By implementing hook_help(), a module can make documentation available to + * the user for the module as a whole, or for specific pages. Help for + * developers should usually be provided via function header comments in the + * code, or in special API example files. + * + * The page-specific help information provided by this hook appears in the + * Contextual Help block (provided by the core Help module), if the block is + * displayed on that page. The module overview help information is displayed + * by the Help module. It can be accessed from the page at admin/help or from + * the Extend page. + * + * For detailed usage examples of: + * - Module overview help, see content_translation_help(). Module overview + * help should follow + * @link https://drupal.org/node/632280 the standard help template. @endlink + * - Page-specific help using only routes, see book_help(). + * - Page-specific help using routes and $request, see block_help(). + * + * @param string $route_name + * 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 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, \Drupal\Core\Routing\RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the block module. + case 'help.page.block': + return '

' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Bartik, for example, implements the regions "Sidebar first", "Sidebar second", "Featured", "Content", "Header", "Footer", etc., and a block may appear in any one of these areas. The blocks administration page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('!blocks' => \Drupal::url('block.admin_display'))) . '

'; + + // Help for another path in the block module. + case 'block.admin_display': + return '

' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the Save blocks button at the bottom of the page.') . '

'; + } +} + +/** + * @} End of "addtogroup hooks". + */ only in patch2: unchanged: --- a/core/modules/system/src/Plugin/Block/SystemHelpBlock.php +++ b/core/modules/help/src/Plugin/Block/ContextualHelpBlock.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\system\Plugin\Block\SystemHelpBlock. + * Contains \Drupal\help\Plugin\Block\ContextualHelpBlock. */ -namespace Drupal\system\Plugin\Block; +namespace Drupal\help\Plugin\Block; use Drupal\Core\Block\BlockBase; use Drupal\Core\Extension\ModuleHandlerInterface; @@ -16,14 +16,14 @@ use Symfony\Component\HttpFoundation\Request; /** - * Provides a 'System Help' block. + * Provides a 'Contextual Help' block. * * @Block( - * id = "system_help_block", - * admin_label = @Translation("System Help") + * id = "contextual_help_block", + * admin_label = @Translation("Contextual Help") * ) */ -class SystemHelpBlock extends BlockBase implements ContainerFactoryPluginInterface { +class ContextualHelpBlock extends BlockBase implements ContainerFactoryPluginInterface { /** * Stores the help text associated with the active menu item. @@ -54,7 +54,7 @@ class SystemHelpBlock extends BlockBase implements ContainerFactoryPluginInterfa protected $routeMatch; /** - * Creates a SystemHelpBlock instance. + * Creates a ContextualHelpBlock instance. * * @param array $configuration * A configuration array containing information about the plugin instance. @@ -128,8 +128,8 @@ public function build() { * {@inheritdoc} */ public function defaultConfiguration() { - // Modify the default max age for the System Help block: help text is static - // for a given URL, except when a module is updated, in which case + // Modify the default max age for the Contextual Help block: help text is + // static for a given URL, except when a module is updated, in which case // update.php must be run, which clears all caches. Thus it's safe to cache // the output for this block forever on a per-URL basis. return array('cache' => array('max_age' => \Drupal\Core\Cache\Cache::PERMANENT)); @@ -139,7 +139,7 @@ public function defaultConfiguration() { * {@inheritdoc} */ protected function getRequiredCacheContexts() { - // The "System Help" block must be cached per URL: help is defined for a + // The "Contextual Help" block must be cached per URL: help is defined for a // given path, and does not come with any access restrictions. return array('cache_context.url'); } only in patch2: unchanged: --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -376,49 +376,6 @@ function hook_system_breadcrumb_alter(array &$breadcrumb, \Drupal\Core\Routing\R } /** - * Provide online user help. - * - * By implementing hook_help(), a module can make documentation available to - * the user for the module as a whole, or for specific pages. Help for - * developers should usually be provided via function header comments in the - * code, or in special API example files. - * - * The page-specific help information provided by this hook appears as a system - * help block on that page. The module overview help information is displayed - * by the Help module. It can be accessed from the page at admin/help or from - * the Extend page. - * - * For detailed usage examples of: - * - Module overview help, see content_translation_help(). Module overview - * help should follow - * @link https://drupal.org/node/632280 the standard help template. @endlink - * - Page-specific help using only routes, see book_help(). - * - Page-specific help using routes and $request, see block_help(). - * - * @param string $route_name - * 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 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, \Drupal\Core\Routing\RouteMatchInterface $route_match) { - switch ($route_name) { - // Main module help for the block module. - case 'help.page.block': - return '

' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Bartik, for example, implements the regions "Sidebar first", "Sidebar second", "Featured", "Content", "Header", "Footer", etc., and a block may appear in any one of these areas. The blocks administration page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('!blocks' => \Drupal::url('block.admin_display'))) . '

'; - - // Help for another path in the block module. - case 'block.admin_display': - return '

' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the Save blocks button at the bottom of the page.') . '

'; - } -} - -/** * Prepare a message based on parameters; called from drupal_mail(). * * Note that hook_mail(), unlike hook_mail_alter(), is only called on the only in patch2: unchanged: --- a/core/profiles/standard/src/Tests/StandardTest.php +++ b/core/profiles/standard/src/Tests/StandardTest.php @@ -48,7 +48,7 @@ function testStandard() { $this->drupalGet(''); $this->assertText('Main navigation'); - // Verify we have role = aria on system_powered_by and system_help_block + // Verify we have role = aria on system_powered_by and contextual_help_block // blocks. $this->drupalGet('admin/structure/block'); $elements = $this->xpath('//div[@role=:role and @id=:id]', array(