og_views_handler_field_og_group_nids.inc in Organic groups 6.2
File
modules/og_views/includes/og_views_handler_field_og_group_nids.inc
View source
<?php
class og_views_handler_field_og_group_nids extends views_handler_field_prerender_list {
function init(&$view, $options) {
parent::init($view, $options);
$this->additional_fields['og_ancestry_nid'] = array(
'table' => 'og_ancestry',
'field' => 'nid',
);
}
function query() {
$this
->add_additional_fields();
}
function pre_render($values) {
$this->field_alias = $this->aliases['og_ancestry_nid'];
foreach ($values as $value) {
$result = og_get_node_groups_result($value->{$this->field_alias});
while ($row = db_fetch_object($result)) {
$this->items[$value->{$this->field_alias}][$row->group_nid] = l($row->title, "node/{$row->group_nid}");
}
}
}
}