View source
<?php
function admin_menu_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {cache_admin_menu} (\n cid varchar(255) NOT NULL default '',\n data longblob,\n expire int NOT NULL default '0',\n created int NOT NULL default '0',\n headers text,\n PRIMARY KEY (cid),\n INDEX expire (expire)\n ) /*!40100 DEFAULT CHARACTER SET UTF8 */");
break;
case 'pgsql':
db_query("CREATE TABLE {cache_admin_menu} (\n cid varchar(255) NOT NULL default '',\n data bytea,\n expire int NOT NULL default '0',\n created int NOT NULL default '0',\n headers text,\n PRIMARY KEY (cid)\n )");
db_query("CREATE INDEX {cache_admin_menu}_expire_idx ON {cache_admin_menu} (expire)");
break;
}
}
function admin_menu_uninstall() {
db_query("DROP TABLE {cache_admin_menu}");
variable_del('admin_menu_devel_modules_enabled');
variable_del('admin_menu_margin_top');
variable_del('admin_menu_position_fixed');
variable_del('admin_menu_tweak_menu');
variable_del('admin_menu_tweak_modules');
variable_del('admin_menu_tweak_tabs');
}
function admin_menu_update_5202() {
$ret = array();
drupal_clear_css_cache();
cache_clear_all(NULL, 'cache_menu');
return $ret;
}
function admin_menu_update_5300() {
$ret = array();
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
$ret[] = update_sql("CREATE TABLE {cache_admin_menu} (\n cid varchar(255) NOT NULL default '',\n data longblob,\n expire int NOT NULL default '0',\n created int NOT NULL default '0',\n headers text,\n PRIMARY KEY (cid),\n INDEX expire (expire)\n ) /*!40100 DEFAULT CHARACTER SET UTF8 */");
break;
case 'pgsql':
$ret[] = update_sql("CREATE TABLE {cache_admin_menu} (\n cid varchar(255) NOT NULL default '',\n data bytea,\n expire int NOT NULL default '0',\n created int NOT NULL default '0',\n headers text,\n PRIMARY KEY (cid)\n )");
$ret[] = update_sql("CREATE INDEX {cache_admin_menu}_expire_idx ON {cache_admin_menu} (expire)");
break;
}
return $ret;
}