Index: taxonomy_access.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_access/taxonomy_access.module,v
retrieving revision 1.107.2.7
diff -u -F f -r1.107.2.7 taxonomy_access.module
--- taxonomy_access.module	15 May 2009 01:23:33 -0000	1.107.2.7
+++ taxonomy_access.module	21 Feb 2010 11:01:44 -0000
@@ -398,3 +398,150 @@       foreach ($terms as $tid) {
     }
   }
 }
+/**
+ * Gets permissions for a given role
+ * @param $rid
+ *   The role id to retrieve the permissions for.
+ * @return
+ *   A two dimensional hash of the form $grants[tid][grant] where
+ *   tid is the term id and
+ *   grant is the permission (i.e. 'view','delete',ect.)
+ *   this entry in the hash is true if permission is granted, false otherwise
+**/
+function taxonomy_access_get_grants($rid) {
+  if (!isset($rid)) {
+    return false;
+  }
+  if (isset($rid) && !is_numeric($rid)) {
+    $rid = db_result(db_query("SELECT rid FROM {role} WHERE name='%s'", $rid));
+  }
+  $result = db_query("SELECT * FROM {term_access} WHERE rid=%d", $rid);
+  $grants = array();
+  while ($grant = db_fetch_array($result)) {
+    $tid = $grant['tid'];
+    foreach ($grant as $key => $grant_val) {
+      if (strpos($key, 'grant_') !== FALSE) {
+        $grant_name = '';
+        $grant_name = str_replace('grant_', '', $key);
+        if (!isset($grants[$tid][$grant_name]) || !($grants[$tid][$grant_name])) {
+          // If there's conflicting DB rules, take the most lenient
+          $grants[$tid][$grant_name] = $grant_val;
+        }
+      }
+    }
+  }
+  return $grants;
+}
+/**
+ * Gets default permissions for a given role
+ * @param $rid
+ *   The role id to retrieve the permissions for.
+ * @return
+ *   A two dimensional hash of the form $grants[vid][grant] where
+ *   vid is the vocab id and
+ *   grant is the permission (i.e. 'view','delete',ect.)
+ *   this entry in the hash is true if permission is granted, false otherwise
+**/
+function taxonomy_access_get_default_grants($rid) {
+  if (!is_numeric($rid)) {
+    return false;
+  }
+  $result = db_query("SELECT * FROM {term_access_defaults} WHERE rid=%d", $rid);
+  $grants = array();
+  while ($grant = db_fetch_array($result)) {
+    $vid = $grant['vid'];
+    foreach ($grant as $key => $grant_val) {
+      if (strpos($key, 'grant_') !== FALSE) {
+        $grant_name = '';
+        $grant_name = str_replace('grant_', '', $key);
+        if (!isset($grants[$vid][$grant_name]) || !($grants[$vid][$grant_name])) {
+          // If there's conflicting DB rules, take the most lenient
+          $grants[$vid][$grant_name] = $grant_val;
+        }
+      }
+    }
+  }
+  return $grants;
+}
+
+/*
+ * Issue #167977 - klance
+ * Gets node ids associated with a given term
+ * @param $tid
+ *    The term id for which to retrieve associated nodes
+ * @return $nid
+ *    An array of node ids associated with the given term
+ */
+function _taxonomy_access_get_nodes_for_term($tid) {
+  $nid = array();
+  $result = db_query("SELECT nid FROM {term_node} WHERE tid = '$tid'");
+  
+  while($node = db_fetch_object($result)) {
+    $nid[] = $node->nid;
+  }
+  return $nid;
+}
+
+/*
+ * Issue #167977 - klance
+ * Gets node ids associated with a given vocabulary
+ * @param $vid
+ *    The vocabulary id for which to retrieve associated term ids
+ * @params $rid
+ *    The role id for which to retrieve associated term ids
+ * @return $nid
+ *    An array of node ids associated with the given term
+ */
+function _taxonomy_access_get_nodes_for_vocabulary($vid, $rid = NULL) {
+  $nid = array();
+  $query = "SELECT n.nid FROM {term_node} n
+    LEFT JOIN {term_data} d ON n.tid = d.tid
+    LEFT JOIN {term_access} a ON n.tid = a.tid
+    WHERE d.vid = '$vid'";
+  if(!is_null($rid)) {
+    $query .= " AND a.rid = '$rid'";
+  }
+  $result = db_query($query);
+  
+  while($node = db_fetch_object($result)) {
+    $nid[] = $node->nid;
+  }
+  return $nid;
+}
+
+/*
+ * Issue #167977 - klance
+ * Gets node ids associated with the given role
+ * @param $rid
+ *    The role id for which to retrieve term ids that are
+ *    access-controlled for this role
+ * @return $nid
+ *    An array of node ids associated with the given term
+ */
+function _taxonomy_access_get_nodes_for_role($rid) {
+  $nid = array();
+  $result = db_query("
+    SELECT n.nid FROM {term_node} n LEFT JOIN {term_access} a ON n.tid = a.tid WHERE a.rid = '$rid'
+  ");
+  
+  while($node = db_fetch_object($result)) {
+    $nid[] = $node->nid;
+  }
+  return $nid;
+}
+
+/*
+ * Issue #167977
+ * Gets node ids associated with the given term
+ * @return $nid
+ *    An array of node ids for which to acquire access permissions
+ */
+function _taxonomy_access_node_access_update($nid) {
+  foreach($nid as $node) {
+    $loaded_node = node_load($node, NULL, TRUE);
+    if (!empty($loaded_node)) {
+      node_access_acquire_grants($loaded_node);
+    }
+  }
+  return TRUE;
+}
Index: taxonomy_access_admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_access/taxonomy_access_admin.inc,v
retrieving revision 1.15.2.3
diff -u -F f -r1.15.2.3 taxonomy_access_admin.inc
--- taxonomy_access_admin.inc	29 Jul 2008 17:47:58 -0000	1.15.2.3
+++ taxonomy_access_admin.inc	21 Feb 2010 11:01:45 -0000
@@ -426,150 +426,3 @@   db_query($ta_sql);  // insert into ter
   _taxonomy_access_node_access_update($affected_nodes);
 }
 
