From 8c58331372c07a1ba80207eb5fd5788d35915790 Mon Sep 17 00:00:00 2001
From: barrett <barrett@52745.no-reply.drupal.org>
Date: Mon, 26 Mar 2012 15:58:51 -0400
Subject: [PATCH] code cleanup based on Code Review output: adding t() and
 minor style issues

---
 protected_node.fork.inc                            |    2 +-
 protected_node.install                             |   10 ++++++----
 protected_node.module                              |    4 ++--
 protected_node.redirect.inc                        |    2 +-
 protected_node.settings.inc                        |    6 +++---
 .../protected_node_rules.rules.inc                 |    3 ++-
 6 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/protected_node.fork.inc b/protected_node.fork.inc
index 345b439..53c3a8b 100644
--- a/protected_node.fork.inc
+++ b/protected_node.fork.inc
@@ -176,7 +176,7 @@ function protected_node_enter_any_password() {
   }
   if ($cancel) {
     $form['protected_node_enterpassword']['cancel'] = array(
-      '#value' => l('Cancel', $cancel),
+      '#value' => l(t('Cancel'), $cancel),
     );
   }
 
diff --git a/protected_node.install b/protected_node.install
index 1a26e81..c758b17 100644
--- a/protected_node.install
+++ b/protected_node.install
@@ -21,7 +21,8 @@ function protected_node_requirements($phase) {
 
     // Note: since this is the runtime phase we do not have to force a
     //       load of the .module file.
-    /*$perms = protected_node_perm();
+    /*
+    $perms = protected_node_perm();
 
     $likes = array();
     foreach ($perms as $perm) {
@@ -53,10 +54,11 @@ function protected_node_requirements($phase) {
         'description' => t('Without giving access to at least one role, no-one other than the administrator (UID=1) can created protected nodes or view protected nodes'),
         'severity' => REQUIREMENT_ERROR,
       );
-    }*/
+    }
+    */
 
     // File attachment are not currently protected
-    /**
+    /*
     switch (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC)) {
     case FILE_DOWNLOADS_PRIVATE:
       if (!module_exists('upload')) {
@@ -87,7 +89,7 @@ function protected_node_requirements($phase) {
       break;
 
     }
-    **/
+    */
   }
 
   return $reqs;
diff --git a/protected_node.module b/protected_node.module
index 535538d..628de7d 100644
--- a/protected_node.module
+++ b/protected_node.module
@@ -449,7 +449,7 @@ function protected_node_node_validate($node, $form) {
           // automatically generate a password for the email (note that means the author won't know the password!)
           $_protected_node_random_passwd = user_password();
           $missing_password = FALSE; // not missing anymore
-          drupal_set_message('A random password was generated in order to send the email about this page. Remember that changing the password will prevent users you just emailed from accessing this page.', 'warning');
+          drupal_set_message(t('A random password was generated in order to send the email about this page. Remember that changing the password will prevent users you just emailed from accessing this page.'), 'warning');
         }
       }
       else {
@@ -684,7 +684,7 @@ function _protected_node_save(&$node) {
     }
     $args = array(
       'protected_node_is_protected' => $node->protected_node_is_protected,
-      'protected_node_passwd' =>$node->protected_node_passwd,
+      'protected_node_passwd' => $node->protected_node_passwd,
       'protected_node_show_title' => $node->protected_node_show_title,
       'protected_node_hint' => isset($node->protected_node_hint) ? $node->protected_node_hint : '',
      );
diff --git a/protected_node.redirect.inc b/protected_node.redirect.inc
index b300d34..329e2ff 100644
--- a/protected_node.redirect.inc
+++ b/protected_node.redirect.inc
@@ -131,7 +131,7 @@ function protected_node_enterpassword() {
   }
   if ($cancel) {
     $form['protected_node_enterpassword']['cancel'] = array(
-      '#value' => l('Cancel', $cancel),
+      '#value' => l(t('Cancel'), $cancel),
     );
   }
 
diff --git a/protected_node.settings.inc b/protected_node.settings.inc
index 8d4d77e..6c890b1 100644
--- a/protected_node.settings.inc
+++ b/protected_node.settings.inc
@@ -579,7 +579,7 @@ function _protected_node_admin_settings_submit($form, &$form_state) {
  */
 function protected_node_action_clear_sessions($form, &$form_state) {
   variable_set('protected_node_session_timelimit', REQUEST_TIME);
-  drupal_set_message('All the Protected Node sessions were cleared.');
+  drupal_set_message(t('All the Protected Node sessions were cleared.'));
 }
 
 /**
@@ -597,7 +597,7 @@ function protected_node_action_reset_passwords($form, &$form_state) {
       ))
       ->execute();
     variable_set('protected_node_session_timelimit', REQUEST_TIME);
-    drupal_set_message('All protected nodes are now publicly visible unless protected by another module.');
+    drupal_set_message(t('All protected nodes are now publicly visible unless protected by another module.'));
   }
   else {
     form_error($form['protected_node_actions']['protected_node_reset_passwords']['protected_node_reset_passwords_password'],
@@ -673,7 +673,7 @@ function protected_node_action_protect_nodes_with_password($form, &$form_state)
     ->condition('protected_node_is_protected', 0)
     ->condition('protected_node_passwd', '', '<>')
     ->execute();
-  drupal_set_message('All nodes with an existing password (excluding the global password) are now protected.');
+  drupal_set_message(t('All nodes with an existing password (excluding the global password) are now protected.'));
 }
 
 /**
diff --git a/protected_node_rules/protected_node_rules.rules.inc b/protected_node_rules/protected_node_rules.rules.inc
index 0e769c0..f4e7495 100644
--- a/protected_node_rules/protected_node_rules.rules.inc
+++ b/protected_node_rules/protected_node_rules.rules.inc
@@ -1,6 +1,7 @@
 <?php
 /**
- * @file Rules integration for the protected_node module.
+ * @file
+ * Rules integration for the protected_node module.
  */
 
 /**
-- 
1.7.4.4

