﻿Index: node_limit.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_limit/node_limit.install,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 node_limit.install
--- node_limit.install	9 Apr 2009 04:49:56 -0000	1.1.2.2
+++ node_limit.install	9 Apr 2009 18:30:58 -0000
@@ -1,11 +1,18 @@
 <?php
+// $Id$
+
+/**
+ * @file
+ * Installation functions for module node_limit.
+ */
 
 define("NODE_LIMIT_NO_LIMIT", -1);
+
 /**
  * Implementation of hook_install().
  */
 function node_limit_install() {
-	drupal_install_schema('node_limit');
+  drupal_install_schema('node_limit');
 }
 
 /**
@@ -49,15 +56,13 @@
     ),
     'primary key' => array('lid')
   );
-	return $schema;
+  return $schema;
 }
 
 
 /*
- * Implementation of hook_uninstall
+ * Implementation of hook_uninstall().
  */
 function node_limit_uninstall() {
-	drupal_uninstall_schema('node_limit');
+  drupal_uninstall_schema('node_limit');
 }
-
-?>
\ No newline at end of file
Index: node_limit.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_limit/node_limit.module,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 node_limit.module
--- node_limit.module	9 Apr 2009 04:49:56 -0000	1.1.2.2
+++ node_limit.module	9 Apr 2009 18:30:59 -0000
@@ -1,4 +1,10 @@
 <?php
+// $Id$
+
+/**
+ * @file
+ * Module to restrict the number of nodes a user or role may create.
+ */
 
 define("NODE_LIMIT_NO_LIMIT", -1);
 
