Guest User

Untitled

a guest
Jun 21st, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. - function pre_render($results) {
  2. + function pre_render&($results) {
  3. parent::pre_render($results);
  4.  
  5. // If there are no calc fields, do nothing.
  6. if (!$calc_fields = $this->get_calc_fields()) {
  7. return;
  8. }
  9.  
  10. // If we're not getting a summary row, do nothing.
  11. if (!empty($this->view->views_calc_calculation)) {
  12. return;
  13. }
  14.  
  15. $this->view->totals = array();
  16. $this->view->sub_totals = array();
  17. $this->view->views_calc_fields = $calc_fields;
  18. $this->view->views_calc_calculation = FALSE;
  19.  
  20. // Subtotals and pager totals require a list of the specific
  21. // values to include.
  22. $paged = FALSE;
  23. if (!empty($this->view->pager)
  24. && !empty($this->view->pager['use_pager'])
  25. && !empty($this->view->pager['items_per_page'])
  26. && $this->view->total_rows > $this->view->pager['items_per_page']) {
  27. $ids = array();
  28. foreach ($this->view->result as $delta => $value) {
  29. $ids[] = $value->{$this->view->base_field};
  30. }
  31. // Add sub_total rows to the results.
  32. // We need one query per aggregation because theming needs unrenamed views field alias.
  33. // TODO Looks like we have problems unless we
  34. // force a non-page display, need to keep an eye on this.
  35. $this->execute_summary_view($ids);
  36. }
  37.  
  38. // Add grand totals to the results.
  39. $this->execute_summary_view();
  40. }
Add Comment
Please, Sign In to add comment