You are here

function modr8_log_action in modr8 6

Same name and namespace in other branches
  1. 5 modr8_admin.inc \modr8_log_action()
  2. 7 modr8_admin.inc \modr8_log_action()
2 calls to modr8_log_action()
modr8_form_submit in ./modr8_admin.inc
Form submit handler, which approves or deletes the node.
modr8_response_form_submit in ./modr8_admin.inc
Form submit handler - log author response.

File

./modr8_admin.inc, line 374

Code

function modr8_log_action($op, $nid, $values, $message) {
  global $user;
  $actions = array(
    'approve' => 'Approve',
    'delete' => 'Delete',
    'nada' => 'No action',
    'response' => 'Response',
  );
  db_query("INSERT INTO {modr8_log} (nid, uid, author_uid, action, title, message, teaser, timestamp) VALUES (%d, %d, %d, '%s', '%s', '%s', '%s', %d)", $nid, $user->uid, $values['author_uid'], $actions[$op], $values['title'], $message, $values['preview'], time());

  // Notify modules interested in each action we took.
  // modules have to implement the function: hook_modr8_log ( $op ,$nid , $values, $message);
  module_invoke_all('modr8_log', $op, $nid, $values, $message);
}