diff -ru hidden/hidden.action-pages.inc hidden.diff/hidden.action-pages.inc --- hidden/hidden.action-pages.inc 2008-12-18 16:29:06.000000000 +0100 +++ hidden.diff/hidden.action-pages.inc 2009-01-15 03:54:12.000000000 +0100 @@ -82,7 +82,7 @@ ); $form['publictext'] = array( - '#type' => 'textarea', + '#type' => (variable_get('hidden_public_notes', TRUE)) ? 'textarea' : 'hidden', '#title' => t('Your Public notes'), '#default_value' => isset($hidden->publicnote) ? $hidden->publicnote : '', '#rows' => 5, @@ -258,6 +258,13 @@ _hidden_log(HIDDEN_LOG_ERROR, $msg, $type, $id, $rid, $public); drupal_set_message($msg, 'error'); } + + // If we hid a comment, jump back to the node from + // where we came from and go to the anchor of our comment + if ($type == 'comment') { + drupal_goto('node/'. $nid, NULL, 'comment-'. $id); + } + /** * The redirect challenge. * diff -ru hidden/hidden.admin.inc hidden.diff/hidden.admin.inc --- hidden/hidden.admin.inc 2008-12-18 16:29:07.000000000 +0100 +++ hidden.diff/hidden.admin.inc 2009-01-14 23:38:46.000000000 +0100 @@ -121,6 +121,12 @@ ); } } + $form['hidden_public_notes'] = array( + '#title' => t('Allow public notes'), + '#type' => 'checkbox', + '#default_value' => variable_get('hidden_public_notes', TRUE), + '#description' => t('If unchecked, the form for public notes about hidden content will be disabled, only predefined reasons are available.') + ); return system_settings_form($form); } diff -ru hidden/hidden.module hidden.diff/hidden.module --- hidden/hidden.module 2008-12-18 16:29:07.000000000 +0100 +++ hidden.diff/hidden.module 2009-01-15 03:56:01.000000000 +0100 @@ -573,9 +573,11 @@ if ($type == 'comment') { $target = $item->cid; + $iscomment = TRUE; } elseif ($type == 'node') { $target = $item->nid; + $iscomment = FALSE; } else { return $links; @@ -590,6 +592,7 @@ 'title' => t('hide'), 'href' => "hidden/$type/$target/hide", 'query' => drupal_get_destination(), + 'fragment' => ($iscomment) ? "comment-$target" : '', ); } // not hidden and is published @@ -601,6 +604,7 @@ 'title' => t('report'), 'href' => "hidden/$type/$target/report", 'query' => drupal_get_destination(), + 'fragment' => ($iscomment) ? "comment-$target" : '', ); } } @@ -1212,7 +1216,7 @@ return db_query($query, $id, $uid, time(), $rid, $public, $private); } elseif ($type == 'comment') { - $query = "INSERT INTO {hidden_reported_comment} (cid, uid, created, rid, publicnote, privatenote) VALUES (%d, %d, %d, %d, %d, '%s', '%s')"; + $query = "INSERT INTO {hidden_reported_comment} (cid, uid, created, rid, publicnote, privatenote) VALUES (%d, %d, %d, %d, '%s', '%s')"; return db_query($query, $id, $uid, time(), $rid, $public, $private); } @@ -1742,7 +1746,7 @@ if ($action > 50) { $log = _hidden_settings_logging(); if ($log[$action]['enabled']) { - watchdog('hidden', $description .' '. $titles, (($action == HIDDEN_LOG_DEBUG_FILTER) ? WATCHDOG_NOTICE : WATCHDOG_ERROR)); + watchdog('hidden', $description .' '. $titles, array(), (($action == HIDDEN_LOG_DEBUG_FILTER) ? WATCHDOG_NOTICE : WATCHDOG_ERROR)); //TODO deal with arrays and links } return; @@ -1753,7 +1757,7 @@ if ($email[$action]['when'] == HIDDEN_MAIL_LATER) { $query = "INSERT INTO {hidden_log} (hidetime, action, description, ids, uid) VALUES (%d, %d, '%s', '%s', %d)"; if (! db_query($query, time(), $action, $description ."\n". $titles, serialize($items), $user->uid)) { - watchdog('hidden', 'Error writing log to database', WATCHDOG_ERROR); + watchdog('hidden', 'Error writing log to database',array() , WATCHDOG_ERROR); } } else {