﻿Index: node_limit_user.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_limit/node_limit_user/Attic/node_limit_user.install,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 node_limit_user.install
--- node_limit_user.install	9 Apr 2009 04:49:56 -0000	1.1.2.2
+++ node_limit_user.install	9 Apr 2009 19:11:09 -0000
@@ -1,10 +1,17 @@
 <?php
+// $Id$
+
+/**
+ * @file
+ * Installation functions for module node_limit_user.
+ */
+
 /**
  * Implementation of hook_install().
  */
 function node_limit_user_install() {
-	db_query("DROP TABLE IF EXISTS {node_limit_user}");
-	drupal_install_schema('node_limit_user');
+  db_query("DROP TABLE IF EXISTS {node_limit_user}");
+  drupal_install_schema('node_limit_user');
 }
 
 /**
@@ -33,16 +40,14 @@
      */
     'primary key' => array('lid', 'uid')
   );
-  
+
   return $schema;
 }
 
 
 /*
- * Implementation of hook_uninstall
+ * Implementation of hook_uninstall().
  */
 function node_limit_user_uninstall() {
-	drupal_uninstall_schema('node_limit_user');
+  drupal_uninstall_schema('node_limit_user');
 }
-
-?>
\ No newline at end of file
Index: node_limit_user.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_limit/node_limit_user/Attic/node_limit_user.module,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 node_limit_user.module
--- node_limit_user.module	9 Apr 2009 04:49:56 -0000	1.1.2.2
+++ node_limit_user.module	9 Apr 2009 19:11:10 -0000
@@ -1,11 +1,19 @@
 <?php
+// $Id$
 
 /**
- * implementation of hook_node_limit_applies_in_context
+ * @file
+ * Module to restrict the number of nodes by user.
+ */
+
+/**
+ * Implementation of hook_node_limit_applies_in_context().
  */
 function node_limit_user_node_limit_applies_in_context($lid, &$node, &$user) {
   $limit = node_limit_user_node_limit_load($lid);
-  if (empty($limit)) { return NODE_LIMIT_LIMIT_NEUTRAL; }
+  if (empty($limit)) {
+    return NODE_LIMIT_LIMIT_NEUTRAL;
+  }
   if ($limit['node_limit_user']['uid'] != $user->uid) {
     return array('node_limit_user' => NODE_LIMIT_LIMIT_DOESNT_APPLY);
   }
@@ -13,11 +21,13 @@
 }
 
 /**
- * implementation of hook_node_limit_sql
+ * Implementation of hook_node_limit_sql().
  */
 function node_limit_user_node_limit_sql($lid) {
   $limit = node_limit_user_node_limit_load($lid);
-  if (empty($limit)) { return array(); }
+  if (empty($limit)) {
+    return array();
+  }
   return array(
     'join' => array(
       'INNER JOIN {users} AS nlu ON (n.uid = nlu.uid)'
@@ -29,7 +39,7 @@
 }
 
 /**
- * implementation of hook_node_limit_element
+ * Implementation of hook_node_limit_element().
  */
 function node_limit_user_node_limit_element($lid = 0) {
   $limit = node_limit_user_node_limit_load($lid);
@@ -39,12 +49,12 @@
       '#title' => t('User'),
       '#autocomplete_path' => 'user/autocomplete',
       '#default_value' => $limit['node_limit_user']['name']
-     )
+    )
   );
 }
 
 /**
- * implementation of hook_node_limit_element_validate
+ * Implementation of hook_node_limit_element_validate().
  */
 function node_limit_user_node_limit_element_validate($element) {
   /**
@@ -58,25 +68,26 @@
     return array(
       'error' => t('Node Limits cannot be applied to User #1')
     );
-  } else if ($potential_user === false) {
+  }
+  else if ($potential_user === FALSE) {
     //unknown user
     return array(
       'error' => t('Unknown user "!user"', array('!user' => $element))
     );
   }
-  return true;
+  return TRUE;
 }
 
 /**
- * implementation of hook_node_limit_element_submit
+ * Implementation of hook_node_limit_element_submit().
  */
 function node_limit_user_node_limit_element_submit($lid, $applies, $element) {
-  //$element contains the username of the user
-  //user_load based on the name to get the uid
+  // $element contains the username of the user.
+  // user_load based on the name to get the uid.
   $user = user_load(array('name' => $element));
   $uid = $user->uid;
-  //if they're editing, then this limit already exists
-  //therefore it has to be deleted before it can be resaved
+  // If they're editing, then this limit already exists.
+  // Therefore it has to be deleted before it can be resaved.
   node_limit_user_node_limit_delete($lid);
   if ($applies) {
     db_query("INSERT INTO {node_limit_user} VALUES('%d', '%d')", $lid, $uid);
@@ -84,19 +95,21 @@
 }
 
 /**
- * implementation of hook_node_limit_delete
+ * Implementation of hook_node_limit_delete().
  */
 function node_limit_user_node_limit_delete($lid) {
   db_query("DELETE FROM {node_limit_user} WHERE `lid`='%d'", $lid);
 }
 
 /**
- * implementation of hook_node_limit_load
+ * Implementation of hook_node_limit_load().
  */
 function node_limit_user_node_limit_load($lid) {
   $sql = "SELECT nlu.*, u.name FROM {node_limit_user} AS nlu INNER JOIN {users} AS u ON (u.uid=nlu.uid) WHERE `lid` = '%d'";
   $info = db_fetch_array(db_query($sql, $lid));
-  if (intval($info['uid']) == 0) { return array(); }
+  if (intval($info['uid']) == 0) {
+    return array();
+  }
   return array(
     'node_limit_user' => array(
       'uid' => $info['uid'],
@@ -104,5 +117,3 @@
     )
   );
 }
-
-?>
\ No newline at end of file
