You are here

class biblio_handler_field_biblio_type in Bibliography Module 6

Same name and namespace in other branches
  1. 6.2 views/biblio_handler_field_biblio_type.inc \biblio_handler_field_biblio_type
  2. 7 views/biblio_handler_field_biblio_type.inc \biblio_handler_field_biblio_type
  3. 7.2 views/biblio_handler_field_biblio_type.inc \biblio_handler_field_biblio_type

Hierarchy

Expanded class hierarchy of biblio_handler_field_biblio_type

File

views/biblio_handler_field_biblio_type.inc, line 3

View source
class biblio_handler_field_biblio_type extends views_handler_field {
  function init(&$view, $options) {
    parent::init($view, $options);
    if ($view->base_table == 'node_revisions') {
      $this->additional_fields['vid'] = array(
        'table' => 'node_revisions',
        'field' => 'vid',
      );
    }
    else {
      $this->additional_fields['vid'] = array(
        'table' => 'node',
        'field' => 'vid',
      );
    }
  }
  function pre_render($values) {
    $this->field_alias = $this->aliases['vid'];
    $vids = array();
    foreach ($values as $result) {
      if (!empty($result->{$this->aliases['vid']})) {
        $vids[] = $result->{$this->aliases['vid']};
      }
    }

    //print_r($values);
    if ($vids) {

      //$result = db_query("SELECT bt.name AS node_vid, bkd.* FROM {biblio_keyword_data} bkd INNER JOIN {biblio_keyword} bk ON bkd.kid = bk.kid WHERE bk.vid IN (" . implode(', ', $vids) . ") ORDER BY  bkd.word");
      $result = db_query("SELECT name, tid\n                          FROM {biblio_types} t\n                          WHERE IN (" . implode(', ', $vids) . ") \n                         ");
      while ($term = db_fetch_object($result)) {

        //        if (empty($this->options['link_to_taxonomy'])) {
        $this->items[$term->node_vid][$term->kid] = check_plain($term->word);

        //        }
        //        else {
        //          $this->items[$term->node_vid][$term->kid] = l($term->word, taxonomy_term_path($term));
        //        }
      }
    }
  }

}

Members