From c3ba88e4cb49bd6a47755f750f77b9947d6e390c Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Tue, 18 Nov 2014 13:57:17 +0100
Subject: [PATCH] Issue #1484470 by umtj: Test of variable

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index c7cf09d..c0d9cf8 100644
--- a/abuse.module
+++ b/abuse.module
@@ -76,7 +76,7 @@ function abuse_node_access() {
           }
         }
       }
-      else {
+      else if (is_string($perms[$i])) {
         if (user_access($perms[$i])) {
           return TRUE;
         }
-- 
1.8.4.2

From 101ca33eb83cf759e4ccabcb63c024935e208b64 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Tue, 18 Nov 2014 13:57:43 +0100
Subject: [PATCH] Issue #1484470 by umtj: Changed user_access

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index c0d9cf8..11f84c6 100644
--- a/abuse.module
+++ b/abuse.module
@@ -139,7 +139,7 @@ function abuse_menu() {
     'description' => 'Settings for Abuse moderation',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('abuse_admin_settings'),
-    'access callback' => 'abuse_node_access',
+    'access callback' => 'user_access',
     'access arguments' => array(CONFIGURE_ABUSE_SETTINGS),
     'file' => 'abuse.admin.inc',
   );
-- 
1.8.4.2

From 4653579a72df7f45dc12a090808eaefb25609e57 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Tue, 18 Nov 2014 14:02:39 +0100
Subject: [PATCH] Issue #1484470 by umtj: Better markup

---
 abuse-report.tpl.php | 170 ++++++++++++++++++++++++++-------------------------
 1 file changed, 88 insertions(+), 82 deletions(-)

diff --git a/abuse-report.tpl.php b/abuse-report.tpl.php
index b9e67c3..16512cc 100644
--- a/abuse-report.tpl.php
+++ b/abuse-report.tpl.php
@@ -14,90 +14,96 @@
  * @see template_preprocess_abuse_report()
  */
 ?>
-<li class="abuse-report corners">
-  <div class="summary">
-    <h2><?php print l($object->title, $object->path['URL'], array('query' => $object->path['QUERY'], 'fragment' => $object->path['BREADCRUMB'])); ?></h2>
-    <dl>
-      <dt><?php print t('Type:'); ?></dt>
-      <dd><?php print drupal_ucfirst($object->content_type); ?></dd>
-      <dt><?php print t('Status:'); ?></dt>
-      <dd><?php print $object->abuse_status_string; ?></dd>
-      <?php if (variable_get('abuse_assigned_moderators', FALSE)): ?>
-        <dt><?php print t('Assigned To:'); ?></dt>
-        <dd><?php print $object->abuse_assigned_to_name; ?></dd>
-      <?php endif; ?>
-    </dl>
-    <?php if (!empty($object->description)): ?>
-      <p><?php print $object->description['safe_value']; ?></p>
-    <?php endif; ?>
-    <h4><?php print t('By: !username', array('!username' => theme('username', array('account' => $object->account)))); ?></h4>
-    <dl>
-      <dt><?php print t('Email'); ?>:</dt>
-      <dd><?php print $object->account->mail; ?></dd>
-      <dt><?php print t('Age'); ?>:</dt>
-      <dd><?php print theme('age', $object->account->uid); ?></dd>
-      <dt><?php print t('Offences'); ?>:</dt>
-      <dd><?php print $offences; ?></dd>
-      <dt><?php print t('Warnings'); ?>:</dt>
-      <dd><?php print $warnings; ?></dd>
-    </dl>
-    <ul class="links">
-      <li><?php print l(t('Edit Account'), 'user/'. $object->account->uid .'/edit'); ?></li>
-      <li><?php print l(t('View Account History'), 'admin/abuse/status/user/'. $object->account->uid); ?></li>
-    </ul>
-  </div>
-  <div class="actions">
-    <?php print render($moderate); ?>
-  </div>
-  <div class="details clear-block">
-    <div class="column column-first">
-      <?php print $object->content['safe_value']; ?>&nbsp;
-    </div>
-    <div class="column column-last">
-
-      <dl class="history">
-        <dt><?php print t('History'); ?></dt>
-        <?php if (count($object->history)): ?>
-          <?php foreach ($object->history as $log): ?>
-          <dd>
-            <strong><?php print $log->flagger; ?>:</strong>
-            <?php print t('Changed status to %status', array('%status' => $log->readable_status)); ?>
-          </dd>
-          <?php endforeach; ?>
-        <?php else: ?>
-          <dd><?php print t('None');?></dd>
-        <?php endif; ?>
-      </dl>
 
-      <dl class="warnings">
-        <dt><?php print t('Warnings'); ?></dt>
-        <?php if (count($object->warnings)): ?>
-          <?php foreach ($object->warnings as $warning): ?>
-          <dd>
-            <strong><?php print $warning->name; ?>:</strong>
-            <?php print t('sent warning on %date', array('%date' => $warning->date)); ?>
-          </dd>
-          <?php endforeach; ?>
-        <?php else: ?>
-          <dd><?php print t('None');?></dd>
+<fieldset class="abuse-report corners fieldset form-wrapper">
+  <div class="summary fieldset-wrapper">
+    <h2><?php print l($object->title, $object->path['URL'], array('query' => $object->path['QUERY'], 'fragment' => $object->path['BREADCRUMB'])); ?></h2>
+    <fieldset class="abuse-report corners fieldset collapsible form-wrapper">
+      <legend><span class="fieldset-legend"><a class="fieldset-title" href="#"><span class="fieldset-legend-prefix element-invisible">Show</span><?php print t('User'); ?></a><span class="summary"></span></span></legend>
+      <div class="summary fieldset-wrapper">
+        <label><?php print t('Type:'); ?></label>
+        <div class="description"><?php print drupal_ucfirst($object->content_type); ?></div>
+        <label><?php print t('Status:'); ?></label>
+        <div class="description"><?php print $object->abuse_status_string; ?></div>
+        <?php if (variable_get('abuse_assigned_moderators', FALSE)): ?>
+          <label><?php print t('Assigned To:'); ?></label>
+          <div class="description"><?php print $object->abuse_assigned_to_name; ?></div>
         <?php endif; ?>
-      </dl>
-
-      <dl class="flags">
-        <dt><?php print t('Flags'); ?></dt>
-        <?php if (count($object->reports)): ?>
-          <?php foreach ($object->reports as $report): ?>
-            <dd>
-              <strong><?php print strcasecmp($report->name, t('Watchlist')) == 0 ? t('Watchlist') : theme('username', array('account' => $object->account)); ?></strong> &mdash;
-              <?php print format_date($report->created); ?>:<br />
-              <?php print check_plain(urldecode($report->body)); ?>
-            </dd>
-          <?php endforeach; ?>
-        <?php else: ?>
-          <dd><?php print t('None');?></dd>
+        <?php if (!empty($object->description)): ?>
+          <p><?php print $object->description['safe_value']; ?></p>
         <?php endif; ?>
-      </dl>
-
+        <label><?php print t('By:'); ?></label>
+        <div class="description"><?php print t('!username', array('!username' => theme('username', array('account' => $object->account)))); ?></div>
+        <label><?php print t('Email'); ?>:</label>
+        <div class="description"><?php print $object->account->mail; ?></div>
+        <label><?php print t('Age'); ?>:</label>
+        <div class="description"><?php print theme('age', $object->account->uid); ?></div>
+        <label><?php print t('Offences'); ?>:</label>
+        <div class="description"><?php print $offences; ?></div>
+        <label><?php print t('Warnings'); ?>:</label>
+        <div class="description"><?php print $warnings; ?></div>
+        <label><?php print t('User links'); ?>:</label>
+        <ul class="links">
+          <li><?php print l(t('Edit Account'), 'user/'. $object->account->uid .'/edit'); ?></li>
+          <li><?php print l(t('View Account History'), 'admin/abuse/status/user/'. $object->account->uid); ?></li>
+        </ul>
+      </div>
+    </fieldset>
+    <div class="details clear-block">
+      <div class="column column-first">
+        <?php print $object->content['safe_value']; ?>
+      </div>
+      <div class="column column-last">
+        <fieldset class="abuse-report-allow collapsible form-wrapper">
+          <legend><span class="fieldset-legend"><a class="fieldset-title" href="#"><span class="fieldset-legend-prefix element-invisible">Show</span><?php print t('History'); ?></a><span class="summary"></span></span></legend>
+          <div class="fieldset-wrapper">
+            <div class="history">
+              <label><?php print t('History'); ?></label>
+              <?php if (count($object->history)): ?>
+                <?php foreach ($object->history as $log): ?>
+                <div>
+                  <strong><?php print $log->flagger; ?>:</strong>
+                  <?php print t('Changed status to %status', array('%status' => $log->readable_status)); ?>
+                </div>
+                <?php endforeach; ?>
+              <?php else: ?>
+                <div><?php print t('None');?></div>
+              <?php endif; ?>
+            </div>
+            <div class="warnings">
+              <label><?php print t('Warnings'); ?></label>
+              <?php if (count($object->warnings)): ?>
+                <?php foreach ($object->warnings as $warning): ?>
+                <div>
+                  <strong><?php print $warning->name; ?>:</strong>
+                  <?php print t('sent warning on %date', array('%date' => $warning->date)); ?>
+                </div>
+                <?php endforeach; ?>
+              <?php else: ?>
+                <div><?php print t('None');?></div>
+              <?php endif; ?>
+            </div>
+            <div class="flags">
+              <label><?php print t('Flags'); ?></label>
+              <?php if (count($object->reports)): ?>
+                <?php foreach ($object->reports as $report): ?>
+                  <div>
+                    <strong><?php print strcasecmp($report->name, t('Watchlist')) == 0 ? t('Watchlist') : theme('username', array('account' => $object->account)); ?></strong>
+                    <?php print format_date($report->created); ?>:<br />
+                    <?php print check_plain(urldecode($report->body)); ?>
+                  </div>
+                <?php endforeach; ?>
+              <?php else: ?>
+                <div><?php print t('None');?></div>
+              <?php endif; ?>
+            </div>
+          </div>
+        </fieldset>
+      </div>
+    </div>
+    <div class="actions">
+      <h3><?php print t('Actions'); ?></h3>
+      <?php print render($moderate); ?>
     </div>
   </div>
-</li>
+</fieldset>
\ No newline at end of file
-- 
1.8.4.2

From 8f9d32fa5149020559a6125105c1bd132840b6d1 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Tue, 18 Nov 2014 14:05:25 +0100
Subject: [PATCH] Issue #1484470 by umtj: Use of render

---
 abuse-report.tpl.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse-report.tpl.php b/abuse-report.tpl.php
index 16512cc..9690947 100644
--- a/abuse-report.tpl.php
+++ b/abuse-report.tpl.php
@@ -51,7 +51,7 @@
     </fieldset>
     <div class="details clear-block">
       <div class="column column-first">
-        <?php print $object->content['safe_value']; ?>
+        <?php print render($object->content); ?>
       </div>
       <div class="column column-last">
         <fieldset class="abuse-report-allow collapsible form-wrapper">
-- 
1.8.4.2

From 5614d5ec2df291e09fac562afebcaa7a936e25f1 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Tue, 18 Nov 2014 14:06:02 +0100
Subject: [PATCH] Issue #1484470 by umtj: Use global . Test variables. This
 fixes taxonomy views

---
 abuse.module | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/abuse.module b/abuse.module
index 11f84c6..a709b0f 100644
--- a/abuse.module
+++ b/abuse.module
@@ -362,11 +362,10 @@ function abuse_cron() {
  * Implements hook_node_view().
  */
 function abuse_entity_view($entity, $type, $view_mode, $langcode) {
-  // global $user;
-  $user = $GLOBALS['user'];
+  global $user;
   $links = array();
-  if ($entity && $user && $user->uid == $entity->uid) {
-    // Don't want user to flag their own content
+  if (isset($entity->uid) && isset($user->uid) && $user->uid == $entity->uid) {
+    // Don't want user to flag their own content.
     return $links;
   }
 
-- 
1.8.4.2

From 0f8fff40b7f5e330cab90a7469fcf470c4c2066d Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Tue, 18 Nov 2014 14:06:45 +0100
Subject: [PATCH] Issue #1484470 by umtj: Use constants

---
 abuse.module | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/abuse.module b/abuse.module
index a709b0f..c52dab1 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1118,9 +1118,9 @@ function _abuse_get_assigned_count($status = FALSE) {
   ->condition('assigned_to_uid', $user->uid, '=')
   ->db_and()
   ->db_or()
-  ->condition('status', 'ABUSE_PENDING', '=')
+  ->condition('status', ABUSE_PENDING, '=')
   ->db_or()
-  ->condition('status', 'ABUSE_HIDDEN', '=')
+  ->condition('status', ABUSE_HIDDEN, '=')
   ->db_or()
   ->condition('status', 'ABUSE_SUPERADMIN', '=')
   ->orderBy('assigned_to_uid', 'DESC')
-- 
1.8.4.2

From 976b07af1ac6459295e87da1cd0ab34d28648048 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Tue, 18 Nov 2014 14:08:39 +0100
Subject: [PATCH] Issue #1484470 by umtj: db_or() corrected

---
 abuse.module | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/abuse.module b/abuse.module
index c52dab1..537fb04 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1143,23 +1143,27 @@ function _abuse_get_assigned_count($status = FALSE) {
     else {
       // TODO Please review the conversion of this statement to the D7 database API syntax.
       /* db_query("UPDATE {abuse_status} SET assigned_to_uid=%d WHERE (assigned_to_uid=0 OR assigned_to_uid=%d) AND (status=%d OR status=%d) ORDER BY assigned_to_uid DESC, oid DESC LIMIT %d", $user->uid, $user->uid, ABUSE_PENDING, ABUSE_HIDDEN, variable_get('abuse_num_assigned', 20)) */
+      $assigned_to_uid = db_or()
+        ->condition('assigned_to_uid', '0', '=')
+        ->condition('assigned_to_uid', $user->uid, '=');
+
+      $status = db_or()
+        ->condition('status', 'ABUSE_PENDING', '=')
+        ->condition('status', 'ABUSE_HIDDEN', '=');
+
       $query = db_update('abuse_status')
         ->fields(array(
           'assigned_to_uid' => $user->uid,
         ))
-        ->db_or()
-        ->condition('assigned_to_uid', '0', '=')
-        ->condition('assigned_to_uid', $user->uid, '=')
-        ->db_and()
-        ->db_or()
-        ->condition('status', 'ABUSE_PENDING', '=')
-        ->condition('status', 'ABUSE_HIDDEN', '=')
-        ->orderBy('assigned_to_uid', 'DESC')
-        ->orderBy('oid', 'DESC')
-        ->range(0, variable_get('abuse_num_assigned', 20));
-      var_dump($query);
+        ->condition($assigned_to_uid)
+        ->condition($status);
+      //->orderBy('assigned_to_uid', 'DESC')
+      //->orderBy('oid', 'DESC')
+      //->range(0, variable_get('abuse_num_assigned', 20));
+      //var_dump($query);
       $result = $query->execute();
- // ->where('(assigned_to_uid=0 OR assigned_to_uid=%d) AND (status=%d OR status=%d) ORDER BY assigned_to_uid DESC, oid DESC LIMIT %d',  )
+
+      // ->where('(assigned_to_uid=0 OR assigned_to_uid=%d) AND (status=%d OR status=%d) ORDER BY assigned_to_uid DESC, oid DESC LIMIT %d',  )
 // UPDATE {abuse_status}
 // SET assigned_to_uid=%d
 // WHERE (assigned_to_uid=0
@@ -1171,7 +1175,7 @@ function _abuse_get_assigned_count($status = FALSE) {
 // LIMIT %d",
 // $user->uid, $user->uid, ABUSE_PENDING, ABUSE_HIDDEN, variable_get('abuse_num_assigned', 20))
       }
-    $result = db_query("SELECT count(*) FROM {abuse_status} WHERE assigned_to_uid = :assigned_to_uid AND (status = :status OR status = :status OR status = :status)", array(':assigned_to_uid' => $user->uid, ':status' => ABUSE_PENDING, ':status' => ABUSE_HIDDEN, ':status' => ABUSE_SUPERADMIN))->fetchField();
+    //$result = db_query("SELECT count(*) FROM {abuse_status} WHERE assigned_to_uid = :assigned_to_uid AND (status = :status OR status = :status OR status = :status)", array(':assigned_to_uid' => $user->uid, ':status' => ABUSE_PENDING, ':status' => ABUSE_HIDDEN, ':status' => ABUSE_SUPERADMIN))->fetchField();
   }
   return $result;
 }
-- 
1.8.4.2

From 33ae8772f0fbad928b90942312039df5bc1e3cf2 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Tue, 18 Nov 2014 15:04:08 +0100
Subject: [PATCH] Issue #1484470 by umtj: Corrected comment table

---
 abuse.module | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/abuse.module b/abuse.module
index 537fb04..4b33b59 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1360,7 +1360,7 @@ function _abuse_allow($type, $oid) {
         break;
 
       case 'comment':
-        db_update('comments')
+        db_update('comment')
           ->fields(array(
             'status' => 0,
           ))
@@ -1468,7 +1468,7 @@ function _abuse_disable($type, $oid) {
         break;
 
       case 'comment':
-        db_update('comments')
+        db_update('comment')
           ->fields(array(
             'status' => 1,
           ))
-- 
1.8.4.2

From 7d560343b12837196f30e04ced29dc88d4de976a Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:43:33 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/abuse.module b/abuse.module
index 4b33b59..a40a8ae 100644
--- a/abuse.module
+++ b/abuse.module
@@ -12,17 +12,17 @@ define('ABUSE_REMOVED', 3);
 define('ABUSE_SUPERADMIN', 4);
 
 // Set of content allowed for abuse flagging.
-define('ABUSE_ENTITY_TYPE',    'abuse_entity_type_');
+define('ABUSE_ENTITY_TYPE', 'abuse_entity_type_');
 define('ABUSE_CONTENT_COMMENTS', 'abuse_content_comments');
 define('ABUSE_CONTENT_USERS', 'abuse_content_users');
 define('ABUSE_CONTENT_NODE_TYPE', 'abuse_content_node_type');
 
 // Set of permissions.
-define('REPORT_ABUSE', 'Report abuse');
-define('ADMINISTER_ABUSE_REPORTS', 'Administer abuse reports');
-define('CONFIGURE_ABUSE_SETTINGS', 'Configure abuse administration settings');
-define('DIRECT_FLAG', 'Direct flag');
-define('ADMINISTER_ALL_ABUSE_REPORTS', 'Administer all abuse reports');
+define('ABUSE_REPORT_ABUSE', 'Report abuse');
+define('ABUSE_ADMINISTER_ABUSE_REPORTS', 'Administer abuse reports');
+define('ABUSE_CONFIGURE_ABUSE_SETTINGS', 'Configure abuse administration settings');
+define('ABUSE_DIRECT_FLAG', 'Direct flag');
+define('ABUSE_ADMINISTER_ALL_ABUSE_REPORTS', 'Administer all abuse reports');
 
 /**
  * Implementation of Drupal Hooks
-- 
1.8.4.2

From b8294968d09633092bf84429b54c0e6d197472de Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:43:49 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/abuse.module b/abuse.module
index a40a8ae..735ccf9 100644
--- a/abuse.module
+++ b/abuse.module
@@ -33,24 +33,24 @@ define('ABUSE_ADMINISTER_ALL_ABUSE_REPORTS', 'Administer all abuse reports');
  */
 function abuse_permission() {
   return array(
-    REPORT_ABUSE => array(
-      'title' => t(REPORT_ABUSE),
+    ABUSE_REPORT_ABUSE => array(
+      'title' => t(ABUSE_REPORT_ABUSE),
       'description' => t('Allow role to report abuse.'),
     ),
-    DIRECT_FLAG => array(
-      'title' => t(DIRECT_FLAG),
+    ABUSE_DIRECT_FLAG => array(
+      'title' => t(ABUSE_DIRECT_FLAG),
       'description' => t('Allow role to direct flag.'),
     ),
-    ADMINISTER_ABUSE_REPORTS => array(
-      'title' => t(ADMINISTER_ABUSE_REPORTS),
+    ABUSE_ADMINISTER_ABUSE_REPORTS => array(
+      'title' => t(ABUSE_ADMINISTER_ABUSE_REPORTS),
       'description' => t('Access abuse reports. Give to trusted roles only.'),
     ),
-    ADMINISTER_ALL_ABUSE_REPORTS => array(
-      'title' => t(ADMINISTER_ALL_ABUSE_REPORTS),
+    ABUSE_ADMINISTER_ALL_ABUSE_REPORTS => array(
+      'title' => t(ABUSE_ADMINISTER_ALL_ABUSE_REPORTS),
       'description' => t('Access all abuse reports. Give to trusted roles only.'),
     ),
-    CONFIGURE_ABUSE_SETTINGS => array(
-      'title' => t(CONFIGURE_ABUSE_SETTINGS),
+    ABUSE_CONFIGURE_ABUSE_SETTINGS => array(
+      'title' => t(ABUSE_CONFIGURE_ABUSE_SETTINGS),
       'description' => t('Configure abuse settings. Give to admin only.'),
     ),
   );
-- 
1.8.4.2

From f0a6e7f34b260f063677f3c565e1aa9fbb5cc3eb Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:44:09 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 735ccf9..f7c7ecc 100644
--- a/abuse.module
+++ b/abuse.module
@@ -63,7 +63,7 @@ function abuse_permission() {
 function abuse_node_access() {
   $args = func_num_args();
   if ($args < 1) {
-    return user_access(ADMINISTER_ALL_ABUSE_REPORTS);
+    return user_access(ABUSE_ADMINISTER_ALL_ABUSE_REPORTS);
   }
   else {
     $perms = func_get_args();
-- 
1.8.4.2

From 328d9d621abc184918d71ad4a4ae823daf2e9223 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:44:33 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index f7c7ecc..6a90f4e 100644
--- a/abuse.module
+++ b/abuse.module
@@ -58,7 +58,7 @@ function abuse_permission() {
 
 
 /**
- * Implementation of access controls
+ * Implementation of access controls.
  */
 function abuse_node_access() {
   $args = func_num_args();
-- 
1.8.4.2

From 27e7d8c512c7417255671da4b2a828bb72953fb5 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:44:44 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 6a90f4e..740382e 100644
--- a/abuse.module
+++ b/abuse.module
@@ -68,7 +68,7 @@ function abuse_node_access() {
   else {
     $perms = func_get_args();
     for ($i = 0; $i < $args; $i++) {
-      // Because of the arguments, an array could be passed in
+      // Because of the arguments, an array could be passed in.
       if (is_array($perms[$i])) {
         foreach ($perms[$i] as $permission) {
           if (user_access($permission)) {
-- 
1.8.4.2

From d224e7a262579bda19b36444901038cd9ebd9315 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:45:00 +0100
Subject: [PATCH] Issue #1484470 by umtj: string test

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 740382e..4dfa88b 100644
--- a/abuse.module
+++ b/abuse.module
@@ -76,7 +76,7 @@ function abuse_node_access() {
           }
         }
       }
-      else if (is_string($perms[$i])) {
+      elseif (is_string($perms[$i])) {
         if (user_access($perms[$i])) {
           return TRUE;
         }
-- 
1.8.4.2

From 38e767ea9f82391a785ad7c335d3c71c0b352637 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:45:28 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/abuse.module b/abuse.module
index 4dfa88b..40adb17 100644
--- a/abuse.module
+++ b/abuse.module
@@ -88,10 +88,23 @@ function abuse_node_access() {
 
 
 /**
- * Implementation of more complex controls to swtich between old admin system and new ticketing system
- * @TODO hook_access() removed in favor of hook_node_access(). (Drupal Docs) [upgrade7x_28]
+ * Moderate system access.
+ *
+ * Implementation of more complex controls to swtich between old admin system
+ * and new ticketing system.
+ * @TODO hook_access() removed in favor of hook_node_access().
+ * (Drupal Docs) [upgrade7x_28]
+ * @TODO replace hook_node_access($node, $op, $account)
+ *
+ * @param array $perms
+ *   Permissions.
+ *
+ * @param bool $old_system
+ *   Old access system.
+ *
+ * @return bool
+ *   TRUE if accepted.
  */
-// @TODO replace hook_node_access($node, $op, $account)
 function abuse_moderation_system_access($perms, $old_system = FALSE) {
   return abuse_node_access($perms);
   // @TODO check what is up with the assigned moderators
-- 
1.8.4.2

From 6c0edd663ed6eda05180d896c5b87f52533027b3 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:45:58 +0100
Subject: [PATCH] Issue #1484470 by umtj: better return handling

---
 abuse.module | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 40adb17..ebb41b4 100644
--- a/abuse.module
+++ b/abuse.module
@@ -124,12 +124,15 @@ function abuse_moderation_system_access($perms, $old_system = FALSE) {
  * Implements hook_help().
  */
 function abuse_help($section) {
+  $message = '';
   switch ($section) {
     case 'admin/help#abuse':
     case 'admin/modules#description':
-      return t('allow users to report abusive content');
+      $message = t('Allow users to report abusive content');
       break;
   }
+
+  return $message;
 }
 
 
-- 
1.8.4.2

From a0b2afa2cbd6e213b57d398c0f76debe61aff70a Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:46:12 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index ebb41b4..8f0ed9f 100644
--- a/abuse.module
+++ b/abuse.module
@@ -146,7 +146,7 @@ function abuse_menu() {
     'page callback' => 'abuse_report',
     'page arguments' => array(2, 3),
     'access callback' => 'abuse_node_access',
-    'access arguments' => array(REPORT_ABUSE, DIRECT_FLAG),
+    'access arguments' => array(ABUSE_REPORT_ABUSE, ABUSE_DIRECT_FLAG),
     'type' => MENU_CALLBACK,
   );
   // Abuse system settings.
-- 
1.8.4.2

From f4f8cbb37296186fff1ca310edd84bcdf194477b Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:46:27 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 8f0ed9f..9b25896 100644
--- a/abuse.module
+++ b/abuse.module
@@ -140,7 +140,7 @@ function abuse_help($section) {
  * Implements hook_menu().
  */
 function abuse_menu() {
-  // Regular flagging
+  // Regular flagging.
   $items['abuse/report/%/%'] = array(
     'title' => 'Flag',
     'page callback' => 'abuse_report',
-- 
1.8.4.2

From d265b19c90208f97b29de3b55c65c183c3c2ee1c Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:46:37 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 9b25896..779710e 100644
--- a/abuse.module
+++ b/abuse.module
@@ -156,7 +156,7 @@ function abuse_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('abuse_admin_settings'),
     'access callback' => 'user_access',
-    'access arguments' => array(CONFIGURE_ABUSE_SETTINGS),
+    'access arguments' => array(ABUSE_CONFIGURE_ABUSE_SETTINGS),
     'file' => 'abuse.admin.inc',
   );
   $items['admin/config/people/abuse/settings'] = array(
-- 
1.8.4.2

From 638c7d750b37bb7527bb241d13c7482d7a2cd92a Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:46:53 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 779710e..34dafd1 100644
--- a/abuse.module
+++ b/abuse.module
@@ -170,7 +170,7 @@ function abuse_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('abuse_admin_reason_settings'),
     'access callback' => 'user_access',
-    'access arguments' => array(CONFIGURE_ABUSE_SETTINGS),
+    'access arguments' => array(ABUSE_CONFIGURE_ABUSE_SETTINGS),
     'file' => 'abuse.admin.inc',
     'type' => MENU_LOCAL_TASK,
   );
-- 
1.8.4.2

From 711b6cd1a34240ad6efbb783c9bdf24659d43fe1 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:47:08 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 34dafd1..248d9fb 100644
--- a/abuse.module
+++ b/abuse.module
@@ -180,7 +180,7 @@ function abuse_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('abuse_admin_edit_reason', 5),
     'access callback' => 'user_access',
-    'access arguments' => array(CONFIGURE_ABUSE_SETTINGS),
+    'access arguments' => array(ABUSE_CONFIGURE_ABUSE_SETTINGS),
     'file' => 'abuse.admin.inc',
     'type' => MENU_CALLBACK,
   );
-- 
1.8.4.2

From 0274a3b6c701915d5847df086c3698dc97c8c7a7 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:47:16 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/abuse.module b/abuse.module
index 248d9fb..fb2c8ed 100644
--- a/abuse.module
+++ b/abuse.module
@@ -190,14 +190,14 @@ function abuse_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('abuse_admin_moderate_content', 4, 5),
     'access callback' => 'abuse_node_access',
-    'access arguments' => array(ADMINISTER_ABUSE_REPORTS, ADMINISTER_ALL_ABUSE_REPORTS),
+    'access arguments' => array(ABUSE_ADMINISTER_ABUSE_REPORTS, ABUSE_ADMINISTER_ALL_ABUSE_REPORTS),
     'file' => 'abuse.admin.inc',
     'type' => MENU_CALLBACK,
   );
   $items['admin/abuse/moderate/content/js'] = array(
     'page callback' => 'abuse_admin_moderate_content_js',
     'access callback' => 'abuse_node_access',
-    'access arguments' => array(ADMINISTER_ABUSE_REPORTS, ADMINISTER_ALL_ABUSE_REPORTS),
+    'access arguments' => array(ABUSE_ADMINISTER_ABUSE_REPORTS, ABUSE_ADMINISTER_ALL_ABUSE_REPORTS),
     'file' => 'abuse.admin.inc',
     'type' => MENU_CALLBACK,
   );
-- 
1.8.4.2

From e8626f8e9cdfa187730a2e196b4a6684d2d521af Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:47:25 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index fb2c8ed..fc8379c 100644
--- a/abuse.module
+++ b/abuse.module
@@ -206,7 +206,7 @@ function abuse_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('abuse_admin_ban', 3),
     'access callback' => 'abuse_node_access',
-    'access arguments' => array(ADMINISTER_ABUSE_REPORTS, ADMINISTER_ALL_ABUSE_REPORTS),
+    'access arguments' => array(ABUSE_ADMINISTER_ABUSE_REPORTS, ABUSE_ADMINISTER_ALL_ABUSE_REPORTS),
     'file' => 'abuse.admin.inc',
     'type' => MENU_CALLBACK,
   );
-- 
1.8.4.2

From f596e211bb65d86ccbcc494046ac20be8c844a88 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:47:35 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index fc8379c..36cc240 100644
--- a/abuse.module
+++ b/abuse.module
@@ -227,7 +227,7 @@ function abuse_menu() {
     'page callback' => 'abuse_admin_moderate',
     'page arguments' => array(array(ABUSE_PENDING)),
     'access callback' => 'abuse_moderation_system_access',
-    'access arguments' => array(ADMINISTER_ABUSE_REPORTS, ADMINISTER_ALL_ABUSE_REPORTS),
+    'access arguments' => array(ABUSE_ADMINISTER_ABUSE_REPORTS, ABUSE_ADMINISTER_ALL_ABUSE_REPORTS),
     'file' => 'abuse.admin.inc',
     'weight' => 0,
     'type' => MENU_DEFAULT_LOCAL_TASK,
-- 
1.8.4.2

From e72490d51f1ba4c94e0b765bebe49c08c74d7351 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:47:44 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 36cc240..07540ae 100644
--- a/abuse.module
+++ b/abuse.module
@@ -238,7 +238,7 @@ function abuse_menu() {
     'page callback' => 'abuse_admin_moderate',
     'page arguments' => array(array(ABUSE_HIDDEN)),
     'access callback' => 'abuse_moderation_system_access',
-    'access arguments' => array(ADMINISTER_ABUSE_REPORTS, ADMINISTER_ALL_ABUSE_REPORTS),
+    'access arguments' => array(ABUSE_ADMINISTER_ABUSE_REPORTS, ABUSE_ADMINISTER_ALL_ABUSE_REPORTS),
     'file' => 'abuse.admin.inc',
     'weight' => 1,
     'type' => MENU_LOCAL_TASK,
-- 
1.8.4.2

From 3bb62df15dbb0e0cbd360f4ae10d44fd8d343793 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:47:57 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 07540ae..ffc25d7 100644
--- a/abuse.module
+++ b/abuse.module
@@ -249,7 +249,7 @@ function abuse_menu() {
     'page callback' => 'abuse_admin_moderate',
     'page arguments' => array(array(ABUSE_REMOVED)),
     'access callback' => 'abuse_moderation_system_access',
-    'access arguments' => array(ADMINISTER_ABUSE_REPORTS, ADMINISTER_ALL_ABUSE_REPORTS),
+    'access arguments' => array(ABUSE_ADMINISTER_ABUSE_REPORTS, ABUSE_ADMINISTER_ALL_ABUSE_REPORTS),
     'file' => 'abuse.admin.inc',
     'weight' => 2,
     'type' => MENU_LOCAL_TASK,
-- 
1.8.4.2

From 36805a581d56b2b3afb07e643da25722b4d61718 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:48:15 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index ffc25d7..89b422f 100644
--- a/abuse.module
+++ b/abuse.module
@@ -261,7 +261,7 @@ function abuse_menu() {
     'page callback' => 'abuse_admin_moderate',
     'page arguments' => array(array(ABUSE_PENDING, ABUSE_HIDDEN), TRUE),
     'access callback' => 'abuse_moderation_system_access',
-    'access arguments' => array(ADMINISTER_ABUSE_REPORTS, ADMINISTER_ALL_ABUSE_REPORTS),
+    'access arguments' => array(ABUSE_ADMINISTER_ABUSE_REPORTS, ABUSE_ADMINISTER_ALL_ABUSE_REPORTS),
     'file' => 'abuse.admin.inc',
     'weight' => 0,
     'type' => MENU_DEFAULT_LOCAL_TASK,
-- 
1.8.4.2

From e25cb885438087c6af9ee8d37fedace83ddf09f1 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:48:27 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 89b422f..32e0953 100644
--- a/abuse.module
+++ b/abuse.module
@@ -272,7 +272,7 @@ function abuse_menu() {
     'page callback' => 'abuse_admin_moderate',
     'page arguments' => array(array(ABUSE_PENDING, ABUSE_HIDDEN)),
     'access callback' => 'abuse_moderation_system_access',
-    'access arguments' => array(ADMINISTER_ALL_ABUSE_REPORTS),
+    'access arguments' => array(ABUSE_ADMINISTER_ALL_ABUSE_REPORTS),
     'file' => 'abuse.admin.inc',
     'weight' => 1,
     'type' => MENU_LOCAL_TASK,
-- 
1.8.4.2

From 4570e931f3b0b163382f6c139810b6acc79886f5 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:48:39 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 32e0953..36a630f 100644
--- a/abuse.module
+++ b/abuse.module
@@ -282,7 +282,7 @@ function abuse_menu() {
     'description' => 'Manage items that were either flagged by the system or by other users',
     'page callback' => 'abuse_admin_default_callback',
     'access callback' => 'abuse_node_access',
-    'access arguments' => array(ADMINISTER_ABUSE_REPORTS, ADMINISTER_ALL_ABUSE_REPORTS),
+    'access arguments' => array(ABUSE_ADMINISTER_ABUSE_REPORTS, ABUSE_ADMINISTER_ALL_ABUSE_REPORTS),
     'file' => 'abuse.admin.inc',
   );
   $items['admin/abuse/status/%/%'] = array(
-- 
1.8.4.2

From 34d5f83465e13702bd21802a20ba11bd4d1143c0 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:48:53 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 36a630f..c4ae9c2 100644
--- a/abuse.module
+++ b/abuse.module
@@ -291,7 +291,7 @@ function abuse_menu() {
     'page callback' => 'abuse_admin_status',
     'page arguments' => array(3, 4),
     'access callback' => 'abuse_node_access',
-    'access arguments' => array(ADMINISTER_ABUSE_REPORTS, ADMINISTER_ALL_ABUSE_REPORTS),
+    'access arguments' => array(ABUSE_ADMINISTER_ABUSE_REPORTS, ABUSE_ADMINISTER_ALL_ABUSE_REPORTS),
     'file' => 'abuse.admin.inc',
   );
   return $items;
-- 
1.8.4.2

From f97505d6c7b0bbb6dcfdeb9d1ecd5766653bb477 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:49:29 +0100
Subject: [PATCH] Issue #1484470 by umtj: better formatting

---
 abuse.module | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index c4ae9c2..bba3ea8 100644
--- a/abuse.module
+++ b/abuse.module
@@ -268,7 +268,10 @@ function abuse_menu() {
   );
   $items['admin/content/abuse/remaining'] = array(
     'title callback' => 'abuse_title_callback',
-    'title arguments' => array('Remaining Items (!num)', array(ABUSE_PENDING, ABUSE_HIDDEN)),
+    'title arguments' => array(
+      'Remaining Items (!num)',
+      array(ABUSE_PENDING, ABUSE_HIDDEN),
+    ),
     'page callback' => 'abuse_admin_moderate',
     'page arguments' => array(array(ABUSE_PENDING, ABUSE_HIDDEN)),
     'access callback' => 'abuse_moderation_system_access',
-- 
1.8.4.2

From 073bf9629804194c7aac7e1ca3d40c2d4486cc49 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:49:41 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index bba3ea8..6457bfb 100644
--- a/abuse.module
+++ b/abuse.module
@@ -323,8 +323,10 @@ function abuse_theme() {
 }
 
 /**
+ * Implements template_preprocess_page().
  *
- * @param type $variables
+ * @param array $variables
+ *   Preprocess variable.
  */
 function template_preprocess_abuse_page(&$variables) {
   drupal_add_js('misc/jquery.form.js');
-- 
1.8.4.2

From f3ad831a65c8711d45825352f0f6bc89351e252c Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:49:53 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/abuse.module b/abuse.module
index 6457bfb..272a78e 100644
--- a/abuse.module
+++ b/abuse.module
@@ -335,9 +335,10 @@ function template_preprocess_abuse_page(&$variables) {
 }
 
 /**
+ * Implements template_preprocess_page().
  *
- * @staticvar int $counter
- * @param type $variables
+ * @param array $variables
+ *   Preprocess variable.
  */
 function template_preprocess_abuse_report(&$variables) {
   // TODO: What's the counter for?
-- 
1.8.4.2

From 861b1d111053f9712d1e02c5c8967fc82ad9b2ab Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:50:11 +0100
Subject: [PATCH] Issue #1484470 by umtj: better formatting

---
 abuse.module | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 272a78e..9a91879 100644
--- a/abuse.module
+++ b/abuse.module
@@ -370,7 +370,14 @@ function abuse_cron() {
 
   $last_time = variable_get('abuse_cleanup_timestamp', 0);
   if ($timestamp > $last_time) {
-    db_query('UPDATE {abuse_status} SET assigned_to_uid=0 WHERE status=:ap OR status=:ah OR status=:as', array(':ap' => ABUSE_PENDING, ':ah' => ABUSE_HIDDEN, ':as' => ABUSE_SUPERADMIN));
+    db_query(
+      'UPDATE {abuse_status} SET assigned_to_uid=0 WHERE status=:ap OR status=:ah OR status=:as',
+      array(
+        ':ap' => ABUSE_PENDING,
+        ':ah' => ABUSE_HIDDEN,
+        ':as' => ABUSE_SUPERADMIN,
+      )
+    );
   }
 
   // Clean out any and all items from abuse status that are no longer in the node, comments or users table.  Used JUST IN CASE nodeapi and comment hook do not properly delete off a node, comment or users.
-- 
1.8.4.2

From 3601c8e280bfe10d1a76207f544c7da8ff292592 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:50:24 +0100
Subject: [PATCH] Issue #1484470 by umtj: better formatting

---
 abuse.module | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/abuse.module b/abuse.module
index 9a91879..409cbd4 100644
--- a/abuse.module
+++ b/abuse.module
@@ -380,10 +380,12 @@ function abuse_cron() {
     );
   }
 
-  // Clean out any and all items from abuse status that are no longer in the node, comments or users table.  Used JUST IN CASE nodeapi and comment hook do not properly delete off a node, comment or users.
-  $result = db_query("DELETE FROM {abuse_status} WHERE type='node' AND oid NOT IN (SELECT nid FROM {node})");
-  $result = db_query("DELETE FROM {abuse_status} WHERE type='comment' AND oid NOT IN (SELECT cid FROM {comment})");
-  $result = db_query("DELETE FROM {abuse_status} WHERE type='user' AND oid NOT IN (SELECT uid FROM {users})");
+  // Clean out any and all items from abuse status that are no longer in
+  // the node, comments or users table. Used JUST IN CASE nodeapi and comment
+  // hook do not properly delete off a node, comment or users.
+  db_query("DELETE FROM {abuse_status} WHERE type='node' AND oid NOT IN (SELECT nid FROM {node})");
+  db_query("DELETE FROM {abuse_status} WHERE type='comment' AND oid NOT IN (SELECT cid FROM {comment})");
+  db_query("DELETE FROM {abuse_status} WHERE type='user' AND oid NOT IN (SELECT uid FROM {users})");
 }
 
 
-- 
1.8.4.2

From b7b4b9325cc6622ce5a6f5da79caa12bf43346e3 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:50:39 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 409cbd4..4ff911a 100644
--- a/abuse.module
+++ b/abuse.module
@@ -401,7 +401,7 @@ function abuse_entity_view($entity, $type, $view_mode, $langcode) {
   }
 
   if (isset($entity->nid) && $view_mode != 'teaser' && $type != 'comment') {
-    if (user_access(ADMINISTER_ABUSE_REPORTS) && variable_get(ABUSE_ENTITY_TYPE . $entity->type, 0)) {
+    if (user_access(ABUSE_ADMINISTER_ABUSE_REPORTS) && variable_get(ABUSE_ENTITY_TYPE . $entity->type, 0)) {
       $links['abuse_node_history'] = array(
         'title' => t('View abuse history'),
         'href' => 'admin/abuse/status/node/' . $entity->nid,
-- 
1.8.4.2

From 1c1498520abab556ee0f8c09bca173cdd99f4645 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:50:54 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 4ff911a..ed7129c 100644
--- a/abuse.module
+++ b/abuse.module
@@ -408,7 +408,7 @@ function abuse_entity_view($entity, $type, $view_mode, $langcode) {
         'attributes' => array('class' => 'node-history'),
       );
     }
-    if (variable_get(ABUSE_ENTITY_TYPE . $entity->type, 0) && (user_access(REPORT_ABUSE) || user_access(DIRECT_FLAG))) {
+    if (variable_get(ABUSE_ENTITY_TYPE . $entity->type, 0) && (user_access(ABUSE_REPORT_ABUSE) || user_access(ABUSE_DIRECT_FLAG))) {
       if (user_is_logged_in() && ($user->uid != $entity->uid)) {
         // @TODO Convert to similar: has_rows = (bool) db_query_range('SELECT 1 FROM {mytable}', 0, 1)->fetchField();
         $already_reported_check = db_query("SELECT COUNT(*) FROM {abuse} WHERE type = :type AND oid = :oid AND uid = :uid", array(
-- 
1.8.4.2

From eeab3e16791fe1f584ef52d29c51280b11b30ecf Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:51:11 +0100
Subject: [PATCH] Issue #1484470 by umtj: better formatting

---
 abuse.module | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/abuse.module b/abuse.module
index ed7129c..471e149 100644
--- a/abuse.module
+++ b/abuse.module
@@ -411,11 +411,14 @@ function abuse_entity_view($entity, $type, $view_mode, $langcode) {
     if (variable_get(ABUSE_ENTITY_TYPE . $entity->type, 0) && (user_access(ABUSE_REPORT_ABUSE) || user_access(ABUSE_DIRECT_FLAG))) {
       if (user_is_logged_in() && ($user->uid != $entity->uid)) {
         // @TODO Convert to similar: has_rows = (bool) db_query_range('SELECT 1 FROM {mytable}', 0, 1)->fetchField();
-        $already_reported_check = db_query("SELECT COUNT(*) FROM {abuse} WHERE type = :type AND oid = :oid AND uid = :uid", array(
+        $already_reported_check = db_query(
+          "SELECT COUNT(*) FROM {abuse} WHERE type = :type AND oid = :oid AND uid = :uid",
+          array(
             ':type' => $type,
             ':oid' => $entity->nid,
-            ':uid' => $user->uid
-          ))->fetchField();
+            ':uid' => $user->uid,
+          ))
+          ->fetchField();
         if (!$already_reported_check > 0) {
           $links['abuse_flag_node'] = array(
             'title' => t('Flag as offensive'),
-- 
1.8.4.2

From 0914ae6cb9d887b496683e08a74fbb89d1248729 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:51:26 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 471e149..ed3074c 100644
--- a/abuse.module
+++ b/abuse.module
@@ -444,7 +444,7 @@ function abuse_entity_view($entity, $type, $view_mode, $langcode) {
   }
   elseif ($type == 'comment' &&
     variable_get(ABUSE_CONTENT_COMMENTS, 0) &&
-    (user_access(REPORT_ABUSE) || user_access(DIRECT_FLAG))
+    (user_access(ABUSE_REPORT_ABUSE) || user_access(ABUSE_DIRECT_FLAG))
   ) {
     // Commented out as a temporary solution to ticket 178:
     // https://office.zincroe.com/zimmertwins/ticket/178
-- 
1.8.4.2

From 208e112cd801a12b58652648a56ecb02af04e344 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:51:49 +0100
Subject: [PATCH] Issue #1484470 by umtj: better formatting

---
 abuse.module | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/abuse.module b/abuse.module
index ed3074c..d31071d 100644
--- a/abuse.module
+++ b/abuse.module
@@ -449,24 +449,24 @@ function abuse_entity_view($entity, $type, $view_mode, $langcode) {
     // Commented out as a temporary solution to ticket 178:
     // https://office.zincroe.com/zimmertwins/ticket/178
     //
-//    if (user_access(ADMINISTER_ABUSE_REPORTS)) {
-//      $links['abuse_comment_history'] = array(
-//        'title' => t('View abuse history'),
-//        'href' => 'admin/abuse/status/comment/'. $object->cid,
-//        'attributes' => array('class' => 'node-history'),
-//      );
-//    }
+    // if (user_access(ADMINISTER_ABUSE_REPORTS)) {
+    //   $links['abuse_comment_history'] = array(
+    //     'title' => t('View abuse history'),
+    //     'href' => 'admin/abuse/status/comment/'. $object->cid,
+    //     'attributes' => array('class' => 'node-history'),
+    //    );
+    // }
     if ($user->uid && ($user->uid != $entity->uid)) {
       // @TODO Convert to similar: has_rows = (bool) db_query_range('SELECT 1 FROM {mytable}', 0, 1)->fetchField();
       $already_reported_check = db_query("SELECT COUNT(*) FROM {abuse} WHERE type = :type AND oid = :oid AND uid = :uid", array(
-          ':type' => $type,
-          ':oid' => $entity->cid,
-          ':uid' => $user->uid
-        ))->fetchField();
+        ':type' => $type,
+        ':oid' => $entity->cid,
+        ':uid' => $user->uid,
+      ))->fetchField();
       if ($already_reported_check > 0) {
-//        $links['abuse_already_flagged'] = array(
-//          'title' => t('This comment is currently under review'),
-//        );
+        // $links['abuse_already_flagged'] = array(
+        // 'title' => t('This comment is currently under review'),
+        // );
       }
       else {
         $links['abuse_flag_comment'] = array(
-- 
1.8.4.2

From af6c784f15dba1b3b6fe497f65426ddea9dc23a0 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:52:03 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index d31071d..1334e7b 100644
--- a/abuse.module
+++ b/abuse.module
@@ -506,7 +506,7 @@ function abuse_node_load($nodes, $types) {
   $nids = array_keys($nodes);
   $nid = $nids[0];
   $node = $nodes[$nid];
-  if (user_access(ADMINISTER_ABUSE_REPORTS) || user_access(ADMINISTER_ALL_ABUSE_REPORTS)) {
+  if (user_access(ABUSE_ADMINISTER_ABUSE_REPORTS) || user_access(ABUSE_ADMINISTER_ALL_ABUSE_REPORTS)) {
     return array('abuse_status' => intval(_abuse_get_object_status('node', $node->nid)));
   }
 }
-- 
1.8.4.2

From 7bc0dd3d24847bbb1ee70d0872d83a4279ad211b Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:52:44 +0100
Subject: [PATCH] Issue #1484470 by umtj: better formatting and cleanup

---
 abuse.module | 97 +++++++++++++++++++++++-------------------------------------
 1 file changed, 37 insertions(+), 60 deletions(-)

diff --git a/abuse.module b/abuse.module
index 1334e7b..bde7a10 100644
--- a/abuse.module
+++ b/abuse.module
@@ -511,90 +511,67 @@ function abuse_node_load($nodes, $types) {
   }
 }
 
-
 /**
  * Implements hook_node_delete().
+ *
+ * Delete abuse flags.
  */
 function abuse_node_delete($node) {
-  // Delete abuse flags
   _abuse_cleanup_content('node', $node->nid);
 }
 
-
-/**
- * Implements hook_nodeapi().
- */
-// @TODO Depreciated, remove
-//function abuse_nodeapi_OLD(&$node, $op, $teaser = NULL, $page = NULL) { }
-
-
-/**
- * Implements hook_comment_view().
- */
-/*function abuse_comment_view($comment) {
-  if (user_access(ADMINISTER_ABUSE_REPORTS) || user_access(ADMINISTER_ALL_ABUSE_REPORTS)) {
-    $comment->abuse_status = intval(_abuse_get_object_status('comment', $comment->cid));
-  }
-  return $comment;
-}*/
-
-
 /**
  * Implements hook_comment_delete().
+ *
+ * Delete abuse_flags.
  */
 function abuse_comment_delete($comment) {
-  // Delete abuse_flags
   _abuse_cleanup_content('comment', $comment->cid);
 }
 
-
-/**
- * Implements hook_comment().
- */
-function abuse_comment_OLD($comment, $op) { }
-
-
-/**
- * Implements hook_user_XXX().
- */
-function abuse_user_XXX($edit, $account) {
-  if (user_is_blocked($account->name) && user_access('administer users')) {
-    $replacement = array(
-      '!link' => l(t('here'), "admin/abuse/unban/$account->uid"),
-      '@username' => $account->name,
-    );
-    $form['unban'] = array(
-      '#type' => 'item',
-      '#value' => t('Click !link to unban @username.', $replacement),
-      '#weight' => -20,
-    );
-    return $form;
-  }
-}
-
-
 /**
- * Implements hook_user().
- */
-function abuse_user_OLD($op, &$edit, &$account, $category = NULL) { }
-
-
-/**
- * Clean out content from the abuse tables - useful when a node/comment/user gets deleted
+ * Clean out content from the abuse tables.
+ *
+ * This useful when a node/comment/user gets deleted.
  *
- * @param $type
- * @param $oid
+ * @param string $type
+ *   Type of abuse.
+ *
+ * @param int $oid
+ *   Oid.
  */
 function _abuse_cleanup_content($type, $oid) {
-  $result = db_query("DELETE FROM {abuse} WHERE oid = :oid AND type = :type", array(':oid' => $oid, ':type' => $type));
-  $result = db_query("DELETE FROM {abuse_status} WHERE :oid AND type = :type", array(':oid' => $oid, ':type' => $type));
-  $result = db_query("DELETE FROM {abuse_warnings} WHERE :oid AND type = :type", array(':oid' => $oid, ':type' => $type));
+  db_query(
+    "DELETE FROM {abuse} WHERE oid = :oid AND type = :type",
+    array(
+      ':oid' => $oid,
+      ':type' => $type,
+    )
+  );
+
+  db_query(
+    "DELETE FROM {abuse_status} WHERE :oid AND type = :type",
+    array(
+      ':oid' => $oid,
+      ':type' => $type,
+    )
+  );
+
+  db_query(
+    "DELETE FROM {abuse_warnings} WHERE :oid AND type = :type",
+    array(
+      ':oid' => $oid,
+      ':type' => $type,
+    )
+  );
 }
 
 
 /**
+ * Helper function for Abuse formulars.
  *
  * @return string
+ *   Formular.
  */
 function abuse_forms() {
   $args = func_get_args();
-- 
1.8.4.2

From 96f94b54d4e389cec0eb2fe958502f523bc621b2 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:53:02 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/abuse.module b/abuse.module
index bde7a10..645eb5e 100644
--- a/abuse.module
+++ b/abuse.module
@@ -593,9 +593,7 @@ function abuse_forms() {
 
 /**
  *
- * @param <type> $form
- * @param <type> $form_state
- * @param <type> $form_id
+ * Implements hook_form_alter().
  */
 function abuse_form_alter(&$form, &$form_state, $form_id) {
   if ('node_type_form' == $form_id) {
-- 
1.8.4.2

From b1a49436e6a8430b54ffff3e8f0f7cbaa4b33786 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:53:15 +0100
Subject: [PATCH] Issue #1484470 by umtj: better formatting

---
 abuse.module | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 645eb5e..feb8eeb 100644
--- a/abuse.module
+++ b/abuse.module
@@ -605,7 +605,10 @@ function abuse_form_alter(&$form, &$form_state, $form_id) {
       '#collapsed' => TRUE,
     );
     $sub_form = array(
-      '#title' => t('Allow Abuse Module flagging for @type nodes', array('@type' => $form['#node_type']->name)),
+      '#title' => t(
+        'Allow Abuse Module flagging for @type nodes',
+        array('@type' => $form['#node_type']->name)
+      ),
       '#type' => 'checkbox',
       '#return_value' => 1,
       '#default_value' => variable_get(ABUSE_CONTENT_NODE_TYPE . $type, 0),
-- 
1.8.4.2

From 4248021e9d9048b7795946bce53c326a1cbe25c0 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:53:29 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/abuse.module b/abuse.module
index feb8eeb..07ce04f 100644
--- a/abuse.module
+++ b/abuse.module
@@ -632,11 +632,8 @@ function abuse_form_alter(&$form, &$form_state, $form_id) {
   }
 }
 
-
 /**
- *
- * @param <type> $form
- * @param <type> $form_state
+ * Implements hook_form_submit().
  */
 function abuse_node_type_form_submit($form, &$form_state) {
   if (isset($form['#node_type']->type)) {
-- 
1.8.4.2

From 56d8ee3ca0004828a215731fd98f97391dd7fa88 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:53:44 +0100
Subject: [PATCH] Issue #1484470 by umtj: better formatting and cleanup

---
 abuse.module | 34 +++++++---------------------------
 1 file changed, 7 insertions(+), 27 deletions(-)

diff --git a/abuse.module b/abuse.module
index 07ce04f..cb0bc4b 100644
--- a/abuse.module
+++ b/abuse.module
@@ -642,36 +642,16 @@ function abuse_node_type_form_submit($form, &$form_state) {
   }
 }
 
-
 /**
+ * Report function.
  *
- * @param <type> $title
- * @param <type> $type
- * @return <type>
- */
-function abuse_title_callback($title, $type = array()) {
-  return t($title, array('!num' => _abuse_get_tallied_count($type)));
-}
-
-
-/**
- *
- * @param <type> $title
- * @return <type>
- */
-function abuse_title_assigned_callback($title) {
-  $assigned = _abuse_get_assigned_count(FALSE);
-  $remaining = _abuse_get_assigned_pending_count(FALSE);
-  return t($title, array('!assigned' => $assigned, '!remaining' => $remaining));
-}
-
-
-/**
+ * @param string $type
+ *   Abuse type.
  *
- * @global $user $user
- * @param <type> $type
- * @param <type> $oid
- * @return <type>
+ * @param int $oid
+ *   Oid.
+ * @return array
+ *   Drupal formular.
  */
 function abuse_report($type, $oid) {
   global $user;
-- 
1.8.4.2

From 7b1ef1f75883061584b0df59cb468dd82b8821be Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:53:57 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/abuse.module b/abuse.module
index cb0bc4b..fd6f153 100644
--- a/abuse.module
+++ b/abuse.module
@@ -681,12 +681,7 @@ function abuse_report($type, $oid) {
 
 
 /**
- *
- * @param <type> $form
- * @param <type> $form_state
- * @param <type> $object
- * @param <type> $user
- * @return <type>
+ * Implements hook_form().
  */
 function abuse_report_form($form, &$form_state, $object, $user) {
   $form = array();
-- 
1.8.4.2

From 0b1cce05f3e3d9d14061168430f4b175608d7406 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:54:21 +0100
Subject: [PATCH] Issue #1484470 by umtj: be sure array exisit

---
 abuse.module | 1 +
 1 file changed, 1 insertion(+)

diff --git a/abuse.module b/abuse.module
index fd6f153..baeb9af 100644
--- a/abuse.module
+++ b/abuse.module
@@ -733,6 +733,7 @@ function abuse_report_form($form, &$form_state, $object, $user) {
   );
 
   $reason_objects = _abuse_reasons();
+  $reasons = array();
   foreach ($reason_objects as $reason) {
     $reasons[$reason->arid] = t($reason->reason);
   }
-- 
1.8.4.2

From 17ec15dce2e6bd6ce42778d116dde720bc406a59 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:54:29 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/abuse.module b/abuse.module
index baeb9af..2a89384 100644
--- a/abuse.module
+++ b/abuse.module
@@ -763,9 +763,7 @@ function abuse_report_form($form, &$form_state, $object, $user) {
 
 
 /**
- *
- * @param <type> $form
- * @param <type> $form_state
+ * Implements hook_form_validate().
  */
 function abuse_report_form_validate($form, &$form_state) {
   $form_values = $form_state['values'];
-- 
1.8.4.2

From 840bc6ad10dc08fc2bfada6645a06e13f2a64323 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:54:50 +0100
Subject: [PATCH] Issue #1484470 by umtj: removed 'no links please'

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 2a89384..f28849d 100644
--- a/abuse.module
+++ b/abuse.module
@@ -779,7 +779,7 @@ function abuse_report_form_validate($form, &$form_state) {
     }
     $body = trim(drupal_strtolower($form_values['body']));
     if (empty($body)) {
-      form_set_error('body', t('Please provide a more detailed description - no links please.'));
+      form_set_error('body', t('Please provide a more detailed description.'));
     }
     elseif (
       strpos($body, 'href=') !== FALSE ||
-- 
1.8.4.2

From 7fb59fb29e4b844ba567fa52bf922755e5a65d07 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:54:56 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/abuse.module b/abuse.module
index f28849d..054b24e 100644
--- a/abuse.module
+++ b/abuse.module
@@ -793,10 +793,7 @@ function abuse_report_form_validate($form, &$form_state) {
 
 
 /**
- *
- * @global $user $user
- * @param <type> $form
- * @param <type> $form_state
+ * Implements hook_form_submit().
  */
 function abuse_report_form_submit($form, &$form_state) {
   global $user;
-- 
1.8.4.2

From 79e8348ab1083c5888534b053ce3059a90be21cd Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:55:09 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 054b24e..decab2c 100644
--- a/abuse.module
+++ b/abuse.module
@@ -806,7 +806,7 @@ function abuse_report_form_submit($form, &$form_state) {
   if (!$object) {
     drupal_not_found();
   }
-  // Object was found - system is alright from this point
+  // Object was found system is alright from this point.
   $form_state['redirect'] = $object->link;
   $errors = ($form_values['op'] == t('cancel')) ? TRUE : FALSE;
   if ($user->uid) {
-- 
1.8.4.2

From a4860133f834da52f1f4e4b1980f68bb48facd87 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:55:24 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index decab2c..c796a36 100644
--- a/abuse.module
+++ b/abuse.module
@@ -815,7 +815,7 @@ function abuse_report_form_submit($form, &$form_state) {
       drupal_set_message(t('We have already received your report.  Thank you very much!'));
       $errors = TRUE;
     }
-    // ENSURE USER IS NOT TRYING TO FLAG OWN CONTENT
+    // TODO: ENSURE USER IS NOT TRYING TO FLAG OWN CONTENT.
     if ($user->uid == $object->uid) {
       drupal_set_message(t('You cannot flag your own content'));
       $errors = TRUE;
-- 
1.8.4.2

From 1b1ca600d1ba4b2ba3ec321f7faad38b58226861 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:55:45 +0100
Subject: [PATCH] Issue #1484470 by umtj: better formatting

---
 abuse.module | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/abuse.module b/abuse.module
index c796a36..dfe2cee 100644
--- a/abuse.module
+++ b/abuse.module
@@ -825,17 +825,18 @@ function abuse_report_form_submit($form, &$form_state) {
     // TODO Please review the conversion of this statement to the D7 database API syntax.
     /* db_query("INSERT INTO {abuse} (type, oid, created, body, reason, uid, name, mail) VALUES ('%s', %d, %d, '%s', '%s', %d, '%s', '%s')", $type, $oid, REQUEST_TIME, $form_values['body'], $form_values['reason'], $user->uid, $form_values['name'], $form_values['mail']) */
     $id = db_insert('abuse')
-  ->fields(array(
-    'type' => $type,
-    'oid' => $oid,
-    'created' => REQUEST_TIME,
-    'body' => $form_values['body'],
-    'reason' => $form_values['reason'],
-    'uid' => $user->uid,
-    'name' => $form_values['name'],
-    'mail' => $form_values['mail'],
-  ))
-  ->execute();
+      ->fields(array(
+        'type' => $type,
+        'oid' => $oid,
+        'created' => REQUEST_TIME,
+        'body' => $form_values['body'],
+        'reason' => $form_values['reason'],
+        'uid' => $user->uid,
+        'name' => $form_values['name'],
+        'mail' => $form_values['mail'],
+      ))
+      ->execute();
+
     _abuse_set_status($type, $oid, ABUSE_PENDING);
     $result = _abuse_disable($type, $oid);
     // Call the sequencer for sequencing content
-- 
1.8.4.2

From cc6a34f344176b73b1f296dd8617bd26cb30e99a Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:55:53 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index dfe2cee..dd19b8f 100644
--- a/abuse.module
+++ b/abuse.module
@@ -839,7 +839,7 @@ function abuse_report_form_submit($form, &$form_state) {
 
     _abuse_set_status($type, $oid, ABUSE_PENDING);
     $result = _abuse_disable($type, $oid);
-    // Call the sequencer for sequencing content
+    // Call the sequencer for sequencing content.
     if ($result) {
       drupal_set_message(t('Thank you for your report.  We will look into this shortly.'));
       $form_state['redirect'] = '';
-- 
1.8.4.2

From b024bcc6f425c308daa4fbafeca7c21c30032163 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:56:05 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/abuse.module b/abuse.module
index dd19b8f..4c7553c 100644
--- a/abuse.module
+++ b/abuse.module
@@ -851,16 +851,18 @@ function abuse_report_form_submit($form, &$form_state) {
 }
 
 /**
- * PRIVATE FUNCTIONS
- */
-
-/**
+ * Load abuse content.
+ *
+ * Load the fully entity to work with abuse.
+ *
  * @param string $entity_type
  *   Type of entity. *
+ *
  * @param int $entity_id
  *  Entity ID.
  *
- * @return <type>
+ * @return object
+ *   The abuse object.
  */
 function _abuse_load($entity_type, $entity_id) {
   $entity = entity_load_single($entity_type, $entity_id);
-- 
1.8.4.2

From b42104ecb7aba660c0af1c7b204ea8cd156cd8da Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:56:24 +0100
Subject: [PATCH] Issue #1484470 by umtj: cleanup

---
 abuse.module | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/abuse.module b/abuse.module
index 4c7553c..d0fca1f 100644
--- a/abuse.module
+++ b/abuse.module
@@ -902,6 +902,7 @@ function _abuse_load($entity_type, $entity_id) {
       );
       $entity->link = 'node/' . $entity->nid;
       break;
+
     case 'comment':
       $comment_body = $wrapper->comment_body->value();
       $object->content = $comment_body['value'];
@@ -916,6 +917,7 @@ function _abuse_load($entity_type, $entity_id) {
       );
       $object->link = 'node/' . $entity->nid . '#comment-' . $entity->cid;
       break;
+
     case 'user':
       user_build_content($account);
       $object->title = check_plain($account->name);
-- 
1.8.4.2

From 01729ed3faf1ae1e4aea8af8319da304a99eb3fc Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:56:38 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/abuse.module b/abuse.module
index d0fca1f..f42472d 100644
--- a/abuse.module
+++ b/abuse.module
@@ -937,10 +937,16 @@ function _abuse_load($entity_type, $entity_id) {
 
 
 /**
+ * Load abuse reports.
  *
- * @param <type> $type
- * @param <type> $oid
- * @return <type>
+ * @param string $type
+ *   Abuse type.
+ *
+ * @param int $oid
+ *   Oid.
+ *
+ * @return array
+ *   Reports.
  */
 function _abuse_load_reports($type, $oid) {
   $reports = array();
-- 
1.8.4.2

From ebc55dd067827292eb863a054d1dd4bad1bb75c6 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:56:51 +0100
Subject: [PATCH] Issue #1484470 by umtj: better formatting

---
 abuse.module | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index f42472d..eeb4478 100644
--- a/abuse.module
+++ b/abuse.module
@@ -950,7 +950,14 @@ function _abuse_load($entity_type, $entity_id) {
  */
 function _abuse_load_reports($type, $oid) {
   $reports = array();
-  $result = db_query("SELECT a.*, u.name as registered_name, u.uid FROM {abuse} a INNER JOIN {users} u ON u.uid = a.uid WHERE a.type = :type AND a.oid = :oid", array(':type' => $type, ':oid' => $oid));
+  $result = db_query(
+    "SELECT a.*, u.name as registered_name, u.uid FROM {abuse} a INNER JOIN {users} u ON u.uid = a.uid WHERE a.type = :type AND a.oid = :oid",
+    array(
+      ':type' => $type,
+      ':oid' => $oid,
+    )
+  );
+
   foreach ($result as $report) {
     $report->name = $report->uid ? $report->registered_name : $report->name;
     $reports[] = $report;
-- 
1.8.4.2

From a41112c05631fde2b3305c9131aad23cb54c0dd2 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:57:07 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/abuse.module b/abuse.module
index eeb4478..469ce2d 100644
--- a/abuse.module
+++ b/abuse.module
@@ -967,10 +967,16 @@ function _abuse_load_reports($type, $oid) {
 
 
 /**
+ * Load abuse history.
  *
- * @param <type> $type
- * @param <type> $oid
- * @return <type>
+ * @param string $type
+ *   Abuse type.
+ *
+ * @param int $oid
+ *   Oid.
+ *
+ * @return array
+ *   History.
  */
 function _abuse_load_history($type, $oid) {
   $history = array();
-- 
1.8.4.2

From 027cad14fdec032d5a9d45429ee292195ed30517 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:57:15 +0100
Subject: [PATCH] Issue #1484470 by umtj: better formatting

---
 abuse.module | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/abuse.module b/abuse.module
index 469ce2d..1a2df64 100644
--- a/abuse.module
+++ b/abuse.module
@@ -980,8 +980,14 @@ function _abuse_load_reports($type, $oid) {
  */
 function _abuse_load_history($type, $oid) {
   $history = array();
-  $result = db_query("SELECT a.*, u.name as flagger FROM {abuse_status_log} a INNER JOIN {users} u ON u.uid=a.uid WHERE a.type = :type AND a.oid = :oid ORDER BY timestamp DESC", array(':type' => $type, ':oid' => $oid));
-  //while ($log = db_fetch_object($result)) {
+  $result = db_query(
+    "SELECT a.*, u.name as flagger FROM {abuse_status_log} a INNER JOIN {users} u ON u.uid=a.uid WHERE a.type = :type AND a.oid = :oid ORDER BY timestamp DESC",
+    array(
+      ':type' => $type,
+      ':oid' => $oid,
+    )
+  );
+
   foreach ($result as $log) {
     $log->readable_status = _abuse_retrieve_status($log->status);
     $history[] = $log;
-- 
1.8.4.2

From f7c5a065bb5cd83e6eb8faa42c15c3b2fa5b8038 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:57:25 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/abuse.module b/abuse.module
index 1a2df64..9e56e86 100644
--- a/abuse.module
+++ b/abuse.module
@@ -997,10 +997,16 @@ function _abuse_load_history($type, $oid) {
 
 
 /**
+ * Load abuse warnings.
  *
- * @param <type> $type
- * @param <type> $oid
- * @return <type>
+ * @param string $type
+ *   Abuse type.
+ *
+ * @param int $oid
+ *   Oid.
+ *
+ * @return array
+ *   Warnings.
  */
 function _abuse_load_warnings($type, $oid) {
   $warnings = array();
-- 
1.8.4.2

From 9da648f0e5d863c916e626297d033756a00a6860 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:57:42 +0100
Subject: [PATCH] Issue #1484470 by umtj: better formatting and cleanup

---
 abuse.module | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/abuse.module b/abuse.module
index 9e56e86..972621d 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1010,9 +1010,15 @@ function _abuse_load_history($type, $oid) {
  */
 function _abuse_load_warnings($type, $oid) {
   $warnings = array();
-  $result = db_query("SELECT a.*, u.name FROM {abuse_warnings} a INNER JOIN {users} u ON a.sent_by_uid=u.uid WHERE a.type = :type AND a.oid = :oid ORDER BY created DESC", array(':type' => $type, ':oid' => $oid));
+  $result = db_query(
+    "SELECT a.*, u.name FROM {abuse_warnings} a INNER JOIN {users} u ON a.sent_by_uid=u.uid WHERE a.type = :type AND a.oid = :oid ORDER BY created DESC",
+    array(
+      ':type' => $type,
+      ':oid' => $oid,
+    )
+  );
+
   foreach ($result as $warning) {
-  // while ($warning = db_fetch_object($result)) {
     $warning->date = date("d/m/Y - h:i", $warning->created);
     $warning->name = (empty($warning->name)) ? t('Anonymous Admin') : $warning->name;
     $warnings[] = $warning;
-- 
1.8.4.2

From 8230433809fd6c1aa47bef32416b7154450cf9c6 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:57:53 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/abuse.module b/abuse.module
index 972621d..bc3c0c8 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1028,10 +1028,13 @@ function _abuse_load_warnings($type, $oid) {
 
 
 /**
+ * Offence count.
  *
- * @staticvar <type> $offences_count
- * @param <type> $uid
- * @return <type>
+ * @param int $uid
+ *   User ID.
+ *
+ * @return int
+ *   Offences count.
  */
 function _abuse_get_offence_count($uid) {
   static $offences_count;
-- 
1.8.4.2

From 6f6107774cf8a34c420c707b6f8e227ab2106a33 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:58:12 +0100
Subject: [PATCH] Issue #1484470 by umtj: better formatting

---
 abuse.module | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/abuse.module b/abuse.module
index bc3c0c8..09f5876 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1039,8 +1039,22 @@ function _abuse_load_warnings($type, $oid) {
 function _abuse_get_offence_count($uid) {
   static $offences_count;
   if (!isset($offences_count["uid-$uid"])) {
-    $offences_count["uid-$uid"] = db_query("SELECT count(*) FROM {node} n INNER JOIN {abuse_status} a ON a.oid=n.nid WHERE a.type = :type AND n.uid = :uid AND a.status = :status", array('type' => 'node', ':uid' => $uid, 'status' => ABUSE_REMOVED))->fetchField();
-    $offences_count["uid-$uid"] += db_query("SELECT count(*) FROM {comment} c INNER JOIN {abuse_status} a ON a.oid=c.cid WHERE a.type = :type AND c.uid = :uid AND a.status = :status", array(':type' => 'comment', ':uid' => $uid, ':status' => ABUSE_REMOVED))->fetchField();
+    $offences_count["uid-$uid"] = db_query(
+      "SELECT count(*) FROM {node} n INNER JOIN {abuse_status} a ON a.oid=n.nid WHERE a.type = :type AND n.uid = :uid AND a.status = :status",
+      array(
+        'type' => 'node',
+        ':uid' => $uid,
+        'status' => ABUSE_REMOVED,
+      ))
+      ->fetchField();
+    $offences_count["uid-$uid"] += db_query(
+      "SELECT count(*) FROM {comment} c INNER JOIN {abuse_status} a ON a.oid=c.cid WHERE a.type = :type AND c.uid = :uid AND a.status = :status",
+      array(
+        ':type' => 'comment',
+        ':uid' => $uid,
+        ':status' => ABUSE_REMOVED,
+      ))
+      ->fetchField();
   }
   return $offences_count["uid-$uid"];
 }
-- 
1.8.4.2

From 493e052d74183ed7944c3b56784eecba37b552a0 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:58:39 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/abuse.module b/abuse.module
index 09f5876..354c526 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1061,10 +1061,13 @@ function _abuse_get_offence_count($uid) {
 
 
 /**
+ * Warning count.
  *
- * @staticvar <type> $warnings_count
- * @param <type> $uid
- * @return <type>
+ * @param int $uid
+ *   User ID.
+ *
+ * @return int
+ *   Warning count.
  */
 function _abuse_get_warning_count($uid) {
   static $warnings_count;
-- 
1.8.4.2

From 40aefa53abc60a976f3b14fe1abf284face68c5c Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:58:50 +0100
Subject: [PATCH] Issue #1484470 by umtj: better formatting

---
 abuse.module | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 354c526..a5dbbed 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1072,7 +1072,10 @@ function _abuse_get_offence_count($uid) {
 function _abuse_get_warning_count($uid) {
   static $warnings_count;
   if (!isset($warnings_count["uid-$uid"])) {
-    $warnings_count["uid-$uid"] = db_query('SELECT count(*) FROM {abuse_warnings} WHERE uid = :uid', array(':uid' => $uid))->fetchField();
+    $warnings_count["uid-$uid"] = db_query(
+      'SELECT count(*) FROM {abuse_warnings} WHERE uid = :uid',
+      array(':uid' => $uid))
+      ->fetchField();
   }
   return $warnings_count["uid-$uid"];
 }
-- 
1.8.4.2

From 2f00c30260c33feeb2023e648c2e4410aad42f80 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:59:02 +0100
Subject: [PATCH] Issue #1484470 by umtj: better formatting and cleanup

---
 abuse.module | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/abuse.module b/abuse.module
index a5dbbed..703cd2e 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1082,17 +1082,19 @@ function _abuse_get_warning_count($uid) {
 
 
 /**
+ * Load abuse reasons.
  *
- * @staticvar <type> $reasons
- * @param <type> $arid
- * @return <type>
+ * @param int $arid
+ *   Arid.
+ *
+ * @return array
+ *   Reasons.
  */
 function _abuse_reasons($arid = NULL) {
   static $reasons;
   if (!$reasons) {
     $reasons = array();
     $resultset = db_query("SELECT * FROM {abuse_reasons}");
-    //while ($reason = db_fetch_object($resultset)) {
     foreach ($resultset as $reason) {
       $reasons["reason-$reason->arid"] = $reason;
     }
-- 
1.8.4.2

From 467da7bbf7b2e137faa68edb7ebf88d07d45bf25 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:59:31 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/abuse.module b/abuse.module
index 703cd2e..2469da9 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1107,10 +1107,12 @@ function _abuse_reasons($arid = NULL) {
 
 
 /**
+ * Count assigned.
  *
- * @global  $user
- * @param <type> $status
- * @return <type>
+ * @param bool $status
+ *   Status.
+ * @return int
+ *   Assigned count.
  */
 function _abuse_get_assigned_count($status = FALSE) {
   // global $user;
-- 
1.8.4.2

From 9220893994ee22d8ceb58eb06b9afdab013cc194 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 13:59:49 +0100
Subject: [PATCH] Issue #1484470 by umtj: better formatting and cleanup

---
 abuse.module | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/abuse.module b/abuse.module
index 2469da9..bfcddaf 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1115,24 +1115,23 @@ function _abuse_reasons($arid = NULL) {
  *   Assigned count.
  */
 function _abuse_get_assigned_count($status = FALSE) {
-  // global $user;
-  $user = $GLOBALS['user'];
+  global $user;
   $result = 0;
   if ($status !== FALSE) {
     // TODO Please review the conversion of this statement to the D7 database API syntax.
-     //db_query("UPDATE {abuse_status} SET assigned_to_uid=%d WHERE (assigned_to_uid=0 OR assigned_to_uid=%d) AND status=%d ORDER BY assigned_to_uid DESC, oid DESC LIMIT %d", $user->uid, $user->uid, $status, variable_get('abuse_num_assigned', 20));
+    //db_query("UPDATE {abuse_status} SET assigned_to_uid=%d WHERE (assigned_to_uid=0 OR assigned_to_uid=%d) AND status=%d ORDER BY assigned_to_uid DESC, oid DESC LIMIT %d", $user->uid, $user->uid, $status, variable_get('abuse_num_assigned', 20));
     $query = db_update('abuse_status')
-  ->fields(array(
-    'assigned_to_uid' => $user->uid,
-  ))
-    ->db_or()
-    ->condition('assigned_to_uid', '0', '=')
-    ->condition('assigned_to_uid', $user->uid, '=')
-    ->condition('status', $status, '=')
-    ->orderBy('assigned_to_uid', 'DESC')
-    ->orderBy('oid', 'DESC')
-    ->range(0, variable_get('abuse_num_assigned', 20));
-    var_dump($query);
+      ->fields(array(
+        'assigned_to_uid' => $user->uid,
+      ))
+      ->db_or()
+      ->condition('assigned_to_uid', '0', '=')
+      ->condition('assigned_to_uid', $user->uid, '=')
+      ->condition('status', $status, '=')
+      ->orderBy('assigned_to_uid', 'DESC')
+      ->orderBy('oid', 'DESC')
+      ->range(0, variable_get('abuse_num_assigned', 20));
+    //var_dump($query);
     $result = $query->execute();
 // ->where('(assigned_to_uid=0 OR assigned_to_uid=%d)
 // AND status=%d
-- 
1.8.4.2

From 69fe2a749726cd45016add08c7fa247e830606e0 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 14:00:02 +0100
Subject: [PATCH] Issue #1484470 by umtj: better formatting and cleanup

---
 abuse.module | 44 ++++++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/abuse.module b/abuse.module
index bfcddaf..e061c58 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1155,28 +1155,28 @@ function _abuse_get_assigned_count($status = FALSE) {
           ':status2' => ABUSE_HIDDEN,
           ':status3' => ABUSE_SUPERADMIN,
           //':limit' => variable_get('abuse_num_assigned', 20),
-          )
-        );
-  /*    $query = db_update('abuse_status')
-  ->fields(array(
-    'assigned_to_uid' => $user->uid,
-  ))
-  ->db_or()
-  ->condition('assigned_to_uid', '0', '=')
-  ->condition('assigned_to_uid', $user->uid, '=')
-  ->db_and()
-  ->db_or()
-  ->condition('status', ABUSE_PENDING, '=')
-  ->db_or()
-  ->condition('status', ABUSE_HIDDEN, '=')
-  ->db_or()
-  ->condition('status', 'ABUSE_SUPERADMIN', '=')
-  ->orderBy('assigned_to_uid', 'DESC')
-  ->orderBy('oid', 'DESC')
-  ->range(0, variable_get('abuse_num_assigned', 20));
-      var_dump($query);
-  $result = $query->execute();
-   */
+        )
+      );
+      /*    $query = db_update('abuse_status')
+      ->fields(array(
+        'assigned_to_uid' => $user->uid,
+      ))
+      ->db_or()
+      ->condition('assigned_to_uid', '0', '=')
+      ->condition('assigned_to_uid', $user->uid, '=')
+      ->db_and()
+      ->db_or()
+      ->condition('status', ABUSE_PENDING, '=')
+      ->db_or()
+      ->condition('status', ABUSE_HIDDEN, '=')
+      ->db_or()
+      ->condition('status', 'ABUSE_SUPERADMIN', '=')
+      ->orderBy('assigned_to_uid', 'DESC')
+      ->orderBy('oid', 'DESC')
+      ->range(0, variable_get('abuse_num_assigned', 20));
+          var_dump($query);
+      $result = $query->execute();
+       */
 // (assigned_to_uid=0 OR assigned_to_uid=%d)
 // AND
 // (status=%d
-- 
1.8.4.2

From 73839cd241d5defc180f583001d39ffb7dadcaaf Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 14:00:22 +0100
Subject: [PATCH] Issue #1484470 by umtj: corrected constants

---
 abuse.module | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/abuse.module b/abuse.module
index e061c58..f9df839 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1196,8 +1196,8 @@ function _abuse_get_assigned_count($status = FALSE) {
         ->condition('assigned_to_uid', $user->uid, '=');
 
       $status = db_or()
-        ->condition('status', 'ABUSE_PENDING', '=')
-        ->condition('status', 'ABUSE_HIDDEN', '=');
+        ->condition('status', ABUSE_PENDING, '=')
+        ->condition('status', ABUSE_HIDDEN, '=');
 
       $query = db_update('abuse_status')
         ->fields(array(
-- 
1.8.4.2

From 6db652440bada0afeb87c23ab2293cc9fb06f551 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 14:00:34 +0100
Subject: [PATCH] Issue #1484470 by umtj: better formatting

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index f9df839..6bdad63 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1222,7 +1222,7 @@ function _abuse_get_assigned_count($status = FALSE) {
 // oid DESC
 // LIMIT %d",
 // $user->uid, $user->uid, ABUSE_PENDING, ABUSE_HIDDEN, variable_get('abuse_num_assigned', 20))
-      }
+    }
     //$result = db_query("SELECT count(*) FROM {abuse_status} WHERE assigned_to_uid = :assigned_to_uid AND (status = :status OR status = :status OR status = :status)", array(':assigned_to_uid' => $user->uid, ':status' => ABUSE_PENDING, ':status' => ABUSE_HIDDEN, ':status' => ABUSE_SUPERADMIN))->fetchField();
   }
   return $result;
-- 
1.8.4.2

From 10d21c5017c0a154cc64f45fe80e0e775d76459f Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 14:00:51 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/abuse.module b/abuse.module
index 6bdad63..5c8d787 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1230,10 +1230,13 @@ function _abuse_get_assigned_count($status = FALSE) {
 
 
 /**
+ * Pending abuse count.
+
+ * @param bool $status
+ *   Status.
  *
- * @global <type> $user
- * @param <type> $status
- * @return <type>
+ * @return int
+ *   Pending count.
  */
 function _abuse_get_assigned_pending_count($status = FALSE) {
   global $user;
-- 
1.8.4.2

From e64f65ee10f3491df22b1d7e3744de556f5a6c48 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 14:01:31 +0100
Subject: [PATCH] Issue #1484470 by umtj: better formatting

---
 abuse.module | 32 ++++++++++++++++++++++++++++----
 1 file changed, 28 insertions(+), 4 deletions(-)

diff --git a/abuse.module b/abuse.module
index 5c8d787..af5e8c5 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1240,16 +1240,40 @@ function _abuse_get_assigned_count($status = FALSE) {
  */
 function _abuse_get_assigned_pending_count($status = FALSE) {
   global $user;
-  $result = 0;
   if ($status !== FALSE) {
-    $result = db_query("SELECT COUNT(*) FROM {abuse_status} WHERE (assigned_to_uid = :assigned_to_uid OR assigned_to_uid = :assigned_to_uid) AND status = :status", array(':(assigned_to_uid' => 0, ':assigned_to_uid' => $user->uid, ':status' => $status))->fetchField();
+    $result = db_query(
+      "SELECT COUNT(*) FROM {abuse_status} WHERE (assigned_to_uid = :assigned_to_anonymous OR assigned_to_uid = :assigned_to_uid) AND status = :status",
+      array(
+        ':assigned_to_anonymous' => 0,
+        ':assigned_to_uid' => $user->uid,
+        ':status' => $status,
+      ))
+      ->fetchField();
   }
   else {
     if (user_access('administer all abuse reports')) {
-      $result = db_query("SELECT COUNT(*) FROM {abuse_status} WHERE (assigned_to_uid = :assigned_to_uid OR assigned_to_uid = :assigned_to_uid) AND (status = :status OR status = :status OR status = :status)", array(':assigned_to_uid' => 0, ':assigned_to_uid' => $user->uid, ':(status' => ABUSE_PENDING, ':status' => ABUSE_HIDDEN, ':status' => ABUSE_SUPERADMIN))->fetchField();
+      $result = db_query(
+        "SELECT COUNT(*) FROM {abuse_status} WHERE (assigned_to_uid = :assigned_to_anonymous OR assigned_to_uid = :assigned_to_uid) AND (status = :abuse_pending OR status = :abuse_hidden OR status = :abuse_superadmin)",
+        array(
+          ':assigned_to_anonymous' => 0,
+          ':assigned_to_uid' => $user->uid,
+          ':abuse_pending' => ABUSE_PENDING,
+          ':abuse_hidden' => ABUSE_HIDDEN,
+          ':abuse_superadmin' => ABUSE_SUPERADMIN,
+        ))
+        ->fetchField();
     }
     else {
-      $result = db_query("SELECT COUNT(*) FROM {abuse_status} WHERE (assigned_to_uid = :assigned_to_uid OR assigned_to_uid = :assigned_to_uid) AND (status = :status OR status = :status OR status = :status)", array(':assigned_to_uid' => 0, ':assigned_to_uid' => $user->uid, ':(status' => ABUSE_PENDING, ':status' => ABUSE_HIDDEN, ':status' => ABUSE_SUPERADMIN))->fetchField();
+      $result = db_query(
+        "SELECT COUNT(*) FROM {abuse_status} WHERE (assigned_to_uid = :assigned_to_anonymous OR assigned_to_uid = :assigned_to_uid) AND (status = :abuse_pending OR status = :abuse_hidden OR status = :abuse_superadmin)",
+        array(
+          ':assigned_to_anonymous' => 0,
+          ':assigned_to_uid' => $user->uid,
+          ':abuse_pending' => ABUSE_PENDING,
+          ':abuse_hidden' => ABUSE_HIDDEN,
+          ':abuse_superadmin' => ABUSE_SUPERADMIN,
+        ))
+        ->fetchField();
     }
   }
   return intval($result);
-- 
1.8.4.2

From 9009709983105a64395f6928094e94c0c685f2be Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 14:01:47 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/abuse.module b/abuse.module
index af5e8c5..18a62cf 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1280,7 +1280,11 @@ function _abuse_get_assigned_pending_count($status = FALSE) {
 }
 
 /**
+ * Count tallied.
  *
+ * @param array $status
+ *
+ * @return mixed
  */
 function _abuse_get_tallied_count($status = array(ABUSE_LIVE)) {
   $status_param = array();
-- 
1.8.4.2

From 7110d9357a780c93a96b90cf338b5f9de207750b Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 14:02:09 +0100
Subject: [PATCH] Issue #1484470 by umtj: moved default out of function init

---
 abuse.module | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 18a62cf..e1c1b7e 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1286,7 +1286,11 @@ function _abuse_get_assigned_pending_count($status = FALSE) {
  *
  * @return mixed
  */
-function _abuse_get_tallied_count($status = array(ABUSE_LIVE)) {
+function _abuse_get_tallied_count($status = array()) {
+  if (empty($status)) {
+    $status = array(ABUSE_LIVE);
+  }
+
   $status_param = array();
   $c = 0;
   foreach ($status as $type) {
-- 
1.8.4.2

From 499a62cdf086bc196b2f3405c0da33dfdb949efb Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 14:02:16 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/abuse.module b/abuse.module
index e1c1b7e..1ef9982 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1311,10 +1311,13 @@ function _abuse_get_tallied_count($status = array()) {
 
 
 /**
+ * Get abuse status.
  *
- * @param <type> $type
- * @param <type> $oid
- * @return <type>
+ * @param int $oid
+ *   Oid.
+ *
+ * @return bool
+ *   Status.
  */
 function _abuse_get_object_status($oid) {
   $res = db_query("SELECT status FROM {abuse_status} WHERE oid = :oid", array(':oid' => $oid))->fetchField();
-- 
1.8.4.2

From 227748cd65448bc0d39c548e9f6547a0de2c0b9f Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 14:02:22 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/abuse.module b/abuse.module
index 1ef9982..c8a4705 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1326,10 +1326,16 @@ function _abuse_get_object_status($oid) {
 
 
 /**
+ * Get entity status.
  *
- * @param <type> $type
- * @param <type> $oid
- * @return <type>
+ * @param string $type
+ *   Abuse type.
+ *
+ * @param int $oid
+ *   Oid.
+ *
+ * @return int
+ *   Status.
  */
 function _abuse_get_status($type, $oid) {
   $res = _abuse_get_object_status($type, $oid);
-- 
1.8.4.2

From d8a604109852754e15c99dc750c2a4c2934fd580 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 14:02:27 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/abuse.module b/abuse.module
index c8a4705..4534725 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1344,10 +1344,13 @@ function _abuse_get_status($type, $oid) {
 
 
 /**
+ * Get translated status.
  *
- * @staticvar <type> $status
- * @param <type> $current_status
- * @return <type>
+ * @param string $current_status
+ *   String.
+ *
+ * @return string
+ *   Translated string.
  */
 function _abuse_retrieve_status($current_status) {
   static $status;
-- 
1.8.4.2

From 0693d55f98d3adfae70a85aba8090b1948d4bb32 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 14:02:37 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/abuse.module b/abuse.module
index 4534725..0e00c5d 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1368,11 +1368,16 @@ function _abuse_retrieve_status($current_status) {
 
 
 /**
+ * Set abuse status.
  *
- * @global  $user
- * @param <type> $type
- * @param <type> $oid
- * @param <type> $status
+ * @param string $type
+ *   Abuse type.
+ *
+ * @param int $oid
+ *   Oid.
+ *
+ * @param bool $status
+ *   Status.
  */
 function _abuse_set_status($type, $oid, $status) {
   $nid = $oid;
-- 
1.8.4.2

From c16af57f4805a1db94a1d78ef420912014b9e7c6 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 14:02:54 +0100
Subject: [PATCH] Issue #1484470 by umtj: use global and cleanup

---
 abuse.module | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/abuse.module b/abuse.module
index 0e00c5d..2713d79 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1380,9 +1380,7 @@ function _abuse_retrieve_status($current_status) {
  *   Status.
  */
 function _abuse_set_status($type, $oid, $status) {
-  $nid = $oid;
-  // global $user;
-  $user = $GLOBALS['user'];
+  global $user;
   $assigned_to_uid = 0;
   if (user_access('administer abuse reports')) {
     $assigned_to_uid = (ABUSE_SUPERADMIN == $status) ? 0 : $user->uid;
-- 
1.8.4.2

From a3c78e08e074b9541b3bbc46b607b0e991fd9319 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 14:03:14 +0100
Subject: [PATCH] Issue #1484470 by umtj: removed unused variable

---
 abuse.module | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/abuse.module b/abuse.module
index 2713d79..1b2f968 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1398,13 +1398,13 @@ function _abuse_set_status($type, $oid, $status) {
   }
 
   // Remove current active status.
-  $query = db_delete('abuse_status')
+  db_delete('abuse_status')
     ->condition('type', $type)
     ->condition('oid', $oid)
     ->execute();
 
   // Insert fresh status.
-  $query = db_insert('abuse_status')
+  db_insert('abuse_status')
     ->fields(array(
       'type' => $type,
       'oid' => $oid,
-- 
1.8.4.2

From 449fb21d5a4996d20780bc81152081d8355dfedd Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 14:03:28 +0100
Subject: [PATCH] Issue #1484470 by umtj: better formatting

---
 abuse.module | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 1b2f968..2abd376 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1417,7 +1417,10 @@ function _abuse_set_status($type, $oid, $status) {
   // Comments need to update the node the belong to.
   $nid = 0;
   if ('comment' == $type) {
-    $nid = db_query("SELECT nid FROM {comment} where cid=:cid", array(':cid' => $oid))->fetchField();
+    $nid = db_query(
+      "SELECT nid FROM {comment} where cid=:cid",
+      array(':cid' => $oid))
+      ->fetchField();
   }
   if ($nid) {
     $query = db_update('node')
-- 
1.8.4.2

From d0e03c42e389d9726feb0e5e4bfce2edd8ea37ec Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 14:03:35 +0100
Subject: [PATCH] Issue #1484470 by umtj: removed unused variable

---
 abuse.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index 2abd376..7b2ca94 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1423,7 +1423,7 @@ function _abuse_set_status($type, $oid, $status) {
       ->fetchField();
   }
   if ($nid) {
-    $query = db_update('node')
+    db_update('node')
       ->fields(array(
         'changed' => REQUEST_TIME,
       ))
-- 
1.8.4.2

From c6a556503bc7bcfa228e9b8a92057561f2c449ef Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 14:03:48 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/abuse.module b/abuse.module
index 7b2ca94..8dd2d7d 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1434,15 +1434,22 @@ function _abuse_set_status($type, $oid, $status) {
 
 
 /**
+ * Allow entity.
  *
- * @param <type> $type
- * @param <type> $oid
- * @return <type>
+ * @param string $type
+ *   Abuse type.
+ *
+ * @param int $oid
+ *   Oid.
+ *
+ * @return bool
+ *   TRUE if allowed.
  */
 function _abuse_allow($type, $oid) {
   $object = _abuse_load($type, $oid);
   if ($object->uid) {
-    // Re-Save the node so it can get indexed if not already done so and any other important functionality is carried out by being published
+    // Re-Save the node so it can get indexed if not already done so and any
+    // other important functionality is carried out by being published.
     switch ($type) {
       case 'node':
         // Resave the node so it can get reindexed correctly.
-- 
1.8.4.2

From e21a27f1742011021e7e0f8d0d295ff1c76d226c Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 14:03:52 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/abuse.module b/abuse.module
index 8dd2d7d..c65d06f 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1498,9 +1498,13 @@ function _abuse_allow($type, $oid) {
 
 
 /**
+ * Remove entity.
  *
- * @param <type> $type
- * @param <type> $oid
+ * @param string $type
+ *   Abuse type.
+ *
+ * @param int $oid
+ *   Oid.
  */
 function _abuse_remove($type, $oid) {
   db_update('abuse')
-- 
1.8.4.2

From cec7744ddda1d809cce7dd3037ee0fd388330ea3 Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 14:03:57 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/abuse.module b/abuse.module
index c65d06f..8ffefff 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1541,9 +1541,13 @@ function _abuse_remove($type, $oid) {
 
 
 /**
+ * Assign to superamdin.
  *
- * @param <type> $type
- * @param <type> $oid
+ * @param string $type
+ *   Abuse type.
+ *
+ * @param int $oid
+ *   Oid.
  */
 function _abuse_assign_superadmin($type, $oid) {
   _abuse_clear_oid_cache($oid);
-- 
1.8.4.2

From 202e9b6f9ed5a3dcab6db23552699f6f386f5ddb Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 14:04:01 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/abuse.module b/abuse.module
index 8ffefff..ff92797 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1556,10 +1556,16 @@ function _abuse_assign_superadmin($type, $oid) {
 
 
 /**
+ * Unpublish entity.
  *
- * @param <type> $type
- * @param <type> $oid
- * @return <type>
+ * @param string $type
+ *   Abuse type.
+ *
+ * @param int $oid
+ *   Oid.
+ *
+ * @return bool
+ *   Success if TRUE.
  */
 function _abuse_disable($type, $oid) {
   $count = db_query(
-- 
1.8.4.2

From c338de8543d67f6ebe58a8c35f184f8cb59b28ec Mon Sep 17 00:00:00 2001
From: hurlum <tj@unitmakers.dk>
Date: Thu, 20 Nov 2014 14:04:05 +0100
Subject: [PATCH] Issue #1484470 by umtj: correcte comment

---
 abuse.module | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/abuse.module b/abuse.module
index ff92797..11cd942 100644
--- a/abuse.module
+++ b/abuse.module
@@ -1609,8 +1609,10 @@ function _abuse_disable($type, $oid) {
 
 
 /**
+ * Clear cache.
  *
- * @param <type> $oid
+ * @param int $oid
+ *   Oid.
  */
 function _abuse_clear_oid_cache($oid) {
   $cache_tables = array('cache', 'cache_block', 'cache_filter', 'cache_page');
-- 
1.8.4.2

