Permalink
Browse files

added EE 2.4 compatibility

  • Loading branch information...
1 parent b92252b commit d249f08556e839a6fb6f5bcdae10257a8165b0fd @rsanchez committed Feb 10, 2012
@@ -112,7 +112,14 @@ public function channel_entries_tagdata_end($tagdata, $row, $channel)
$tagdata = $this->EE->extensions->last_call;
}
- $tagdata = $this->EE->TMPL->swap_var_single('absolute_total_results', $channel->total_rows, $tagdata);
+ if (version_compare(APP_VER, '2.4', '<'))
+ {
+ $tagdata = $this->EE->TMPL->swap_var_single('absolute_total_results', $channel->total_rows, $tagdata);
+ }
+ else
+ {
+ $tagdata = $this->EE->TMPL->swap_var_single('absolute_total_results', $channel->pagination->total_rows, $tagdata);
+ }
return $tagdata;
}
@@ -129,8 +136,21 @@ public function channel_entries_tagdata_end($tagdata, $row, $channel)
*/
public function channel_entries_query_result($channel, $query_result)
{
- $channel->paginate_data = $this->EE->TMPL->swap_var_single('absolute_total_results', $channel->total_rows, $channel->paginate_data);
- $channel->paginate_data = $this->EE->TMPL->swap_var_single('absolute_results', $channel->total_rows, $channel->paginate_data);
+ if ($this->EE->extensions->last_call !== FALSE)
+ {
+ $query_result = $this->EE->extensions->last_call;
+ }
+
+ if (version_compare(APP_VER, '2.4', '<'))
+ {
+ $channel->paginate_data = $this->EE->TMPL->swap_var_single('absolute_total_results', $channel->total_rows, $channel->paginate_data);
+ $channel->paginate_data = $this->EE->TMPL->swap_var_single('absolute_results', $channel->total_rows, $channel->paginate_data);
+ }
+ else
+ {
+ $channel->pagination->template_data = $this->EE->TMPL->swap_var_single('absolute_total_results', $channel->pagination->total_rows, $channel->pagination->template_data);
+ $channel->pagination->template_data = $this->EE->TMPL->swap_var_single('absolute_results', $channel->pagination->total_rows, $channel->pagination->template_data);
+ }
return $query_result;
}

0 comments on commit d249f08

Please sign in to comment.