You are here

ckeditor_bidi.install in CKEditor BiDi Buttons 8

Install, update and uninstall functions for the CKEditor BiDi Buttons module.

File

ckeditor_bidi.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the CKEditor BiDi Buttons module.
 */

/**
 * Implements hook_requirements().
 */
function ckeditor_bidi_requirements($phase) {
  $requirements = [];
  $path = DRUPAL_ROOT . '/libraries/bidi/plugin.js';
  if (\Drupal::moduleHandler()
    ->moduleExists('libraries')) {
    $path = libraries_get_path('bidi') . '/plugin.js';
  }
  if (!file_exists($path)) {
    $requirements['bidi_library'] = [
      'title' => t('CKEditor\'s BiDi (Text Direction) plugin library is missing'),
      'description' => t('"CKEditor BiDi Buttons" requires the plugin "BiDi (Text Direction)". <br>
                                Please go and download version 4.6.2 of the BiDi plugin at: <br>
                                 http://ckeditor.com/addon/bidi <br>
                                 Then, place it in  /libraries directory of your installation.<br>
                                 For more detailes see see README.txt of the module.'),
      'severity' => REQUIREMENT_ERROR,
    ];
  }
  return $requirements;
}

Functions