Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - function pre_render($results) {
- + function pre_render&($results) {
- parent::pre_render($results);
- // If there are no calc fields, do nothing.
- if (!$calc_fields = $this->get_calc_fields()) {
- return;
- }
- // If we're not getting a summary row, do nothing.
- if (!empty($this->view->views_calc_calculation)) {
- return;
- }
- $this->view->totals = array();
- $this->view->sub_totals = array();
- $this->view->views_calc_fields = $calc_fields;
- $this->view->views_calc_calculation = FALSE;
- // Subtotals and pager totals require a list of the specific
- // values to include.
- $paged = FALSE;
- if (!empty($this->view->pager)
- && !empty($this->view->pager['use_pager'])
- && !empty($this->view->pager['items_per_page'])
- && $this->view->total_rows > $this->view->pager['items_per_page']) {
- $ids = array();
- foreach ($this->view->result as $delta => $value) {
- $ids[] = $value->{$this->view->base_field};
- }
- // Add sub_total rows to the results.
- // We need one query per aggregation because theming needs unrenamed views field alias.
- // TODO Looks like we have problems unless we
- // force a non-page display, need to keep an eye on this.
- $this->execute_summary_view($ids);
- }
- // Add grand totals to the results.
- $this->execute_summary_view();
- }
Add Comment
Please, Sign In to add comment