HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.2.34
System: Linux atalantini.com 3.10.0-1127.13.1.el7.x86_64 #1 SMP Tue Jun 23 15:46:38 UTC 2020 x86_64
User: root (0)
PHP: 7.2.34
Disabled: NONE
Upload Files
File: /var/www/html/coreplad/sites/all/modules/adminimal_admin_menu/adminimal_admin_menu.install
<?php

/**
 * @file
 * Performs installation functions.
 */

/**
 * Implements hook_enable().
 */
function adminimal_admin_menu_enable() {

  // Check if core "toolbar" module is enabled.
  if (module_exists('toolbar')) {

    // Disable the core "toolbar" module to avoid double menu rendering.
    module_disable(array('toolbar'), FALSE);

    // Display message to the administrator that the module is disabled.
    drupal_set_message(t('<strong>Administration menu Adminimal Theme</strong> module successfully enabled!<br />The core "Toolbar" module was automatically disabled to avoid double menu rendering. Disabling the Adminimal menu module will automatically re-enable the core toolbar module, so you have nothing to worry about.'), 'status');

    // Let the database know that the module was disabled.
    variable_set('adminimal_admin_menu_core-toolbar-disabled', TRUE);

  }

  // Check if Admin Toolbar theme is enabled.
  if (module_exists('admin_menu_toolbar')) {

    // Disable the admin menu toolbar theme to avoid style issues.
    module_disable(array('admin_menu_toolbar'), FALSE);

    // Display message to the administrator that the module is disabled.
    drupal_set_message(t('<strong>Administration menu Adminimal Theme</strong> module successfully enabled!<br />Your old Administration menu Toolbar theme was automatically disabled to avoid styling issues. Disabling the Adminimal menu module will automatically re-enable your old toolbar theme, so you have nothing to worry about.'), 'status');

    // Let the database know that the module was disabled.
    variable_set('adminimal_admin_menu_toolbar-disabled', TRUE);

  }
}

/**
 * Implements hook_disable().
 */
function adminimal_admin_menu_disable() {

  // Check if core "Toolbar" module was disabled by adminimal menu.
  if (variable_get('adminimal_admin_menu_core-toolbar-disabled', FALSE)) {

    // If true, re-enable the "Administration menu Toolbar style" module.
    module_enable(array('toolbar'), FALSE);

    // Display message to the administrator that the module is disabled.
    drupal_set_message(t('<strong>Administration menu Adminimal Theme</strong> module successfully disabled!<br />The core "Toolbar" module  was automatically re-enabled.'), 'status');

  }

  // Check if "Administration menu Toolbar style" was disabled by this module.
  if (variable_get('adminimal_admin_menu_toolbar-disabled', FALSE)) {

    // If true, re-enable the "Administration menu Toolbar style" module.
    module_enable(array('admin_menu_toolbar'), FALSE);

    // Display message to the administrator that the module is disabled.
    drupal_set_message(t('<strong>Administration menu Adminimal Theme</strong> module successfully disabled!<br />The old Toolbar theme was automatically re-enabled.'), 'status');

  }
}

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

  // Clean up the module variables from database after uninstall.
  variable_del('adminimal_admin_menu_toolbar-disabled');
  variable_del('adminimal_admin_menu_core-toolbar-disabled');
  variable_del('adminimal_admin_menu_render');

}

/**
 * Clean up some files that are no longer needed.
 */
function adminimal_admin_menu_update_7100() {

  // Define Adminimal Menu path.
  $module_path = drupal_get_path('module', 'adminimal_admin_menu');

  if (file_exists($module_path . '/adminimal_admin_menu.js')) {
    // Delete the "adminimal_admin_menu.js" file.
    file_unmanaged_delete($module_path . '/adminimal_admin_menu.js');
  }

  if (file_exists($module_path . '/slicknav')) {
    // Empty the "slicknav" folder.
    file_unmanaged_delete_recursive($module_path . '/slicknav');

    // Delete the "slicknav" folder.
    drupal_rmdir($module_path . '/slicknav');
  }
}