You are here

extlink.install in External Links 8

Same filename and directory in other branches
  1. 6 extlink.install
  2. 7 extlink.install

Install hook for the External Links module.

File

extlink.install
View source
<?php

/**
 * @file
 * Install hook for the External Links module.
 */

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

  // Weight needs to be 1 for compatibility with SpamSpan.
  module_set_weight('extlink', 1);
}

/**
 * Add extlink and mailto icon labels to the default configuration.
 */
function extlink_update_8101() {
  $config_factory = \Drupal::configFactory();
  $config = $config_factory
    ->getEditable('extlink.settings');
  $config
    ->set('extlink_label', '(link is external)');
  $config
    ->set('extlink_mailto_label', '(link sends email)');
  $config
    ->save(TRUE);
}

/**
 * Add extlink_exclude_admin_routes to the default configuration.
 */
function extlink_update_8102() {
  \Drupal::configFactory()
    ->getEditable('extlink.settings')
    ->set('extlink_exclude_admin_routes', FALSE)
    ->save();
}

Functions

Namesort descending Description
extlink_install Implements hook_install().
extlink_update_8101 Add extlink and mailto icon labels to the default configuration.
extlink_update_8102 Add extlink_exclude_admin_routes to the default configuration.