summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_area_result.inc
diff options
context:
space:
mode:
Diffstat (limited to 'kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_area_result.inc')
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_area_result.inc13
1 files changed, 8 insertions, 5 deletions
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_area_result.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_area_result.inc
index a52aa8c..86b1849 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_area_result.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_area_result.inc
@@ -2,13 +2,13 @@
/**
* @file
- * Contains views_handler_area_result handler.
+ * Definition of views_handler_area_result.
*/
/**
* Views area handler to display some configurable result summary.
*
- * @ingroup views_area_handlers Views' area handlers
+ * @ingroup views_area_handlers
*/
class views_handler_area_result extends views_handler_area {
@@ -33,6 +33,7 @@ class views_handler_area_result extends views_handler_area {
'@name -- the human-readable name of the view',
'@per_page -- the number of items per page',
'@current_page -- the current page number',
+ '@current_record_count -- the current page record count',
'@page_count -- the total page count',
),
);
@@ -61,7 +62,9 @@ class views_handler_area_result extends views_handler_area {
$current_page = (int) $this->view->get_current_page() + 1;
$per_page = (int) $this->view->get_items_per_page();
$count = count($this->view->result);
- $total = $this->view->total_rows;
+ // @TODO: Maybe use a possible is views empty functionality.
+ // Not every view has total_rows set, use view->result instead.
+ $total = isset($this->view->total_rows) ? $this->view->total_rows : count($this->view->result);
$name = check_plain($this->view->human_name);
if ($per_page === 0) {
$page_count = 1;
@@ -77,8 +80,9 @@ class views_handler_area_result extends views_handler_area {
$start = ($current_page - 1) * $per_page + 1;
$end = $total_count;
}
+ $current_record_count = ($end - $start) + 1;
// Get the search information.
- $items = array('start', 'end', 'total', 'name', 'per_page', 'current_page', 'page_count');
+ $items = array('start', 'end', 'total', 'name', 'per_page', 'current_page', 'current_record_count', 'page_count');
$replacements = array();
foreach ($items as $item) {
$replacements["@$item"] = ${$item};
@@ -90,4 +94,3 @@ class views_handler_area_result extends views_handler_area {
return $output;
}
}
-