You are here

function views_handler_filter_tid in Views (for Drupal 7) 5

1 string reference to 'views_handler_filter_tid'
taxonomy_views_tables in modules/views_taxonomy.inc
This include file implements views functionality on behalf of taxonomy.module

File

modules/views_taxonomy.inc, line 414

Code

function views_handler_filter_tid($op, $filterinfo) {
  $tids = array();
  if ($filterinfo['vocabulary']) {
    $where = "WHERE td.vid = {$filterinfo['vocabulary']}";
  }
  $result = db_query("SELECT DISTINCT(td.tid), td.name, td.weight, v.name as vocabname, v.weight FROM {term_data} td LEFT JOIN {vocabulary} v ON v.vid = td.vid {$where} ORDER BY v.weight, v.name, td.weight, td.name");
  while ($obj = db_fetch_object($result)) {
    if ($filterinfo['vocabulary']) {
      $tids[$obj->tid] = "{$obj->name}";
    }
    else {
      $tids[$obj->tid] = "{$obj->vocabname}: {$obj->name}";
    }
  }
  return $tids;
}