You are here

glyphicons.install in CKEditor Bootstrap Glyphicon 8

Check requirements for the CKEditor Bootstrap Glyphicon module.

File

glyphicons.install
View source
<?php

/**
 * @file
 * Check requirements for the CKEditor Bootstrap Glyphicon module.
 */

/**
 * Implements hook_requirements().
 */
function glyphicons_requirements($phase) {
  $requirements = [];
  $path = \Drupal::service('library.libraries_directory_file_finder')
    ->find('glyphicons/plugin.js');
  if (!file_exists($path)) {
    $requirements['glyphicons'] = [
      'title' => t('CKEditor Bootstrap Glyphicon'),
      'value' => t('Plugin not detected'),
      'severity' => REQUIREMENT_ERROR,
      'description' => t('CKEditor Bootstrap Glyphicon requires the plugin.js
       library. Download the plugin from http://ckeditor.com/addon/glyphicons
       at least version 2.2, and place it in the libraries folder
       (/libraries/glyphicons)'),
    ];
  }
  else {
    $requirements['glyphicons'] = [
      'title' => t('CKEditor Bootstrap Glyphicong'),
      'value' => t('Plugin detected'),
      'severity' => REQUIREMENT_OK,
    ];
  }
  return $requirements;
}

Functions

Namesort descending Description
glyphicons_requirements Implements hook_requirements().