You are here

auto_menutitle.install in Auto Menu Title 8

Same filename and directory in other branches
  1. 6.2 auto_menutitle.install
  2. 7 auto_menutitle.install

Install, update and uninstall functions for the auto_menutitle module.

File

auto_menutitle.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the auto_menutitle module.
 */

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

  // Set this module's weight to one higher than that of the menu_ui module.
  $weight = \Drupal::config('core.extension')
    ->get("module.menu_ui");
  module_set_weight('auto_menutitle', $weight + 1);
}

/**
 * Implements hook_uninstall().
 */
function auto_menutitle_uninstall() {

  // Delete variables.
  $node_types = array_keys(node_type_get_types());
  foreach ($node_types as $node_type) {
    \Drupal::state()
      ->delete('auto_menutitle_' . $node_type);
  }
}

Functions