@@ -11,78 +17,75 @@
 define("NODE_LIMIT_ANY_CONTENT_TYPE", "--any--");
 
 /**
- * implementation of hook_perm()
+ * Implementation of hook_perm().
  */
 function node_limit_perm() {
-	return array(NODE_LIMIT_PERM_ADMIN);
+  return array(NODE_LIMIT_PERM_ADMIN);
 }
 
 /**
- * implementation of hook_menu()
+ * Implementation of hook_menu().
  */
 function node_limit_menu() {
-	$items = array();
-	$items['admin/user/node_limit'] = array(
-		'title' => t('Node Limits'),
-		'page callback' => 'drupal_get_form',
-		'page arguments' => array('node_limit_list_limits'),
-		'access arguments' => array(NODE_LIMIT_PERM_ADMIN)
-	);
-	
-	$items['admin/user/node_limit/list'] = array(
-	  'title' => t('List'),
-	  'type' => MENU_DEFAULT_LOCAL_TASK,
-		'access arguments' => array(NODE_LIMIT_PERM_ADMIN),
-	  'weight' => -10
-	);
-	
-	$items['admin/user/node_limit/add'] = array(
-	  'title' => t('Add Node Limit'),
-	  'page callback' => 'drupal_get_form',
-	  'page arguments' => array('node_limit_limit_form', '0'),
-	  'access arguments' => array(NODE_LIMIT_PERM_ADMIN),
-	  'type' => MENU_LOCAL_TASK
-	);
-	
-	$items['admin/user/node_limit/%node_limit'] = array(
-	  'title' => t('Edit Node Limit'),
-	  'page callback' => 'drupal_get_form',
-	  'page arguments' => array('node_limit_limit_form', 3),
-	  'access arguments' => array(NODE_LIMIT_PERM_ADMIN),
-	  'type' => MENU_LOCAL_TASK
-	);
-	
-	$items['admin/user/node_limit/%node_limit/delete'] = array(
-	  'title' => t('Delete Node Limit'),
-	  'page callback' => 'drupal_get_form',
-	  'page arguments' => array('node_limit_delete_form', 3),
-	  'access arguments' => array(NODE_LIMIT_PERM_ADMIN),
-	  'type' => MENU_CALLBACK
-	);
-	
-	return $items;
+  $items = array();
+  $items['admin/user/node_limit'] = array(
+    'title' => t('Node Limits'),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('node_limit_list_limits'),
+    'access arguments' => array(NODE_LIMIT_PERM_ADMIN)
+  );
+  $items['admin/user/node_limit/list'] = array(
+    'title' => t('List'),
+    'type' => MENU_DEFAULT_LOCAL_TASK,
+    'access arguments' => array(NODE_LIMIT_PERM_ADMIN),
+    'weight' => -10
+  );
+  $items['admin/user/node_limit/add'] = array(
+    'title' => t('Add Node Limit'),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('node_limit_limit_form', '0'),
+    'access arguments' => array(NODE_LIMIT_PERM_ADMIN),
+    'type' => MENU_LOCAL_TASK
+  );
+  $items['admin/user/node_limit/%node_limit'] = array(
+    'title' => t('Edit Node Limit'),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('node_limit_limit_form', 3),
+    'access arguments' => array(NODE_LIMIT_PERM_ADMIN),
+    'type' => MENU_LOCAL_TASK
+  );
+  $items['admin/user/node_limit/%node_limit/delete'] = array(
+    'title' => t('Delete Node Limit'),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('node_limit_delete_form', 3),
+    'access arguments' => array(NODE_LIMIT_PERM_ADMIN),
+    'type' => MENU_CALLBACK
+  );
+
+  return $items;
 }
 
 /**
- * implementation of hook_theme()
- * register the two forms that require custom rendering
+ * Implementation of hook_theme().
+ * Register the two forms that require custom rendering.
  */
 function node_limit_theme() {
-	return array(
-		'node_limit_limit_form' => array(
-			'arguments' => array('form' => NULL)
-		),
-		'node_limit_list_limits' => array(
-		  'arguments' => array('form' => NULL)
-		)
-	);
+  return array(
+    'node_limit_limit_form' => array(
+      'arguments' => array('form' => NULL)
+    ),
+    'node_limit_list_limits' => array(
+      'arguments' => array('form' => NULL)
+    )
+  );
 }
 
 /**
- * implmentation of hook_nodeapi
- * this is where we'll determine if the user may create new nodes or not
- * we'll key of $op == 'prepare', 
- * which is sent before the edit/add form is constructed
+ * Implementation of hook_nodeapi().
+ * 
+ * This is where we'll determine if the user may create new nodes or not.
+ * We'll key of $op == 'prepare', which is sent before the edit/add form 
+ * is constructed.
  */
 function node_limit_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
   if ($op == 'prepare') {
@@ -96,27 +99,40 @@
 }
 
 /**
- * returns t/f depending on whther the $node violates a limit
- * always returns false for user 1
+ * Helper function to check limit violations for this node.
+ * Always returns FALSE for user 1.
+ * 
+ * @param $node
+ *   The node to check.
  */
 function _node_limit_violates_limit(&$node) {
-  if ($node->uid == 1) { return false; }
+  if ($node->uid == 1) { 
+    return FALSE; 
+  }
   $limits = node_limit_limits($node);
-  foreach($limits as $idx => $lid) {
+  foreach ($limits as $idx => $lid) {
     $limit = node_limit_load($lid);
-    if ($limit['limit'] == NODE_LIMIT_NO_LIMIT) { continue; }
+    if ($limit['limit'] == NODE_LIMIT_NO_LIMIT) { 
+      continue; 
+    }
     $sql = _node_limit_sql($limit['lid']);
     $count = db_result(db_query($sql));
-    if ($count >= $limit['limit']) { return true; }
+    if ($count >= $limit['limit']) { 
+      return TRUE; 
+    }
   }
-  return false;
+  return FALSE;
 }
 
 /**
- * returns a generated sql statement to find the nodes that apply to a particular limit
- * modules that implement hook_node_limit_sql should sprintf their arguments
- * into the returned array
- * this will be changed in drupal 7, which will be able to accept an array of arguments to db_query
+ * Generates the sql statement to find the nodes that apply to a particular limit.
+ * Modules that implement hook_node_limit_sql() should sprintf their arguments
+ * into the returned array.
+ * This will be changed in Drupal 7, which will be able to accept an array of 
+ * arguments to db_query().
+ * 
+ * @param $lid
+ *   Identifier of limit rule.
  */
 function _node_limit_sql($lid) {
   $sql = "SELECT COUNT(n.nid) AS number FROM {node} AS n";
@@ -128,12 +144,14 @@
   $joins = (isset($components['join']) ? implode(' ', $components['join']) : '');
   $wheres = (isset($components['where']) ? 'WHERE '. implode(' AND ', $components['where']) : '');
   
-  return $sql . ' ' . $joins . ' ' . $wheres;
+  return $sql .' '. $joins .' '. $wheres;
 }
 
 /**
- * @function node_limit_limits returns all the limits that can be applied to $node
- * @param $node the node that may be limited
+ * Returns all the limits that can be applied to a specific node.
+ *
+ * @param $node 
+ *   The node object that may be limited.
  */
 function node_limit_limits(&$node) {
   $user = user_load($node->uid);
@@ -141,19 +159,21 @@
   $sql = "SELECT lid FROM {node_limit} WHERE `type`='%s' OR `type`='%s' ORDER BY weight ASC";
   $res = db_query($sql, $node->type, NODE_LIMIT_ANY_CONTENT_TYPE);
   $applicable_limits = array();
-  while($l = db_fetch_array($res)) {
-    //this particular limit id
+  while ($l = db_fetch_array($res)) {
+    // This particular limit id.
     $lid = $l['lid'];
-    $applies = true;
+    $applies = TRUE;
     
     $submodule_applies = module_invoke_all('node_limit_applies_in_context', $lid, $node, $user);
-    foreach($submodule_applies as $module => $module_applies) {
-      //a submodule returns DOESNT_APPLY if it requires a specific user or role, etc,
-      //and the context given does not satisfy that
-      if ($module_applies == NODE_LIMIT_DOESNT_APPLY) { $applies = false; }
+    foreach ($submodule_applies as $module => $module_applies) {
+      // A submodule returns DOESNT_APPLY if it requires a specific user or role, etc,
+      // and the context given does not satisfy that.
+      if ($module_applies == NODE_LIMIT_DOESNT_APPLY) { 
+        $applies = FALSE; 
+      }
     }
     
-    if ($applies == true) {
+    if ($applies == TRUE) {
       $applicable_limits[] = $lid;
     }
   }
@@ -162,7 +182,7 @@
 }
 
 /**
- * theme the node limit list form
+ * Theme the node limit list form.
  */
 function theme_node_limit_list_limits($form) {
   $header = array(
@@ -173,7 +193,7 @@
     t('Actions')
   );
   $rows = array();
-  foreach(element_children($form['limits']) as $lid) {
+  foreach (element_children($form['limits']) as $lid) {
     $row = array();
     $form['limits'][$lid]['weight']['#attributes']['class'] = 'node_limit-weight';
     $row[] = drupal_render($form['limits'][$lid]['title']);
@@ -188,29 +208,31 @@
   }
   
   if (count($rows) > 0) {
-  	$out = theme('table', $header, $rows, array('id' => 'node_limit-table'));
+    $out = theme('table', $header, $rows, array('id' => 'node_limit-table'));
   }
-	$out .= drupal_render($form);
+  $out .= drupal_render($form);
   drupal_add_tabledrag('node_limit-table', 'order', 'sibling', 'node_limit-weight');
-	return $out;
+  return $out;
 
 }
 
 /**
- * form for listing the created limits
- * created as a form so that the user can adjust the weight
+ * Form for listing the created limits.
+ * Created as a form so that the user can adjust the weight.
  */
 function node_limit_list_limits() {
   $weights = array();
-  for($i = -10; $i <= 10; $i++) { $weights[$i] = $i; }
+  for ($i = -10; $i <= 10; $i++) { 
+    $weights[$i] = $i; 
+  }
   
-  $form = array('#tree' => true);
+  $form = array('#tree' => TRUE);
   $form['limits'] = array();
   $types = _node_limit_content_types();
   $sql = "SELECT * FROM {node_limit} ORDER BY weight ASC";
   $res = db_query($sql);
   $limit_count = 0;
-  while($rec = db_fetch_array($res)) {
+  while ($rec = db_fetch_array($res)) {
     $limit_count++;
     $form['limits'][$rec['lid']]['weight'] = array(
       '#type' => 'select',
@@ -227,7 +249,7 @@
       '#value' => $rec['limit']
     );
     $form['limits'][$rec['lid']]['actions'] = array(
-      '#value' => l(t('Edit'), 'admin/user/node_limit/'.$rec['lid']).' '.l(t('Delete'), 'admin/user/node_limit/'.$rec['lid'].'/delete')
+      '#value' => l(t('Edit'), 'admin/user/node_limit/'. $rec['lid']) .' '. l(t('Delete'), 'admin/user/node_limit/'. $rec['lid'] .'/delete')
     );
   }
   
@@ -236,7 +258,8 @@
       '#type' => 'submit',
       '#value' => t('Save Limits')
     );
-  } else {
+  } 
+  else {
     $form['create'] = array(
       '#value' => l(t('Add a new node limit'), 'admin/user/node_limit/add')
     );
@@ -246,118 +269,124 @@
 }
 
 /**
- * Save the module weights
+ * Save the module weights.
  */
 function node_limit_list_limits_submit($form_id, &$form_state) {
   $sql = "UPDATE {node_limit} SET `weight`='%d' WHERE `lid`='%d'";
-  foreach($form_state['values']['limits'] as $lid => $info) {
+  foreach ($form_state['values']['limits'] as $lid => $info) {
     db_query($sql, $info['weight'], $lid);
   }
   drupal_set_message(t('Limits saved!'));
 }
 
 /**
- * theme the admin settings form so that we have tables inside fieldsets
+ * Theme the admin settings form so that we have tables inside fieldsets.
  */
 function theme_node_limit_limit_form($form) {
   if (!isset($form['info'])) {
-    die();
+    return;
   }
-	$rows = array();
-	
-	foreach($form['node_limit_elements'] as $module => &$element) {
-	  if (is_array($element['applies']) && is_array($element['element'])) {
-	    if ($element['element']['#custom_render'] === true && module_hook($module, 'node_limit_render_element')) {
-	      //we can't use module_invoke because form elements must be passed byref
-	      $func = $module.'_node_limit_render_element';
-	      $rendered_element = $func($element['element']);
-	    } else {
-	      $rendered_element = drupal_render($element['element']);
-	    }
-	    $rows[] = array(
-	      drupal_render($element['applies']),
-	      $rendered_element
-	    );
-	  }
-	}
-
-	$output = drupal_render($form['info']);
-	if (count($rows) > 0) {
-  	$output .= theme('table', array(t('Applies to:'), ''), $rows);
+  $rows = array();
+  
+  foreach ($form['node_limit_elements'] as $module => &$element) {
+    if (is_array($element['applies']) && is_array($element['element'])) {
+      if ($element['element']['#custom_render'] === TRUE && module_hook($module, 'node_limit_render_element')) {
+        // We can't use module_invoke because form elements must be passed byref.
+        $func = $module .'_node_limit_render_element';
+        $rendered_element = $func($element['element']);
+      } 
+      else {
+        $rendered_element = drupal_render($element['element']);
+      }
+      $rows[] = array(
+        drupal_render($element['applies']),
+        $rendered_element
+      );
+    }
   }
-	$output .= drupal_render($form);
-	return $output;
+
+  $output = drupal_render($form['info']);
+  if (count($rows) > 0) {
+    $output .= theme('table', array(t('Applies to:'), ''), $rows);
+  }
+  $output .= drupal_render($form);
+  return $output;
 }
 
 /**
- * the node_limit settings form
+ * The node_limit settings form.
  */
 function node_limit_limit_form(&$form_state, $limit) {
-  if ($limit == false) { $limit = array(); }
+  if ($limit == FALSE) { 
+    $limit = array(); 
+  }
   $types = _node_limit_content_types();
-	$form = array();
-	$form['#tree'] = true;
-	if ($limit['lid'] > 0) {
-	  $form['lid'] = array(
-	    '#type' => 'hidden',
-	    '#value' => $limit['lid']
-	  );
-	}
-	
-	$form['info']['title'] = array(
-	  '#title' => t('Description'),
+  $form = array();
+  $form['#tree'] = TRUE;
+  if ($limit['lid'] > 0) {
+    $form['lid'] = array(
+      '#type' => 'hidden',
+      '#value' => $limit['lid']
+    );
+  }
+  
+  $form['info']['title'] = array(
+    '#title' => t('Description'),
+    '#type' => 'textfield',
+    '#default_value' => $limit['title'],
+    '#required' => TRUE,
+    '#description' => t('The description for this Node Limit')
+  );
+  $form['info']['type'] = array(
+    '#title' => t('Content Type'),
+    '#type' => 'select',
+    '#options' => $types,
+    '#required' => TRUE,
+    '#default_value' => $limit['type'],
+    '#description' => t('The content type to which this limit applies')
+  );
+  $form['info']['limit'] = array(
+    '#title' => t('Limit'),
     '#type' => 'textfield',
-	  '#default_value' => $limit['title'],
-	  '#required' => true,
-	  '#description' => t('The description for this Node Limit')
-	);
-	$form['info']['type'] = array(
-	  '#title' => t('Content Type'),
-	  '#type' => 'select',
-	  '#options' => $types,
-	  '#required' => true,
-	  '#default_value' => $limit['type'],
-	  '#description' => t('The content type to which this limit applies')
-	);
-	$form['info']['limit'] = array(
-	  '#title' => t('Limit'),
-	  '#type' => 'textfield',
-	  '#default_value' => (isset($limit['limit']) ? $limit['limit'] : NODE_LIMIT_NO_LIMIT),
-	  '#size' => 20,
-	  '#required' => true,
-	  '#description' => t('The number of nodes for this limit.  Must be an integer greater than 0 or %nolimit for no limit', array('%nolimit' => NODE_LIMIT_NO_LIMIT))
-	);
-	
-	$elements = module_invoke_all('node_limit_element', $limit['lid']);
-	$form['node_limit_elements'] = array();
-	foreach($elements as $module => $element) {
-	  $form['node_limit_elements'][$module]['applies'] = array(
-	    '#type' => 'checkbox',
-	    '#title' => $element['#title'],
-	    '#default_value' => isset($limit[$module])
-	  );
-	  $element['#title'] = '';
-	  $form['node_limit_elements'][$module]['element'] = $element;
-	}
-		
-	$form['save'] = array(
-		'#type' => 'submit',
-		'#value' => ($limit['lid'] > 0 ? t('Edit Node Limit') : t('Add Node Limit'))
-	);
-	return $form;
+    '#default_value' => (isset($limit['limit']) ? $limit['limit'] : NODE_LIMIT_NO_LIMIT),
+    '#size' => 20,
+    '#required' => TRUE,
+    '#description' => t('The number of nodes for this limit.  Must be an integer greater than 0 or %nolimit for no limit', array('%nolimit' => NODE_LIMIT_NO_LIMIT))
+  );
+  
+  $elements = module_invoke_all('node_limit_element', $limit['lid']);
+  $form['node_limit_elements'] = array();
+  foreach ($elements as $module => $element) {
+    $form['node_limit_elements'][$module]['applies'] = array(
+      '#type' => 'checkbox',
+      '#title' => $element['#title'],
+      '#default_value' => isset($limit[$module])
+    );
+    $element['#title'] = '';
+    $form['node_limit_elements'][$module]['element'] = $element;
+  }
+    
+  $form['save'] = array(
+    '#type' => 'submit',
+    '#value' => ($limit['lid'] > 0 ? t('Edit Node Limit') : t('Add Node Limit'))
+  );
+  return $form;
 }
 
 /**
- * validation hook for node_limit_limit_form
- * allows submodules that are applied to validate their own input
+ * Validation hook for node_limit_limit_form.
+ *
+ * Allows submodules that are applied to validate their own input.
  */
 function node_limit_limit_form_validate($form_id, &$form_state) {
   if (!is_numeric($form_state['values']['info']['limit'])) {
     form_set_error('info][limit', t('Node limits must be an integer'));
-  } else if (intval($form_state['values']['info']['limit']) != floatval($form_state['values']['info']['limit'])) {
-    //can't use is_int because is_int("2") == false
+  } 
+  else if (intval($form_state['values']['info']['limit']) != floatval($form_state['values']['info']['limit'])) {
+    // Can't use is_int because is_int("2") == FALSE.
     form_set_error('info][limit', t('Node limits must be an integer'));
-  } else if (intval($form_state['values']['info']['limit']) < NODE_LIMIT_NO_LIMIT) {
+  } 
+  else if (intval($form_state['values']['info']['limit']) < NODE_LIMIT_NO_LIMIT) {
     form_set_error('info][limit', t('Node limits cannot be less that %nolimit', array('%nolimit' => NODE_LIMIT_NO_LIMIT)));
   }
   
@@ -365,26 +394,28 @@
     form_set_error('info][title', t('Invalid Node Limit title'));
   }
   
-  foreach($form_state['values']['node_limit_elements'] as $module => $element) {
+  foreach ($form_state['values']['node_limit_elements'] as $module => $element) {
     if ($element['applies'] === 1) {
-      //they checked the box!
+      // They checked the box!
       $result = module_invoke($module, 'node_limit_element_validate', $element['element']);
       if (is_array($result) && isset($result['error'])) {
-        form_set_error('node_limit_elements]['.$module.'][element', $result['error']);
+        form_set_error('node_limit_elements]['. $module .'][element', $result['error']);
       }
     }
   }
 }
 
 /**
- * submission hook for node_limit_limit_form
- * calls the submission hook on applied submodules to allow them to save their data
+ * Submission hook for node_limit_limit_form.
+ *
+ * Calls the submission hook on applied submodules to allow them to save their data.
  */
 function node_limit_limit_form_submit($form_id, &$form_state) {
   if (isset($form_state['values']['lid'])) {
     $lid = $form_state['values']['lid'];
     db_query("DELETE FROM {node_limit} WHERE `lid`='%d'", $lid);
-  } else {
+  } 
+  else {
     $lid = _node_limit_next_limit_id();
   }
   $type = $form_state['values']['info']['type'];
@@ -392,7 +423,7 @@
   $title = $form_state['values']['info']['title'];
   
   db_query("INSERT INTO {node_limit} VALUES('%d', '%s', '%d', '%s', '0')", $lid, $type, $limit, $title);
-  foreach($form_state['values']['node_limit_elements'] as $module => $element) {
+  foreach ($form_state['values']['node_limit_elements'] as $module => $element) {
     module_invoke($module, 'node_limit_element_submit', $lid, $element['applies'], $element['element']);
   }
   
@@ -401,10 +432,12 @@
 }
 
 /**
- * returns a confirmation form to delete a node limit
+ * Confirmation form to delete a node limit.
  */
 function node_limit_delete_form(&$form_state, $limit) {
-  if ($limit == false) { drupal_goto('admin/user/node_limit'); }
+  if ($limit == FALSE) { 
+    drupal_goto('admin/user/node_limit'); 
+  }
   $form = array(
     'lid' => array(
       '#type' => 'hidden',
@@ -415,7 +448,7 @@
 }
 
 /**
- * submission hook for node limit deletion
+ * Submission hook for node limit deletion.
  */
 function node_limit_delete_form_submit($form_id, &$form_state) {
   $lid = $form_state['values']['lid'];
@@ -425,7 +458,7 @@
 }
 
 /**
- * returns the next available node limit id
+ * Helper function to get the next available node limit id.
  */
 function _node_limit_next_limit_id() {
   $next_lid = db_result(db_query("SELECT (MAX(lid)+1) AS lid FROM {node_limit}"));
@@ -433,23 +466,29 @@
 }
 
 /**
- * returns an array of available content types
+ * Returns an array of available content types.
  */
 function _node_limit_content_types() {
   $types = array(NODE_LIMIT_ANY_CONTENT_TYPE => t('--Any--'));
   $content_types = node_get_types('types');
-  foreach($content_types as $type) {
+  foreach ($content_types as $type) {
     $types[$type->type] = $type->name;
   }
   return $types;
 }
 
 /**
- * loads a node limit
- * returns false if the limit couldn't be loaded
+ * Loads a node limit.
+ * 
+ * @param $lid
+ *   The limit id.
+ * @return 
+ *   FALSE if the limit couldn't be loaded otherwise the limit rule.
  */
 function node_limit_load($lid) {
-  if (!is_numeric($lid)) { return false; }
+  if (!is_numeric($lid)) { 
+    return FALSE; 
+  }
   $info = db_fetch_array(db_query("SELECT * FROM {node_limit} WHERE `lid`='%d'", $lid));
   if ($info['lid'] == $lid && intval($lid) >= 0) {
     //load up the information from the other modules
@@ -457,9 +496,8 @@
     //yes (for setting the default state of the "applies" checkbox when editing a limit)
     $res = module_invoke_all('node_limit_load', $lid);
     return array_merge($info, $res);
-  } else {
-    return false;
+  } 
+  else {
+    return FALSE;
   }
 }
-
-?>
\ No newline at end of file
Index: node_limit.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_limit/node_limit.info,v
retrieving revision 1.1
diff -u -r1.1 node_limit.info
--- node_limit.info	3 Mar 2009 01:58:35 -0000	1.1
+++ node_limit.info	9 Apr 2009 18:30:58 -0000
@@ -1,4 +1,4 @@
 name = Node Limit
-description = Allows admins to restrict the number of nodes a user or role may create
+description = Allows admins to restrict the number of nodes a user or role may create.
 package = Access control
-core = 6.x
\ No newline at end of file
+core = 6.x
