You are here

function adminimal_admin_menu_enable in Adminimal Administration Menu 7.2

Same name and namespace in other branches
  1. 7 adminimal_admin_menu.install \adminimal_admin_menu_enable()

Implements hook_enable().

File

./adminimal_admin_menu.install, line 11
Performs installation functions.

Code

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);
  }
}