You are here

function modr8_log_action in modr8 7

Same name and namespace in other branches
  1. 5 modr8_admin.inc \modr8_log_action()
  2. 6 modr8_admin.inc \modr8_log_action()

Moderation log

4 calls to modr8_log_action()
modr8_approve_content in ./modr8.module
Public API function to approve the given node.
modr8_delete_content in ./modr8.module
Public API function to delete the given node.
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 461
Admin pages for moderation

Code

function modr8_log_action($op, $nid, $values, $message) {
  global $user;
  $actions = array(
    'approve' => 'Approve',
    'delete' => 'Delete',
    'nada' => 'No action',
    'response' => 'Response',
  );
  $id = db_insert('modr8_log')
    ->fields(array(
    'nid' => $nid,
    'uid' => $user->uid,
    'author_uid' => $values['author_uid'],
    'action' => $actions[$op],
    'title' => $values['title'],
    'message' => $message,
    'teaser' => $values['preview'],
    'timestamp' => REQUEST_TIME,
  ))
    ->execute();
}