Commit 537362c1 authored by webchick's avatar webchick
Browse files

Issue #1876964 by dawehner, tim.plunkett: Improve DX when writing style...

Issue #1876964 by dawehner, tim.plunkett: Improve DX when writing style plugins by adding a renderSingle function.
parent 98865e8c
......@@ -393,6 +393,20 @@ function pre_render($result) {
}
}
/**
* Renders a single group of a grouped view.
*
* @return array
* The render array containing the single view theme output.
*/
protected function renderSingleGroup(array $rows = array()) {
return array(
'#theme' => $this->themeFunctions(),
'#view' => $this->view,
'#rows' => $rows,
);
}
/**
* Render the display in this style.
*/
......@@ -453,14 +467,10 @@ function render_grouping_sets($sets, $level = 0) {
}
}
$output[] = array(
'#theme' => $this->themeFunctions(),
'#view' => $this->view,
'#options' => $this->options,
'#grouping_level' => $level,
'#rows' => $set['rows'],
'#title' => $set['group'],
);
$single_output = $this->renderSingleGroup($set['rows']);
$single_output['#grouping_level'] = $level;
$single_output['#title'] = $set['group'];
$output[] = $single_output;
}
}
unset($this->view->row_index);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment