Commit 270ee78e authored by develCuy's avatar develCuy
Browse files

NEW STUFF

- Install and Uninstall hooks implemented.

BUGS FIXING
- menu items not overrited when cached, reported by ahansen1.
parent 49f3e3f8
<?php
// $Id$
/**
* Implementation of hook_install().
*/
function menu_token_install() {
// Set the module weight to -2, so that the menu_token.module's hook_menu()
// implementation get's called before core node's implementation ...
db_query("UPDATE {system} SET weight = -10 WHERE name = 'menu_token'");
}
/**
* Implementation of hook_uninstall().
*/
function menu_token_uninstall() {
variable_del('menu_token_enabled');
}
......@@ -44,11 +44,12 @@ function menu_token_edit_item_form_submit($form_id, $form_values) {
function menu_token_footer() {
global $_menu;
$token_enabled = variable_get('menu_token_enabled', array());
// Override paths
foreach ($token_enabled as $mid => $path) {
$_menu['items'][$mid]['path'] = token_replace_multiple($path);
}
// Force drupal to refresh menu tree with tokenized version,
menu_get_item(115, NULL, TRUE);
// Force drupal to refresh menu tree with tokenized version,
menu_get_item($mid, NULL, TRUE);
}
}
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