Page MenuHomeIn-Portal Phabricator

D228.id539.diff
No OneTemporary

File Metadata

Created
Wed, May 7, 9:54 PM

D228.id539.diff

Index: core/kernel/db/db_tag_processor.php
===================================================================
--- core/kernel/db/db_tag_processor.php
+++ core/kernel/db/db_tag_processor.php
@@ -2108,6 +2108,9 @@
case 'total':
return $object->GetRecordsCount(false);
+ case 'selected':
+ return $object->GetSelectedCount();
+
case 'from':
return $object->GetRecordsCount() ? $object->GetOffset() + 1 : 0; //0-based
@@ -2298,6 +2301,20 @@
}
/**
+ * Print selected records count.
+ *
+ * @param array $params Tag params.
+ *
+ * @return string
+ */
+ protected function SelectedRecords(array $params)
+ {
+ $list =& $this->GetList($params);
+
+ return $list->GetSelectedCount();
+ }
+
+ /**
* Range filter field name
*
* @param Array $params
Index: core/kernel/db/dblist.php
===================================================================
--- core/kernel/db/dblist.php
+++ core/kernel/db/dblist.php
@@ -439,7 +439,7 @@
*/
public function GetRecordsCount($with_filters = true)
{
- if (!$this->Counted) {
+ if ( !$this->Counted ) {
$this->CountRecs();
}
@@ -454,6 +454,8 @@
*/
public function GetSelectedCount()
{
+ $this->Query();
+
return $this->SelectedCount;
}

Event Timeline