You are here

uikit_components.module in UIkit Components 8.2

UIkit Components.

Companion module to the UIkit base theme to provide additional components and functionality.

File

uikit_components.module
View source
<?php

/**
 * @file
 * UIkit Components.
 *
 * Companion module to the UIkit base theme to provide additional components and
 * functionality.
 */
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\uikit_components\UIkitComponents;
module_load_include('inc', 'uikit_components', 'includes/alter');
module_load_include('inc', 'uikit_components', 'includes/preprocess');

/**
 * Implements hook_help().
 */
function uikit_components_help($route_name, RouteMatchInterface $route_match) {
  $output = '';
  switch ($route_name) {
    case 'help.page.uikit_components':
      $output = '<p>' . t('The UIkit components module provides additional components and functionality to the UIkit base theme and various Drupal core modules. Some aspects of the frontend cannot be themed without going through the backend, such as empty navbar links. With this module we can add more functionality to the UIkit frontend through the Drupal backend without the need for contributed modules which may add more functionality than needed.') . '</p>';
      break;
    case 'uikit_components.admin':
      $output = '<p>' . t('Configuration for the UIkit Components module.') . '</p>';
      break;
    case 'uikit_components.core':
      $output = '<p>' . t('UIkit offers over 30 modular and extendible components, which can be combined with each other. Components are divided into different compartments according to their purpose and functionality. This form allows you to control how some of these components are used.') . '</p>';
      break;
    case 'uikit_components.advanced':
      $output = '<p>' . t("UIkit offers some advanced components that are not included in the UIkit core framework. Usually you wouldn't use these components in your everyday website. They include stuff like nestables and datepickers, which will come in handy, if you create advanced user interfaces like administration areas. This form allows you to control how some of these components are used.") . '</p>';
      break;
  }
  return $output;
}

/**
 * Implements hook_theme().
 */
function uikit_components_theme($existing, $type, $theme, $path) {
  $path = drupal_get_path('module', 'uikit_components') . '/templates';
  return [
    'menu__uk_list' => [
      'path' => "{$path}/navigation",
      'template' => 'menu--uk-list',
    ],
    'menu__uk_nav' => [
      'path' => "{$path}/navigation",
      'template' => 'menu--uk-nav',
    ],
    'menu__uk_subnav' => [
      'path' => "{$path}/navigation",
      'template' => 'menu--uk-subnav',
    ],
  ];
}

Functions

Namesort descending Description
uikit_components_help Implements hook_help().
uikit_components_theme Implements hook_theme().