You are here

navigation404.install in 404 Navigation 8

Same filename and directory in other branches
  1. 7 navigation404.install

install file.

File

navigation404.install
View source
<?php

/**
 * @file install file.
 */

/**
 * Implements hook_install().
 *
 * If site_404 is not set, all menu-related items disappear on 404.
 */
function navigation404_install() {
  if (!Drupal::config('system.site')
    ->get('page.404')) {
    Drupal::config('system.site')
      ->set('page.404', NAVIGATION404_PAGE)
      ->save();
  }
}

/**
 * Implements hook_uninstall().
 */
function navigation404_uninstall() {
  if (Drupal::config('system.site')
    ->get('page.404') == NAVIGATION404_PAGE) {
    Drupal::config('system.site')
      ->delete('page.404');
  }
}

Functions