You are here

accountmenu.install in Account menu 7

Same filename and directory in other branches
  1. 6 accountmenu.install

accountmenu.install accountmenu module install/uninstall

File

accountmenu.install
View source
<?php

/**
 * @file accountmenu.install
 * accountmenu module install/uninstall
 */

/**
 * Implements hook_install.
 */
function accountmenu_install() {
  $t = get_t();
  db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES (:name, :title, :description)", array(
    ':name' => 'accountmenu',
    ':title' => $t('Account menu'),
    ':description' => $t('Account menu links.'),
  ));
  include_once 'accountmenu.module';
  _accountmenu_setup_menu();
  drupal_set_message($t('Account menu is installed, go to <a href="@help">help</a> for instructions.', array(
    '@help' => url('admin/help/accountmenu'),
  )), 'status');
}

/**
 * Implements hook_uninstall.
 */
function accountmenu_uninstall() {
  variable_del('accountmenu_menu_name');
  include_once 'accountmenu.module';
  _accountmenu_delete_menu();
  db_query("DELETE FROM {menu_custom} WHERE menu_name = 'accountmenu'");
  db_query("DELETE FROM {menu_links} WHERE link_path = 'user/self'");
}

Functions

Namesort descending Description
accountmenu_install Implements hook_install.
accountmenu_uninstall Implements hook_uninstall.