Commit 21c5b717 authored by Steven Wittens's avatar Steven Wittens

#130991: Custom menu items, part 1

parent f3cd2da1
<?php
// $Id$
/**
* Implementation of hook_install().
*/
function menu_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {menu_edit} (
path varchar(255) NOT NULL default '' ,
disabled int NOT NULL default 0,
title varchar(255) NOT NULL default '',
description varchar(255) NOT NULL default '',
weight int NOT NULL default 0 ,
type int NOT NULL default 0 ,
admin int NOT NULL default 0,
parent varchar(255) NOT NULL default '',
PRIMARY KEY (path)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
break;
case 'pgsql':
db_query("CREATE TABLE {menu_edit} (
path varchar(255) NOT NULL default '' ,
disabled int NOT NULL default 0,
title varchar(255) NOT NULL default '',
description varchar(255) NOT NULL default '',
weight int NOT NULL default 0 ,
type int NOT NULL default 0 ,
admin int NOT NULL default 0,
parent varchar(255) NOT NULL default '',
PRIMARY KEY (path)
)");
break;
}
}
/**
* Implementation of hook_uninstall().
*/
function menu_uninstall() {
db_query('DROP TABLE {menu_edit}');
menu_rebuild();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment