<?php /** * @file * CKEditor IndentBlock install file. */ /** * Implements hook_requirements(). */ function ckeditor_indentblock_requirements($phase) { $requirements = []; if ($phase == 'install' || $phase == 'runtime') { if (!function_exists('libraries_get_path')) { module_load_include('module', 'libraries'); } $plugin_path = libraries_get_path('indentblock') . '/plugin.js'; $plugin_detected = file_exists($plugin_path); if ($plugin_detected) { $requirements['indentblock'] = [ 'title' => t('CKEditor IndentBlock'), 'value' => t('Plugin detected'), 'severity' => REQUIREMENT_OK, ]; } else { $requirements['indentblock'] = [ 'title' => t('CKEditor IndentBlock'), 'value' => t('Plugin not detected'), 'severity' => REQUIREMENT_ERROR, 'description' => t('You will need to install the "Indent Block" CKEditor plugin under the libraries path before enabling this module. <a href=":plugin_url">Get the plugin from CKEditor.com</a>.', [':plugin_url' => 'http://ckeditor.com/addon/indentblock']), ]; } } return $requirements; }