You are here

function og_all_groups_options in Organic groups 5.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.3 og.module \og_all_groups_options()
  4. 5.7 og.module \og_all_groups_options()
  5. 6.2 og.module \og_all_groups_options()
  6. 6 og.module \og_all_groups_options()
2 calls to og_all_groups_options()
og_form_add_og_audience in ./og.module
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 by other OG contrib modules.
og_node_delete_group_form in ./og.module

File

./og.module, line 1473

Code

function og_all_groups_options() {
  list($types, $in) = og_get_sql_args();
  $sql = "SELECT n.title, n.nid FROM {node} n WHERE n.type IN ({$in}) AND n.status = 1 ORDER BY n.title ASC";
  $result = db_query($sql, $types);
  while ($row = db_fetch_object($result)) {
    $options[$row->nid] = $row->title;
  }
  return $options ? $options : array();
}