home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (admin_menu.install)

This example Drupal source code file (admin_menu.install) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

admin_menu, array, database, db_query, delete, file, function, menu_links, php, ret, return, sql, true, where

The admin_menu.install Drupal example source code

<?php
// $Id: admin_menu.install,v 1.4.2.6 2009/01/28 19:48:41 sun Exp $

/**
 * Implementation of hook_uninstall().
 */
function admin_menu_uninstall() {
  // Delete menu links.
  db_query("DELETE FROM {menu_links} WHERE module = 'admin_menu'");
  menu_cache_clear_all();
  // Delete variables.
  variable_del('admin_menu_devel_modules_enabled');
  variable_del('admin_menu_margin_top');
  variable_del('admin_menu_position_fixed');
  variable_del('admin_menu_rebuild_links');
  variable_del('admin_menu_tweak_modules');
  variable_del('admin_menu_tweak_tabs');
}

/**
 * Ensure that admin_menu is rebuilt after upgrading to D6.
 */
function admin_menu_update_6000() {
  $ret = array();
  // Delete menu links.
  db_query("DELETE FROM {menu_links} WHERE module = 'admin_menu'");
  variable_set('admin_menu_rebuild_links', TRUE);
  // Drop the {admin_menu} table in admin_menu_update_6000() on sites that used
  // one of the later patches in #132524.
  if (db_table_exists('admin_menu')) {
    $ret[] = update_sql("DROP TABLE {admin_menu}");
  }
  return $ret;
}

/**
 * Wipe and rebuild so we can switch the icon path to <front>.
 */
function admin_menu_update_6001() {
  $ret = array();
  module_load_include('inc', 'admin_menu');
  admin_menu_wipe();
  $ret[] = array('success' => TRUE, 'query' => 'Administration menu links deleted for clean rebuild.');
  return $ret;
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal admin_menu.install source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.