You are here

beautytips.install in BeautyTips 8

Same filename and directory in other branches
  1. 6.2 beautytips.install
  2. 6 beautytips.install
  3. 7.2 beautytips.install

BeautyTips install/uninstall hooks.

File

beautytips.install
View source
<?php

/**
 * @file
 * BeautyTips install/uninstall hooks.
 */
use Drupal\Core\Cache\Cache;
use Drupal\Core\Url;
use Drupal\Core\Link;

/**
 * Implements hook_install().
 */
function beautytips_install() {

  // Display IE warning.
  $path = drupal_get_path('module', 'beautytips');
  $url = Url::fromUserInput('/' . $path . '/README.txt');
  $link_readme = Link::fromTextAndUrl(t('BeautyTips Readme.txt'), $url)
    ->toString();
  if (!file_exists($path . '/other_libs/excanvas_r3/excanvas.compiled.js')) {
    \Drupal::messenger()
      ->addMessage(t('WARNING! In order for BeautyTips to function correctly in Internet Explorer, the Excanvas library needs to be added. (See the @readme_file for more information.)', [
      '@readme_file' => $link_readme,
    ]), 'warning');
  }
}

/**
 * Implements hook_uninstall().
 */
function beautytips_uninstall() {
  \Drupal::configFactory()
    ->getEditable('beautytips.basic')
    ->delete();
  Cache::invalidateTags([
    'beautytips',
  ]);
}

Functions

Namesort descending Description
beautytips_install Implements hook_install().
beautytips_uninstall Implements hook_uninstall().