From 0dfe1d8afafc59c4a5559c498342668d5a58d6ef Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Thu, 23 Jul 2026 22:41:41 +0000
Subject: [PATCH] =Still working away at the Integrations overhaul
---
inc/ui/CRUDSkeleton.php | 38 ++++++++++++++++++++++++++++----------
1 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/inc/ui/CRUDSkeleton.php b/inc/ui/CRUDSkeleton.php
index b231217..87eec03 100644
--- a/inc/ui/CRUDSkeleton.php
+++ b/inc/ui/CRUDSkeleton.php
@@ -38,6 +38,7 @@
protected string $singular = '';
protected string $plural = '';
protected string $icon;
+ protected string $emptyState = '';
// Capabilities
protected array $caps = [];
@@ -145,6 +146,15 @@
return $this;
}
+ public function icon(string $icon):void
+ {
+ $this->icon = $icon;
+ }
+
+ public function getIcon():string
+ {
+ return $this->icon;
+ }
/**
* Set content type information
*/
@@ -533,7 +543,7 @@
* Render the CRUD interface
*/
public function render(): void {
- $config = $this->build();
+
$classes = array_merge(['dashboard-page', $this->dataType], $this->additionalClasses);
// ob_start();
@@ -1102,15 +1112,23 @@
}
protected function renderEmptyState():string
{
- ob_start();
- ?>
- <div class="empty-state">
- <h3><?=jvbDashIcon($this->icon)?>Nothing here<?=jvbDashIcon($this->icon)?></h3>
- <p>It doesn't look like you have any <?=$this->plural ?> yet.</p>
- <p><small><i>Add many by uploading images above.</i>, or click the "<?=jvbDashIcon('plus-square')?>" button to add one at a time.</small></p>
- </div>
- <?php
- return ob_get_clean();
+
+ return empty($this->emptyState) ? sprintf(
+ '<div class="empty-state">
+ <h3>%sNothing here%s</h3>
+ <p>It doesn\'t look like you have any %s yet.</p>
+ <p><small><i>Add many by uploading images above.</i>, or click the "%s" button to add one at a time.</small></p>
+ </div>',
+ jvbDashIcon($this->icon),
+ jvbDashIcon($this->icon),
+ $this->plural,
+ jvbDashIcon('plus-square')
+ ) : $this->emptyState;
+ }
+
+ public function setEmptyState(string $state):void
+ {
+ $this->emptyState = $state;
}
protected function renderGalleryPreviewTemplate():void
--
Gitblit v1.10.0