| 1 |
<?php
|
| 2 |
// $Id: me.install,v 1.4 2009/01/30 21:39:28 cdale Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
*
|
| 7 |
* Provides 'me' aliases install and uninstall routines.
|
| 8 |
*/
|
| 9 |
|
| 10 |
/**
|
| 11 |
* Implementation of hook_uninstall().
|
| 12 |
*/
|
| 13 |
function me_uninstall() {
|
| 14 |
$vars = array(
|
| 15 |
'me_alias',
|
| 16 |
'me_case_insensitive',
|
| 17 |
'me_redirect',
|
| 18 |
'me_path_rule',
|
| 19 |
'me_paths',
|
| 20 |
'me_redirect_anonymous',
|
| 21 |
'me_rewrite_link',
|
| 22 |
'me_theme_menu_item_link_func',
|
| 23 |
'me_user_override',
|
| 24 |
);
|
| 25 |
|
| 26 |
foreach ($vars as $var) {
|
| 27 |
variable_del($var);
|
| 28 |
}
|
| 29 |
}
|
| 30 |
|
| 31 |
/**
|
| 32 |
* Implementation of hook_update_N() to rebuild the menu so users upgrading don't get crictical errors.
|
| 33 |
*/
|
| 34 |
function me_update_6001() {
|
| 35 |
$ret = array();
|
| 36 |
|
| 37 |
menu_rebuild();
|
| 38 |
|
| 39 |
$ret[] = array('success' => TRUE, 'query' => 'The menu has been rebuilt.');
|
| 40 |
|
| 41 |
return $ret;
|
| 42 |
}
|
| 43 |
|
| 44 |
/**
|
| 45 |
* Implementation of hook_update_N() to increase the weight of me
|
| 46 |
* to make sure other modules can use the %user wildcards as they expect
|
| 47 |
* them to be.
|
| 48 |
*/
|
| 49 |
function me_update_6002() {
|
| 50 |
$ret = array();
|
| 51 |
|
| 52 |
$ret[] = update_sql("UPDATE {system} SET weight = 999 WHERE name = 'me'");
|
| 53 |
|
| 54 |
return $ret;
|
| 55 |
}
|