quick_start-8.x-1.0-beta10/modules/quick_features/quick_v_heroslider_media/quick_v_heroslider_media.install

modules/quick_features/quick_v_heroslider_media/quick_v_heroslider_media.install
<?php

/**
 * @file
 * Install, update and uninstall functions for the quick v hero slider media.
 */

/**
 * Implements hook_requirements().
 */
function quick_v_heroslider_media_requirements($phase) {

  $requirements = [];

  $path = DRUPAL_ROOT . '/libraries/slick/slick/slick.min.js';

  // Is the library found in the root libraries path.
  $library_found = file_exists($path);

  // If library is not found, then look in the current profile libraries path.
  if (!$library_found) {
    $profile_path = drupal_get_path('profile', drupal_get_profile());
    $profile_path .= '/libraries/slick/slick/slick.min.js';
    // Is the library found in the current profile libraries path.
    $library_found = file_exists($profile_path);
  }

  if (!$library_found) {
    $requirements['slick_library'] = [
      'title' => t('Slick library missing'),
      'description' => t('Media Hero Slider requires the slick.min.js library.
        Download it (https://github.com/kenwheeler/slick) and place it in the
        libraries folder (/libraries)'),
      'severity' => REQUIREMENT_ERROR,
    ];
  }

  return $requirements;
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc