You are here

function og_handler_argument_group_name_like in Organic groups 5

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

File

./og_views.inc, line 390

Code

function og_handler_argument_group_name_like($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/{$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':
      $query
        ->ensure_table('og_node_data');
      $filterinfo['table'] = 'og_node_data';
      $filterinfo['field'] = 'title';
      $filter = array(
        'value' => $arg,
        'operator' => $argtype['options'],
      );
      views_handler_filter_like('handler', $filter, $filterinfo, $query);
      break;
    case 'title':
      return check_plain($query);
  }
}