Skip to content

Commit 3d85964

Browse files
committed
Allow empty-result placeholder in collections
1 parent 6519621 commit 3d85964

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

DashboardPanelCollection.module

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ class DashboardPanelCollection extends DashboardPanel
4040
*/
4141
public function getContent()
4242
{
43+
if (!$this->collection->count) {
44+
return $this->emptyMessage;
45+
}
46+
4347
if ($this->actions !== false) {
4448
$this->columns['actions__'] = ''; // $this->_('Actions');
4549
}
@@ -282,6 +286,7 @@ class DashboardPanelCollection extends DashboardPanel
282286
$this->sortable = $this->data['sortable'] ?? false;
283287
$this->showHeaders = $this->data['headers'] ?? true;
284288
$this->dateFormat = $this->data['dateFormat'] ?? 'relative';
289+
$this->emptyMessage = $this->data['emptyMessage'] ?? '';
285290
$this->maxImageNum = $this->data['maxImageNum'] ?? 1;
286291
$this->parent = $this->getPageFromObjectOrSelectorOrID($this->data['parent'] ?? null);
287292
$this->template = $this->templates->get($this->data['template'] ?? null);

0 commit comments

Comments
 (0)