You are here

wysiwyg_mediaembed.install in Wysiwyg Media Embed 8

File

wysiwyg_mediaembed.install
View source
<?php

/**
 * @file
 * Contains wysiwyg_mediaembed.install.
 */

/**
 * Implements hook_requirements().
 */
function wysiwyg_mediaembed_requirements($phase) {
  $requirements = [];
  $path = 'libraries/mediaembed/plugin.js';
  $path = DRUPAL_ROOT . '/' . $path;
  if (!file_exists($path)) {
    $requirements['wysiwyg_mediaembed'] = [
      'title' => t('mediaembed library is missing'),
      'value' => t('Plugin not detected'),
      'severity' => REQUIREMENT_ERROR,
      'description' => t('wysiwyg_mediaembed requires the plugin.js library.
       Download the plugin from https://ckeditor.com/addon/mediaembed
       version 0.7, and place it in the libraries folder
       (/libraries/mediaembed)'),
    ];
  }
  else {
    $requirements['wysiwyg_mediaembed'] = [
      'title' => t('CKEditor mediaembed'),
      'value' => t('Plugin detected'),
      'severity' => REQUIREMENT_OK,
    ];
  }
  return $requirements;
}

Functions