summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--og.module53
1 files changed, 37 insertions, 16 deletions
diff --git a/og.module b/og.module
index 3109502..af3cbcc 100644
--- a/og.module
+++ b/og.module
@@ -1598,7 +1598,9 @@ function og_form_node_delete_confirm_alter(&$form, &$form_state) {
}
}
-// Make sure max number of groups is positive integer
+/**
+ * Make sure max number of groups is positive integer.
+ */
function og_node_type_form_validate($form, &$form_state) {
$max_number = $form_state['values']['og_max_groups'];
if ($max_number != '' && (!is_numeric($max_number) || $max_number <= 0 || floor($max_number) != $max_number)) {
@@ -1606,7 +1608,9 @@ function og_node_type_form_validate($form, &$form_state) {
}
}
-// Rebuild node access if Usage has changed
+/**
+ * Rebuild node access if usage has changed.
+ */
function og_node_type_form_submit($form, &$form_state) {
$type = $form_state['values']['type'];
$var = 'og_content_type_usage';
@@ -1619,7 +1623,9 @@ function og_node_type_form_submit($form, &$form_state) {
unset($form_state['values']['old_'. $var]);
}
-// Form_alter() the node_delete form for a group
+/**
+ * Form alter the node delete form for a group.
+ */
function og_node_delete_group_form(&$form) {
$options[OG_DELETE_NOTHING] = t('Do nothing.');
$options[OG_DELETE_ORPHANS] = t("Delete all group posts which don't also belong to another group.");
@@ -1656,16 +1662,23 @@ function og_node_delete_group_form(&$form) {
$form['actions']['submit']['#value'] = t('Delete group');
}
-// Alter the node_delete form for a non-group.
-// Redirect back to group home page after a delete.
+/**
+ * Alter the node delete form for a non-group.
+ *
+ * Redirect back to group home page after a delete.
+ */
function og_node_delete_nongroup_form(&$form) {
if ($groupnode = og_get_group_context()) {
$form['#redirect'] = "node/$groupnode->nid";
}
}
-// Return all node ids belonging to a group. No access control.
-// If you are retrieving for displaying, you may want to use an embedded View instead of this function.
+/**
+ * Return all node ids belonging to a group. No access control.
+ *
+ * If you are retrieving for displaying, you may want to use an embedded View
+ * instead of this function.
+ */
function og_group_child_nids($group_nid) {
$result = db_query('SELECT oga.nid FROM {og_ancestry} oga WHERE oga.group_nid = %d', $group_nid);
$child_nids = array();
@@ -1675,7 +1688,9 @@ function og_group_child_nids($group_nid) {
return $child_nids;
}
-// Submit handler for node delete form. Handles deletes to group nodes.
+/**
+ * Submit handler for node delete form. Handles deletes to group nodes.
+ */
function og_node_delete_confirm_submit($form, &$form_state) {
$deleted_group_nid = $form_state['values']['nid'];
$target_group_nid = $form_state['values']['target'];
@@ -1732,7 +1747,9 @@ function og_node_delete_move_memberships($form, &$form_state) {
}
}
-// Return an array containing all groups - suitable for a form item.
+/**
+ * Return an array containing all groups - suitable for a form item.
+ */
function og_all_groups_options() {
list($types, $in) = og_get_sql_args();
$sql = "SELECT n.nid, n.title FROM {node} n WHERE n.type $in AND n.status = 1 ORDER BY n.title ASC";
@@ -1744,13 +1761,16 @@ function og_all_groups_options() {
}
/**
- * Iterate over a set of groups and separate out those that are inaccessible to the current user.
- * Don't return groups of which the current user is a member, unless $exclude_joined=FALSE
- * is passed. Used in og_form_add_og_audience() and node.tpl.php.
+ * Iterate over a set of groups and separate out those that are inaccessible to
+ * the current user.
*
- * @return array
+ * Don't return groups of which the current user is a member,
+ * unless $exclude_joined=FALSE is passed. Used in og_form_add_og_audience()
+ * and node.tpl.php.
+ *
+ * @return
* A two element array containing 'accessible' and 'inaccessible' keys.
- **/
+ */
function og_node_groups_distinguish($groups_names_both, $exclude_joined = TRUE) {
global $user;
@@ -1780,8 +1800,9 @@ function og_node_groups_distinguish($groups_names_both, $exclude_joined = TRUE)
}
/**
- * Helper method to add OG audience fields to a given form. This is
- * lives in a separate function from og_form_alter() so it can be shared
+ * Helper method to add OG audience fields to a given form.
+ *
+ * This lives in a separate function from og_form_alter() so it can be shared
* by other OG contrib modules.
*/
function og_form_add_og_audience(&$form, &$form_state) {