diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-10-16 13:48:11 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-10-16 13:48:11 +0000 |
commit | 79641f53120c469bc0bf1c4f2f216fb6f1623eaf (patch) | |
tree | 7c7f95b9891f1744f51e9d104fd3d5cac0842867 /includes/menu.inc | |
parent | fee294af94151cc90bb6ebaf2709abc6d1f83de5 (diff) | |
download | brdo-79641f53120c469bc0bf1c4f2f216fb6f1623eaf.tar.gz brdo-79641f53120c469bc0bf1c4f2f216fb6f1623eaf.tar.bz2 |
#173188 by chx: update aggregator menu items when an aggregator category is changed
Diffstat (limited to 'includes/menu.inc')
-rw-r--r-- | includes/menu.inc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/includes/menu.inc b/includes/menu.inc index 60c120dfe..b95980795 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -1757,6 +1757,38 @@ function _menu_find_router_path($menu, $link_path) { return $router_path; } +/** + * Insert, update or delete an uncustomized menu link related to a module. + * + * @param $module + * The name of the module. + * @param $op + * Operation to perform: insert, update or delete. + * @param $link_path + * The path this link points to. + * @param $link_title + * Title of the link to insert or new title to update the link to. + * Unused for delete. + */ +function menu_link_maintain($module, $op, $link_path, $link_title) { + switch ($op) { + case 'insert': + $menu_link = array( + 'link_title' => $link_title, + 'link_path' => $link_path, + 'module' => $module, + ); + menu_link_save($menu_link); + break; + case 'update': + db_query("UPDATE {menu_links} SET link_title = '%s' WHERE link_path = '%s' AND customized = 0 AND module = '%s'", $link_title, $link_path, $module); + menu_cache_clear(); + break; + case 'delete': + menu_link_delete(NULL, $link_path); + break; + } +} /** * Find the depth of an item's children relative to its depth. |