freelinking-8.x-3.x-dev/freelinking.module

freelinking.module
<?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],
    ],
  ];
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc