Index: sites/all/modules/contrib/flag_content/flag_content.module =================================================================== --- sites/all/modules/contrib/flag_content/flag_content.module (revision 4150) +++ sites/all/modules/contrib/flag_content/flag_content.module (working copy) @@ -225,6 +225,8 @@ } function flag_content_add(&$form_state, $eid = 0, $type = FLAG_CONTENT_TYPE_NODE) { + global $user; + switch ($type) { case FLAG_CONTENT_TYPE_NODE: $node = node_load($eid); @@ -255,7 +257,30 @@ '#type' => 'hidden', '#value' => $type, ); + + $form['name'] = array( + '#type' => 'textfield', + '#title' => t('Name'), + '#required' => TRUE, + '#default_value' => ($user->name) ? $user->name : '' + ); + $form['mail'] = array( + '#type' => 'textfield', + '#title' => t('Email'), + '#required' => TRUE, + '#default_value' => ($user->mail) ? $user->mail : '' + ); + + $form['reason'] = array( + '#type' => 'textarea', + '#title' => t('Reason'), + '#required' => TRUE, + '#rows' => 8, + '#description' => t('Why are you flagging this item?') + ); + + return confirm_form( $form, t('Are you sure you want to flag the @type @title', array('@type' => $type_label, '@title' => $title)), @@ -269,10 +294,14 @@ global $user; $eid = $form_state['values']['eid']; $type = $form_state['values']['type']; + $name = $form_state['values']['name']; + $mail = $form_state['values']['mail']; + $reason = $form_state['values']['reason']; + if ($eid && $type) { // Insert the data into the table - db_query("INSERT INTO {flag_content} (fid, eid, uid, type, timestamp) VALUES (0, %d, %d, '%s', %d)", - $eid, $user->uid, $type, time()); + db_query("INSERT INTO {flag_content} (fid, eid, uid, type, name, mail, reason, timestamp) VALUES (0, %d, %d, '%s', '%s', '%s', '%s', %d)", + $eid, $user->uid, $type, $name, $mail, $reason, time()); // Prepare the data switch ($type) { case FLAG_CONTENT_TYPE_NODE: @@ -459,7 +488,7 @@ $type = $entry->type; break; } - + $item.="
".t('Reason').' : '.$entry->reason; $timestamp = format_date($entry->timestamp, 'custom', 'Y-m-d H:i'); $by = theme('username', user_load(array('uid' => $entry->uid))); $ops = l(t('edit'), $edit);