Commit 867dd1f0 authored by larowlan's avatar larowlan

Issue #3087496 by jhodgdon, andypost, Amber Himes Matz: Change prefixes of...

Issue #3087496 by jhodgdon, andypost, Amber Himes Matz: Change prefixes of Help Topics machine names to help and make sure APIs are marked @internal
parent 89e11e4d
......@@ -15,6 +15,11 @@
*
* @param array $info
* Array of help topic plugin definitions keyed by their plugin ID.
*
* @internal
* Help Topics is currently experimental and should only be leveraged by
* experimental modules and development releases of contributed modules.
* See https://www.drupal.org/core/experimental for more information.
*/
function hook_help_topics_info_alter(array &$info) {
// Alter the help topic to be displayed on admin/help.
......
......@@ -34,7 +34,7 @@ function help_topics_help($route_name, RouteMatchInterface $route_match) {
$output .= '</dl>';
return ['#markup' => $output];
case 'help_topics.help_topic':
case 'help.help_topic':
$help_home = Url::fromRoute('help.main')->toString();
return '<p>' . t('See the <a href=":help_page">Help page</a> for more topics.', [
':help_page' => $help_home,
......
help_topics.help_topic:
help.help_topic:
path: '/admin/help/topic/{id}'
defaults:
_controller: '\Drupal\help_topics\Controller\HelpTopicPluginController::viewHelpTopic'
......
services:
help_topics.breadcrumb:
help.breadcrumb:
class: Drupal\help_topics\HelpBreadcrumbBuilder
arguments: ['@string_translation']
tags:
......@@ -8,14 +8,14 @@ services:
plugin.manager.help_topic:
class: Drupal\help_topics\HelpTopicPluginManager
arguments: ['@module_handler', '@theme_handler', '@cache.discovery']
help_topics.twig.loader:
help.twig.loader:
class: Drupal\help_topics\HelpTopicTwigLoader
arguments: ['@app.root', '@module_handler', '@theme_handler']
# Lowest core priority because loading help topics is not the usual case.
tags:
- { name: twig.loader, priority: -200 }
public: false
help_topics.plugin.manager.help_section:
plugin.manager.help_section_topics:
class: Drupal\help_topics\HelpSectionManager
decorates: plugin.manager.help_section
parent: plugin.manager.help_section
......
......@@ -62,7 +62,7 @@ public static function create(ContainerInterface $container) {
*
* @param string $id
* The plugin ID. Maps to the {id} placeholder in the
* help_topics.help_topic route.
* help.help_topic route.
*
* @return array
* A render array with the contents of a help topic page.
......@@ -91,7 +91,7 @@ public function viewHelpTopic($id) {
$topic = $this->helpTopicPluginManager->createInstance($other_id);
$links[$other_id] = [
'title' => $topic->getLabel(),
'url' => Url::fromRoute('help_topics.help_topic', ['id' => $other_id]),
'url' => Url::fromRoute('help.help_topic', ['id' => $other_id]),
];
$this->renderer->addCacheableDependency($build, $topic);
}
......
......@@ -13,7 +13,7 @@
* Provides a breadcrumb builder for help topic pages.
*
* @internal
* Help Topic is currently experimental and should only be leveraged by
* Help Topics is currently experimental and should only be leveraged by
* experimental modules and development releases of contributed modules.
* See https://www.drupal.org/core/experimental for more information.
*/
......@@ -35,7 +35,7 @@ public function __construct(TranslationInterface $string_translation) {
* {@inheritdoc}
*/
public function applies(RouteMatchInterface $route_match) {
return $route_match->getRouteName() == 'help_topics.help_topic';
return $route_match->getRouteName() == 'help.help_topic';
}
/**
......
......@@ -7,6 +7,11 @@
/**
* Decorates the Help Section plugin manager to provide help topic search.
*
* @internal
* Help Topics is currently experimental and should only be leveraged by
* experimental modules and development releases of contributed modules.
* See https://www.drupal.org/core/experimental for more information.
*/
class HelpSectionManager extends CoreHelpSectionManager {
......
......@@ -18,7 +18,7 @@
* @see \Drupal\help_topics\HelpTopicTwigLoader
*
* @internal
* Help Topic is currently experimental and should only be leveraged by
* Help Topics is currently experimental and should only be leveraged by
* experimental modules and development releases of contributed modules.
* See https://www.drupal.org/core/experimental for more information.
*/
......
......@@ -10,7 +10,7 @@
* Base class for help topic plugins.
*
* @internal
* Help Topic is currently experimental and should only be leveraged by
* Help Topics is currently experimental and should only be leveraged by
* experimental modules and development releases of contributed modules.
* See https://www.drupal.org/core/experimental for more information.
*/
......@@ -48,7 +48,7 @@ public function getRelated() {
* {@inheritdoc}
*/
public function toUrl(array $options = []) {
return Url::fromRoute('help_topics.help_topic', ['id' => $this->getPluginId()], $options);
return Url::fromRoute('help.help_topic', ['id' => $this->getPluginId()], $options);
}
/**
......@@ -58,7 +58,7 @@ public function toLink($text = NULL, array $options = []) {
if (!$text) {
$text = $this->getLabel();
}
return Link::createFromRoute($text, 'help_topics.help_topic', ['id' => $this->getPluginId()], $options);
return Link::createFromRoute($text, 'help.help_topic', ['id' => $this->getPluginId()], $options);
}
}
......@@ -12,7 +12,7 @@
* @see \Drupal\help_topics\HelpTopicPluginManager
*
* @internal
* Help Topic is currently experimental and should only be leveraged by
* Help Topics is currently experimental and should only be leveraged by
* experimental modules and development releases of contributed modules.
* See https://www.drupal.org/core/experimental for more information.
*/
......
......@@ -62,7 +62,7 @@
* @see \Drupal\Component\Plugin\Derivative\DeriverInterface
*
* @internal
* Help Topic is currently experimental and should only be leveraged by
* Help Topics is currently experimental and should only be leveraged by
* experimental modules and development releases of contributed modules.
* See https://www.drupal.org/core/experimental for more information.
*/
......
......@@ -8,7 +8,7 @@
* Defines an interface for managing help topics and storing their definitions.
*
* @internal
* Help Topic is currently experimental and should only be leveraged by
* Help Topics is currently experimental and should only be leveraged by
* experimental modules and development releases of contributed modules.
* See https://www.drupal.org/core/experimental for more information.
*/
......
......@@ -15,7 +15,7 @@
* @see \Drupal\help_topics\HelpTopicPluginManager
*
* @internal
* Help Topic is currently experimental and should only be leveraged by
* Help Topics is currently experimental and should only be leveraged by
* experimental modules and development releases of contributed modules.
* See https://www.drupal.org/core/experimental for more information.
*/
......
......@@ -20,7 +20,7 @@
* @see \Drupal\help_topics\HelpTopicTwig
*
* @internal
* Help Topic is currently experimental and should only be leveraged by
* Help Topics is currently experimental and should only be leveraged by
* experimental modules and development releases of contributed modules.
* See https://www.drupal.org/core/experimental for more information.
*/
......
......@@ -37,7 +37,7 @@
* )
*
* @internal
* Help Topic is currently experimental and should only be leveraged by
* Help Topics is currently experimental and should only be leveraged by
* experimental modules and development releases of contributed modules.
* See https://www.drupal.org/core/experimental for more information.
*/
......
......@@ -10,7 +10,7 @@
* @see \Drupal\help\HelpSectionPluginInterface
*
* @internal
* Help Topic is currently experimental and should only be leveraged by
* Help Topics is currently experimental and should only be leveraged by
* experimental modules and development releases of contributed modules.
* See https://www.drupal.org/core/experimental for more information.
*/
......
......@@ -5,7 +5,7 @@ related:
- help_topics_test.linked
- does_not_exist.and_no_error
---
{% set help_topic_url = render_var(url('help_topics.help_topic', {id: 'help_topics_test.additional'})) %}
{% set help_topic_url = render_var(url('help.help_topic', {id: 'help_topics_test.additional'})) %}
<p>{% trans %}This is a test. It should <a href="{{ help_topic_url }}">link to the additional topic</a>. Also there should be a related topic link below to the Help module topic page and the linked topic.{% endtrans %}</p>
<p>{% trans %}Nonworditem totranslate.{% endtrans %}</p>
<p>{% trans %}Test translation.{% endtrans %}</p>
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