_menu_helper_reset_uninstall_purge_reset_depth

custom/menu_helper/menu_helper_reset/menu_helper_reset.install, line 25

Versions
6
_menu_helper_reset_uninstall_purge_reset_depth()

Purge menu_helper_reset_depth from {options} in the {menu_links} table.

Code

<?php
function _menu_helper_reset_uninstall_purge_reset_depth() {
  $result = db_query("SELECT mlid, options FROM {menu_links} WHERE options LIKE '%menu_helper_reset%'");
  while ($item = db_fetch_array($result)) {
    // Unserialize and remove 'menu_helper_reset_depth' from options
    $item['options'] = unserialize($item['options']);
    unset($item['options']['menu_helper_reset']);
    // Update {menu_link}.options
    db_query("UPDATE {menu_links} SET options='%s' WHERE mlid=%d", serialize($item['options']), $item['mlid']);
  }
}
?>