From 57d34239ee9ddb0bafe7b451edd766c2089fc9d7 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Thu, 28 May 2026 19:28:04 +0000
Subject: [PATCH] =gitblit switch

---
 dashboard/_setup.php |   82 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 82 insertions(+), 0 deletions(-)

diff --git a/dashboard/_setup.php b/dashboard/_setup.php
index b3d9bbc..643efb6 100644
--- a/dashboard/_setup.php
+++ b/dashboard/_setup.php
@@ -1 +1,83 @@
 <?php
+add_filter('jvb_options', function() {
+    return [
+        'fields' => [
+            'today_hours'  => [
+                'type'  => 'group',
+                'label' => 'Hours',
+                'fields' => [
+                    'time_start'    => [
+                        'type'   => 'time',
+                        'label' => 'Open'
+                    ],
+                    'time_end'    => [
+                        'type'   => 'time',
+                        'label' => 'Closed'
+                    ],
+                ]
+            ],
+            'common' => ['hours'],
+            'open_to_public' => [
+                'type'   => 'true_false',
+                'label' => 'Open to Public?'
+            ],
+        ]
+    ];
+});
+
+add_filter('jvbAdminDashboard', 'nebAdminDashboard');
+function nebAdminDashboard(string $content):string
+{
+    $user = wp_get_current_user()->display_name;
+    $meta = new JVBase\meta\Meta(null, 'options');
+
+    $fields = ['today_hours', 'open_to_public'];
+    $temp = [];
+    $saved = jvbGetFields('options', 'options');
+    foreach ($fields as $field) {
+        $temp[$field] = $saved[$field];
+
+    }
+    $fields = $temp;
+
+    return $meta->renderForm(
+        'options',
+        [
+            'heading' => 'Hi '.$user.'!',
+            'description'   => 'Do you have availability today?',
+            'submit'    => true,
+            'classes'   => ['col']
+        ],
+        $fields,
+        false,
+        true
+    );
+
+}
+
+
+add_filter('jvbDashboardSettings', 'nebDashboardSettings');
+function nebDashboardSettings(string $content):string
+{
+    $meta = new JVBase\meta\Meta(null, 'options');
+    ob_start();
+    $meta->render('render', 'hours');
+    ?>
+
+    <form id="hours" data-save="options" data-form-id="set-hours">
+        <?php
+        $meta->render('form', 'hours',null,false,false);
+        ?>
+    </form>
+    <?php
+
+    $hours = ob_get_clean();
+    $tabs = [
+        'hours' => [
+            'title'         => 'Hours',
+            'description'   => 'If you are open regular hours you can list your hours here. When you log in to set your location, it pulls from this record first. Updates your Google Business Listing automatically.',
+            'content'       => $hours,
+        ],
+    ];
+    return jvbRenderTabs($tabs, true);
+}
\ No newline at end of file

--
Gitblit v1.10.0