ckeditor_bootstrap_buttons.install in CKEditor Bootstrap Buttons 8
Same filename and directory in other branches
Install, requirements functions for the ckeditor_bootstrap_buttons module.
File
ckeditor_bootstrap_buttons.installView source
<?php
/**
* @file
* Install, requirements functions for the ckeditor_bootstrap_buttons module.
*/
/**
* Implements hook_requirements().
*/
function ckeditor_bootstrap_buttons_requirements($phase) {
$requirements = [];
$path = DRUPAL_ROOT . '/libraries/btbutton/plugin.js';
if (\Drupal::moduleHandler()
->moduleExists('libraries')) {
$path = libraries_get_path('btbutton') . '/plugin.js';
}
// Is the library found in the root libraries path.
$library_found = file_exists($path);
if (!$library_found) {
$requirements['ckeditor_bootstrap_buttons'] = [
'title' => t('CKEditor Bootstrap Buttons library missing'),
'description' => t('CKEditor Bootstrap Buttons requires the btbutton library.
Download it (https://github.com/smonetti/btbutton) and place it in the
libraries folder (/libraries)'),
'severity' => REQUIREMENT_ERROR,
];
}
return $requirements;
}
Functions
Name | Description |
---|---|
ckeditor_bootstrap_buttons_requirements | Implements hook_requirements(). |