You are here

fractionslider.module in Views FractionSlider 8

Same filename and directory in other branches
  1. 7.2 fractionslider.module

Module file for fractionslider.

File

fractionslider.module
View source
<?php

/**
 * @file
 * Module file for fractionslider.
 */

/**
 * Implements hook_page_attachments().
 */
function fractionslider_page_attachments(array &$attachments) {
  $attachments['#attached']['library'][] = 'fractionslider/global-styles-and-scripts';
  $configs = array(
    'controls' => Drupal::state()
      ->get('fractionslider_controls'),
    'pager' => Drupal::state()
      ->get('fractionslider_pager'),
    'dimensions' => Drupal::state()
      ->get('fractionslider_dimensions'),
    'fullwidth' => Drupal::state()
      ->get('fractionslider_fullwidth'),
    'responsive' => Drupal::state()
      ->get('fractionslider_responsive'),
    'increase' => Drupal::state()
      ->get('fractionslider_increase'),
    'pausehover' => Drupal::state()
      ->get('fractionslider_pausehover'),
  );
  $attachments['#attached']['drupalSettings']['fractionslider'] = $configs;
}

/**
 * Implements hook_requirements().
 */
function fractionslider_requirements($phase) {
  $requirements = [];
  if ($phase == 'runtime') {
    $requirements['fractionslider'] = [
      'title' => t('Fractionslider'),
      'value' => '1.0',
      'severity' => REQUIREMENT_OK,
    ];
  }
  return $requirements;
}