You are here

function menu_position_edit_rule in Menu Position 6

Same name and namespace in other branches
  1. 7.2 menu_position.admin.inc \menu_position_edit_rule()
  2. 7 menu_position.admin.inc \menu_position_edit_rule()

Edits a menu position rule.

1 call to menu_position_edit_rule()
menu_position_rule_form_submit in ./menu_position.admin.inc
Handles form submission for menu_position_rule_form().

File

./menu_position.admin.inc, line 518
Provides infrequently used functions and hooks for menu_position.

Code

function menu_position_edit_rule($rule) {

  // Update the rule.
  db_query('UPDATE {menu_position_rules} SET admin_title = "%s", conditions = "%s", menu_name = "%s", plid = %d WHERE rid = %d', $rule['admin_title'], $rule['conditions'], $rule['menu_name'], $rule['plid'], $rule['rid']);

  // Update the link.
  $mlid = db_result(db_query('SELECT mlid FROM {menu_position_rules} WHERE rid = %d', $rule['rid']));
  menu_position_edit_menu_link($rule['rid'], $mlid, $rule['plid'], $rule['admin_title']);
}