freelinking.module in Freelinking 4.0.x
Same filename and directory in other branches
Provides flexible, extensible, wiki-style linking of content.
File
freelinking.moduleView source
<?php
/**
* @file
* Provides flexible, extensible, wiki-style linking of content.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function freelinking_help($route_name, RouteMatchInterface $route_match) {
$hint = '';
if ($route_name === 'help.page.freelinking') {
if (\Drupal::hasService('advanced_help_hint.gethint')) {
/** @var \Drupal\advanced_help_hint\Hint $hintService */
$hintService = \Drupal::service('advanced_help_hint.gethint');
$hint = '<p>' . $hintService
->produceHint('freelinking', 'https://www.drupal.org/docs/8/modules/freelinking', TRUE) . '</p>';
}
return '<p>' . t('This module is a filter to turn wiki-style links into HTML links.') . '</p>' . $hint;
}
}
/**
* Implements hook_theme().
*/
function freelinking_theme() {
return [
'freelink_error' => [
'variables' => [
'plugin' => NULL,
'message' => NULL,
'target' => NULL,
'attributes' => [],
],
],
'freelink' => [
'variables' => [
'link' => NULL,
'attributes' => NULL,
],
],
];
}
Functions
Name | Description |
---|---|
freelinking_help | Implements hook_help(). |
freelinking_theme | Implements hook_theme(). |