class content_plugin_style_php_array_ac in Content Construction Kit (CCK) 6.2
Same name and namespace in other branches
- 6.3 includes/views/handlers/content_plugin_style_php_array_ac.inc \content_plugin_style_php_array_ac
@file Handler for 'content_php_array_autocomplete' style.
Hierarchy
- class \content_plugin_style_php_array_ac extends \views_plugin_style
Expanded class hierarchy of content_plugin_style_php_array_ac
1 string reference to 'content_plugin_style_php_array_ac'
- content_views_plugins in includes/
views/ content.views.inc - Implementation of hook_views_plugins.
File
- includes/
views/ handlers/ content_plugin_style_php_array_ac.inc, line 7 - Handler for 'content_php_array_autocomplete' style.
View source
class content_plugin_style_php_array_ac extends views_plugin_style {
function render() {
$results = array();
// Group the rows according to the grouping field, if specified.
$sets = $this
->render_grouping($this->view->result, $this->options['grouping']);
$base_field = $this->view->base_field;
$title_field = $this->display->display_options['content_title_field'];
$title_field_alias = $this->view->field[$title_field]->field_alias;
// TODO : We don't display grouping info for now.
// Could be useful for select widget, though.
$this->view->row_index = 0;
foreach ($sets as $title => $records) {
foreach ($records as $label => $row) {
$results[$row->{$base_field}] = array(
'title' => $row->{$title_field_alias},
'rendered' => $this->row_plugin
->render($row),
);
$this->view->row_index++;
}
}
unset($this->view->row_index);
return $results;
}
}