From ac444cba221832c012c0435fdc8339fe9f37febb Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Mon, 11 May 2026 18:35:04 +0000
Subject: [PATCH] =Some changes to the CRUD.js editing, timeline post configuration
---
inc/registrar/Fields.php | 70 ++++++++++++++++++++++++-----------
1 files changed, 48 insertions(+), 22 deletions(-)
diff --git a/inc/registrar/Fields.php b/inc/registrar/Fields.php
index f310a3f..c2688ae 100644
--- a/inc/registrar/Fields.php
+++ b/inc/registrar/Fields.php
@@ -50,9 +50,56 @@
public function addPostFields():void
{
+ $statuses = [
+// 'all' => [
+// 'icon' => 'infinity',
+// 'label' => 'Everything',
+// ],
+ 'publish' => [
+ 'icon' => 'eye',
+ 'label' => 'Live',
+ ],
+ 'draft' => [
+ 'icon' => 'eye-closed',
+ 'label' => 'Hidden',
+ ],
+ 'trash' => [
+ 'label' => 'Scrapped',
+ 'icon' => 'trash',
+ ],
+// 'delete' => [
+// 'label' => 'Permanently Delete',
+// 'icon' => 'trash'
+// ]
+ ];
+ if ($this->registrar->hasFeature('is_calendar')) {
+ $statuses = [
+ 'future' => [
+ 'icon' => '',
+ 'label' => 'Upcoming',
+ ],
+ 'past' => [
+ 'icon' => '',
+ 'label' => 'Past',
+ ],
+ 'repeat' => [
+ 'icon' => '',
+ 'label' => 'Repeating',
+ ],
+ 'draft' => [
+ 'icon' => 'eye-closed',
+ 'label' => 'Hidden',
+ ],
+ 'trash' => [
+ 'label' => 'Scrapped',
+ 'icon' => 'trash',
+ ],
+ ];
+ }
$fields = [
'post_thumbnail' => [
'type' => 'upload',
+ 'subtype' => 'image',
'multiple'=> false,
'label' => 'Main Image',
],
@@ -79,28 +126,7 @@
'type' => 'radio',
'label' => 'Status',
'default' => 'draft',
- 'options' => [
- 'all' => [
- 'icon' => 'infinity',
- 'label' => 'Everything',
- ],
- 'publish' => [
- 'icon' => 'eye',
- 'label' => 'Live',
- ],
- 'draft' => [
- 'icon' => 'eye-closed',
- 'label' => 'Hidden',
- ],
- 'trash' => [
- 'label' => 'Scrapped',
- 'icon' => 'trash',
- ],
- 'delete' => [
- 'label' => 'Permanently Delete',
- 'icon' => 'trash'
- ]
- ]
+ 'options' => $statuses
]
];
--
Gitblit v1.10.0