You are here

onomasticon.module in Onomasticon 2.x

Same filename and directory in other branches
  1. 8 onomasticon.module

Custom filter to add glossary information to words.

File

onomasticon.module
View source
<?php

use Drupal\Core\Routing\RouteMatchInterface;

/**
 * @file
 * Custom filter to add glossary information to words.
 */

/**
 * Implements hook_help().
 */
function onomasticon_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.onomasticon':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('Custom filter to add glossary information to words.</p>');
      $output .= '<h3>' . t('Usage') . '</h3>';
      $output .= '<ol>';
      $output .= '<li>' . t('Create a taxonomy list.') . '</li>';
      $output .= '<li>' . t('Go to the settings of a text format of your choice from <a href="/admin/config/content/formats">/admin/config/content/formats</a>.') . '</li>';
      $output .= '<li>' . t('Enable Onomasticon Filter and scroll down to edit the filter\'s settings. The only mandatory setting is the vocabulary to use, all other settings have defaults built into the module.') . '</li>';
      $output .= '</ol>';
      return $output;
  }
}

/**
 * Implements hook_theme().
 */
function onomasticon_theme($existing, $type, $theme, $path) {
  return [
    'onomasticon' => [
      'template' => 'onomasticon',
      'variables' => [
        'tag' => NULL,
        'needle' => NULL,
        'description' => NULL,
        'implement' => NULL,
        'orientation' => NULL,
        'cursor' => NULL,
        'termlink' => NULL,
        'termpath' => NULL,
      ],
    ],
  ];
}

Functions

Namesort descending Description
onomasticon_help Implements hook_help().
onomasticon_theme Implements hook_theme().