summaryrefslogtreecommitdiffstats
path: root/floating_menu.module
blob: d7abe8dd03c14a40415ef9f9cd22628bb2c47f8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

/**
 * @file
 * This is the main module file for Floating Menu.
 */

/**
 * Implements hook_theme().
 */
function floating_menu_theme($existing, $type, $theme, $path) {
  return [
    'floating_menu_block' => [
      'variables' => [
        'menu_items' => NULL,
      ],
    ],
  ];
}

/**
 * Implements hook_help().
 */
function floating_menu_help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.floating_menu':
      $path = drupal_get_path('module', 'floating_menu');
      $output = file_get_contents($path . '/README.txt');
      $output = str_replace("\n", '<br>', $output);
      return $output;
  }
}