Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F847894
D228.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Apr 19, 7:32 PM
Size
1 KB
Mime Type
text/x-diff
Expires
Sun, Apr 20, 7:32 PM (47 m, 50 s)
Engine
blob
Format
Raw Data
Handle
602676
Attached To
D228: INP-1551 Add the "kDBList::GetSelectedCount" method and "SelectedRecords" tag using it
D228.diff
View Options
Index: branches/5.2.x/core/kernel/db/db_tag_processor.php
===================================================================
--- branches/5.2.x/core/kernel/db/db_tag_processor.php
+++ branches/5.2.x/core/kernel/db/db_tag_processor.php
@@ -2032,6 +2032,9 @@
case 'total':
return $object->GetRecordsCount(false);
+ case 'selected':
+ return $object->GetSelectedCount();
+
case 'from':
return $object->GetRecordsCount() ? $object->GetOffset() + 1 : 0; //0-based
@@ -2222,6 +2225,20 @@
}
/**
+ * Returns 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: branches/5.2.x/core/kernel/db/dblist.php
===================================================================
--- branches/5.2.x/core/kernel/db/dblist.php
+++ branches/5.2.x/core/kernel/db/dblist.php
@@ -454,6 +454,8 @@
*/
public function GetSelectedCount()
{
+ $this->Query();
+
return $this->SelectedCount;
}
Event Timeline
Log In to Comment