You are here

cheeseburger_menu.module in Cheeseburger Menu 8.2

Cheesebugers module file.

File

cheeseburger_menu.module
View source
<?php

/**
 * @file
 * Cheesebugers module file.
 */
use Drupal\Core\Routing\RouteMatchInterface;

/**
 * Implements hook_theme().
 */
function cheeseburger_menu_theme($existing, $type, $theme, $path) {
  return [
    'hierarchical_menu' => [
      'variables' => [
        'menu_tree' => [],
        'route_id' => 0,
        'page_type' => 'unknown',
        'title' => '',
        'machine_name' => '',
        'current_url' => '',
        'block_id' => '',
        'active' => [],
      ],
    ],
    'hierarchical_navigation' => [
      'variables' => [
        'tree' => [],
      ],
    ],
  ];
}

/**
 * Implements hook_page_attachments().
 */
function cheeseburger_menu_page_attachments(array &$page) {
  $page['#attached']['library'][] = 'cheeseburger_menu/cheeseburger_menu.js';
}

/**
 * Implements hook_help().
 */
function cheeseburger_menu_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.cheeseburger_menu':
      $output = '';
      $output .= '<h2>INTRODUCTION</h2>';
      $output .= '<p>The Cheeseburger Menu module can display system menu and Taxonomy terms. You can choose what you want to display and on which devices. If you are the using Commerce module you can also choose to show cart and phone buttons. </p>';
      $output .= '<h2>REQUIREMENTS</h2>';
      $output .= '<p>This module requires only the core modules. If you want to use Commerce features you should install Commerce Store.</p>';
      $output .= '<h2>INSTALLATION</h2>';
      $output .= '<p>Install as you would normally install a contributed Drupal module. Visit:' . 'https://drupal.org/documentation/install/modules-themes/modules-8' . 'for further information.</p>';
      $output .= '<h2>CONFIGURATION</h2>';
      $output .= '<p>This module requires only the core modules. If you want to use Commerce features you should install Commerce Store.</p>';
      $output .= '<p>In block configuration:</p>';
      $output .= '<ul><li>First check menus and taxonomies you want to display</li>';
      $output .= '<li>Choose their weight to order them as you want</li>';
      $output .= '<li>Also choose the site header height and menu title padding</li>';
      $output .= '<li>Enable breakpoints. Choose on which devices you want to display the menu.' . 'This is based on breakpoints from your default theme. So if you want to change it,' . 'make your changes in default_theme_name.breakpoints.yml</li></ul>';
      return $output;
  }
}