You are here

function flag_actions_insert_action in Flag 5

Same name and namespace in other branches
  1. 6.2 flag_actions.module \flag_actions_insert_action()
  2. 6 flag_actions.module \flag_actions_insert_action()
  3. 7.3 flag_actions.module \flag_actions_insert_action()
  4. 7.2 flag_actions.module \flag_actions_insert_action()

Insert a new flag action.

Parameters

$fid: The flag object ID.

$threshold: The flagging threshold at which this action will be executed.

$callback: The action callback to be executed.

$parameters: The action parameters.

1 call to flag_actions_insert_action()
flag_actions_form_submit in ./flag_actions.module
Generic submit handler for saving flag actions.

File

./flag_actions.module, line 119
Actions support for the Flag module.

Code

function flag_actions_insert_action($fid, $event, $threshold, $callback, $parameters) {
  $aid = db_next_id('flag_actions_{aid}');
  db_query("INSERT INTO {flag_actions} (aid, fid, event, threshold, callback, parameters) VALUES (%d, %d, '%s', %d, '%s', '%s')", $aid, $fid, $event, $threshold, $callback, serialize($parameters));
  return $aid;
}