-/**
- * Gets permissions for a given role
- * @param $rid
- *   The role id to retrieve the permissions for.
- * @return
- *   A two dimensional hash of the form $grants[tid][grant] where
- *   tid is the term id and
- *   grant is the permission (i.e. 'view','delete',ect.)
- *   this entry in the hash is true if permission is granted, false otherwise
-**/
-function taxonomy_access_get_grants($rid) {
-  if (!isset($rid)) {
-    return false;
-  }
-  if (isset($rid) && !is_numeric($rid)) {
-    $rid = db_result(db_query("SELECT rid FROM {role} WHERE name='%s'", $rid));
-  }
-  $result = db_query("SELECT * FROM {term_access} WHERE rid=%d", $rid);
-  $grants = array();
-  while ($grant = db_fetch_array($result)) {
-    $tid = $grant['tid'];
-    foreach ($grant as $key => $grant_val) {
-      if (strpos($key, 'grant_') !== FALSE) {
-        $grant_name = '';
-        $grant_name = str_replace('grant_', '', $key);
-        if (!isset($grants[$tid][$grant_name]) || !($grants[$tid][$grant_name])) {
-          // If there's conflicting DB rules, take the most lenient
-          $grants[$tid][$grant_name] = $grant_val;
-        }
-      }
-    }
-  }
-  return $grants;
-}
-/**
- * Gets default permissions for a given role
- * @param $rid
- *   The role id to retrieve the permissions for.
- * @return
- *   A two dimensional hash of the form $grants[vid][grant] where
- *   vid is the vocab id and
- *   grant is the permission (i.e. 'view','delete',ect.)
- *   this entry in the hash is true if permission is granted, false otherwise
-**/
-function taxonomy_access_get_default_grants($rid) {
-  if (!is_numeric($rid)) {
-    return false;
-  }
-  $result = db_query("SELECT * FROM {term_access_defaults} WHERE rid=%d", $rid);
-  $grants = array();
-  while ($grant = db_fetch_array($result)) {
-    $vid = $grant['vid'];
-    foreach ($grant as $key => $grant_val) {
-      if (strpos($key, 'grant_') !== FALSE) {
-        $grant_name = '';
-        $grant_name = str_replace('grant_', '', $key);
-        if (!isset($grants[$vid][$grant_name]) || !($grants[$vid][$grant_name])) {
-          // If there's conflicting DB rules, take the most lenient
-          $grants[$vid][$grant_name] = $grant_val;
-        }
-      }
-    }
-  }
-  return $grants;
-}
-
-/*
- * Issue #167977 - klance
- * Gets node ids associated with a given term
- * @param $tid
- *    The term id for which to retrieve associated nodes
- * @return $nid
- *    An array of node ids associated with the given term
- */
-function _taxonomy_access_get_nodes_for_term($tid) {
-  $nid = array();
-  $result = db_query("SELECT nid FROM {term_node} WHERE tid = '$tid'");
-  
-  while($node = db_fetch_object($result)) {
-    $nid[] = $node->nid;
-  }
-  return $nid;
-}
-
-/*
- * Issue #167977 - klance
- * Gets node ids associated with a given vocabulary
- * @param $vid
- *    The vocabulary id for which to retrieve associated term ids
- * @params $rid
- *    The role id for which to retrieve associated term ids
- * @return $nid
- *    An array of node ids associated with the given term
- */
-function _taxonomy_access_get_nodes_for_vocabulary($vid, $rid = NULL) {
-  $nid = array();
-  $query = "SELECT n.nid FROM {term_node} n
-    LEFT JOIN {term_data} d ON n.tid = d.tid
-    LEFT JOIN {term_access} a ON n.tid = a.tid
-    WHERE d.vid = '$vid'";
-  if(!is_null($rid)) {
-    $query .= " AND a.rid = '$rid'";
-  }
-  $result = db_query($query);
-  
-  while($node = db_fetch_object($result)) {
-    $nid[] = $node->nid;
-  }
-  return $nid;
-}
-
-/*
- * Issue #167977 - klance
- * Gets node ids associated with the given role
- * @param $rid
- *    The role id for which to retrieve term ids that are
- *    access-controlled for this role
- * @return $nid
- *    An array of node ids associated with the given term
- */
-function _taxonomy_access_get_nodes_for_role($rid) {
-  $nid = array();
-  $result = db_query("
-    SELECT n.nid FROM {term_node} n LEFT JOIN {term_access} a ON n.tid = a.tid WHERE a.rid = '$rid'
-  ");
-  
-  while($node = db_fetch_object($result)) {
-    $nid[] = $node->nid;
-  }
-  return $nid;
-}
-
-/*
- * Issue #167977
- * Gets node ids associated with the given term
- * @return $nid
- *    An array of node ids for which to acquire access permissions
- */
-function _taxonomy_access_node_access_update($nid) {
-  foreach($nid as $node) {
-    $loaded_node = node_load($node, NULL, TRUE);
-    if (!empty($loaded_node)) {
-      node_access_acquire_grants($loaded_node);
-    }
-  }
-  return TRUE;
-}
