summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Stjerneman2016-07-22 04:55:42 (GMT)
committerEmil Stjerneman2016-07-22 04:55:42 (GMT)
commitdc12ee4568dc326d3bc3e252390a9b68a436260f (patch)
tree556954e9888bc99ba46443bff813329034ceaf35
parent7e80ae23954f36c8f45952453c76886a8b2d96e7 (diff)
by anon: Added help text
-rw-r--r--linkit.module28
-rw-r--r--src/Form/Matcher/OverviewForm.php2
-rw-r--r--tests/src/Kernel/EntityMatcherDeriverTest.php6
3 files changed, 29 insertions, 7 deletions
diff --git a/linkit.module b/linkit.module
index c073d26..2920c70 100644
--- a/linkit.module
+++ b/linkit.module
@@ -6,9 +6,37 @@
*/
use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
/**
+ * Implements hook_help().
+ */
+function linkit_help($route_name, RouteMatchInterface $route_match) {
+ switch ($route_name) {
+ case 'help.page.linkit':
+ $output = '';
+ $output .= '<h3>' . t('About') . '</h3>';
+ $output .= '<p>' . t('The Linkit module provides an easy interface for internal and external linking with wysiwyg editors by using an autocomplete field.') . '</p>';
+ $output .= '<h3>' . t('Uses') . '</h3>';
+ $output .= '<dl>';
+ $output .= '<dt>' . t('Managing Linkit profiles') . '</dt>';
+ $output .= '<dd>' . t('You can create and edit Linkit profiles on the <a href=":profiles">Linkit profile page</a>. You can create a Linkit profile by clicking "<a href=":add_profile">Add profile</a>".', [':profiles' => Url::fromRoute('entity.linkit_profile.collection')->toString(), ':add_profile' => Url::fromRoute('entity.linkit_profile.add_form')->toString()]) . '</dd>';
+ $output .= '</dl>';
+ return $output;
+
+ case 'entity.linkit_profile.collection':
+ $output = '<p>' . t('Linkit profiles define how Linkit will operate on fields that have Linkit attached.') . '</p>';
+ $output .= '<p>' . t('The most common way to use Linkit is to enable Linkit on the Drupal Link plugin and associate a Linkit profile to it on a Text format.') . '</p>';
+ return $output;
+
+ case 'linkit.matchers':
+ $output = '<p>' . t('Matchers defines how different data can be queried and displayed in the autocomplete suggestion list. Multiple matchers of the same type can be used at the same time to granulate the suggestions. The order of the added matchers defines in which order the suggestions will be presented.') . '</p>';
+ return $output;
+ }
+}
+
+/**
* Implements hook_ckeditor_plugin_info_alter().
*/
function linkit_ckeditor_plugin_info_alter(array &$plugins) {
diff --git a/src/Form/Matcher/OverviewForm.php b/src/Form/Matcher/OverviewForm.php
index 72ca6b0..0fb85e5 100644
--- a/src/Form/Matcher/OverviewForm.php
+++ b/src/Form/Matcher/OverviewForm.php
@@ -65,7 +65,7 @@ class OverviewForm extends FormBase {
'#type' => 'table',
'#header' => [
[
- 'data' => $this->t('Matcher'),
+ 'data' => $this->t('Matchers'),
'colspan' => 2,
],
$this->t('Weight'),
diff --git a/tests/src/Kernel/EntityMatcherDeriverTest.php b/tests/src/Kernel/EntityMatcherDeriverTest.php
index fc921c0..cf3832a 100644
--- a/tests/src/Kernel/EntityMatcherDeriverTest.php
+++ b/tests/src/Kernel/EntityMatcherDeriverTest.php
@@ -2,12 +2,6 @@
namespace Drupal\Tests\linkit\Kernel;
-use Drupal\Core\Menu\MenuTreeParameters;
-use Drupal\Core\StringTranslation\TranslatableMarkup;
-use Drupal\menu_link_content\Entity\MenuLinkContent;
-use Drupal\KernelTests\KernelTestBase;
-use Symfony\Component\Routing\Route;
-
/**
* Tests the entity matcher deriver.
*