You are here

function og_all_groups_options in Organic groups 6.2

Same name and namespace in other branches
  1. 5.8 og.module \og_all_groups_options()
  2. 5 og.module \og_all_groups_options()
  3. 5.2 og.module \og_all_groups_options()
  4. 5.3 og.module \og_all_groups_options()
  5. 5.7 og.module \og_all_groups_options()
  6. 6 og.module \og_all_groups_options()

Get a list of all groups accessible to the current user for posting.

Return value

Array containing all groups - suitable for a form item.

12 calls to og_all_groups_options()
og_add_group_action_form in modules/og_actions/og_actions.module
Configuration form for Add Group action.
og_approve_user_action_form in modules/og_actions/og_actions.module
Configuration form for Approve User action.
og_demote_user_action_form in modules/og_actions/og_actions.module
Configuration form for Demote User action.
og_deny_user_action_form in modules/og_actions/og_actions.module
Configuration form for Deny User action.
og_form_add_og_audience in ./og.module
Add OG audience fields to a given form.

... See full list

File

./og.module, line 2026
Code for the Organic Groups module.

Code

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";
  $result = db_query(db_rewrite_sql($sql), $types);
  while ($row = db_fetch_object($result)) {
    $options[$row->nid] = $row->title;
  }
  return isset($options) ? $options : array();
}