You are here

function views_handler_arg_vocid in Views (for Drupal 7) 5

1 string reference to 'views_handler_arg_vocid'
taxonomy_views_arguments in modules/views_taxonomy.inc

File

modules/views_taxonomy.inc, line 352

Code

function views_handler_arg_vocid($op, &$query, $argtype, $arg = '') {
  switch ($op) {
    case 'summary':
      $query
        ->ensure_table('vocabulary');
      $query
        ->add_field('name', 'vocabulary');
      $query
        ->add_field('vid', 'vocabulary');
      $fieldinfo['field'] = "vocabulary.name";
      return $fieldinfo;
    case 'sort':
      $query
        ->add_orderby('vocabulary', 'weight', $argtype);
      $query
        ->add_orderby('vocabulary', 'name', $argtype);
      break;
    case 'filter':
      $query
        ->ensure_table('vocabulary');
      $query
        ->add_where('vocabulary.vid = %d', $arg);
      $query
        ->set_distinct();
      break;
    case 'link':
      return l($query->name, "{$arg}/" . intval($query->vid));
    case 'title':
      $result = db_query("SELECT name FROM {vocabulary} WHERE vid = %d", $query);
      $voc = db_fetch_object($result);
      return $voc->name ? check_plain($voc->name) : t('Uncatgorized');
  }
}