You are here

function og_handler_argument_gid in Organic groups 5

Same name and namespace in other branches
  1. 5.8 og_views.inc \og_handler_argument_gid()
  2. 5.2 og_views.inc \og_handler_argument_gid()
  3. 5.3 og_views.inc \og_handler_argument_gid()
  4. 5.7 og_views.inc \og_handler_argument_gid()
1 string reference to 'og_handler_argument_gid'
og_views_arguments in ./og_views.inc

File

./og_views.inc, line 346

Code

function og_handler_argument_gid($op, &$query, $argtype, $arg = '') {
  switch ($op) {
    case 'summary':
      og_handler_summary($fieldinfo, $query);
      return $fieldinfo;
    case 'link':
      if ($name = $query->title) {
        return l($name, "node/" . intval($query->group_nid));
      }
      else {

        // return l(t('Unaffiliated'), "$arg/-1-1"); // just signifies 'no group'
        return t('All posts');
      }
      break;
    case 'sort':

      // no luck using add_orderby method.
      $query->orderby[] = ' num_nodes ' . $argtype;
      break;
    case 'filter':
      og_views_break_phrase($arg, $query);
      break;
    case 'title':
      return db_result(db_query_range('SELECT title FROM {node} WHERE nid = %d', $query, 0, 1));
  }
}