From 2127b1bdd73ecd2423e443992da4b442f5a3c1a3 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Wed, 04 Feb 2026 21:19:25 +0000
Subject: [PATCH] =Major overhaul of MetaManager.php -> Meta.php and RestRouteManager.php -> Rest.php. Seems to work for JakeVan
---
inc/helpers/ui.php | 44 +++++++++++++++++---------------------------
1 files changed, 17 insertions(+), 27 deletions(-)
diff --git a/inc/helpers/ui.php b/inc/helpers/ui.php
index e97bbfa..4da00a5 100644
--- a/inc/helpers/ui.php
+++ b/inc/helpers/ui.php
@@ -1,5 +1,6 @@
<?php
+use JVBase\meta\Form;
use JVBase\utility\Features;
use JVBase\utility\Image;
@@ -212,24 +213,7 @@
*/
function jvbSearch(string $placeholder = 'Search...', string $id = 'search'):string
{
- $id = sanitize_title($id);
- return sprintf(
- '<div class="search-container row start nowrap">
- <input type="search" id="%s" placeholder="%s">
- <button
- title="Clear Search"
- type="button"
- class="clear-search"
- aria-label="Clear search"
- onclick="this.previousElementSibling.value = \'\'; this.previousElementSibling.focus();"
- >%s</button>
- <button type="button" title="Search" class="toggle search" aria-label="Toggles search input visually" onclick="this.parentNode.classList.toggle(\'open\');this.previousElementSibling.previousElementSibling.focus();">%s</button>
- </div>',
- $id,
- $placeholder,
- jvbIcon('x', ['title'=> 'Clear Search']),
- jvbIcon('magnifying-glass')
- );
+ return Form::search($placeholder, $id);
}
@@ -436,24 +420,30 @@
return $out;
}
-function jvbRenderProgressBar(string $inside ='', $top = false, $icon = true)
+function jvbRenderProgressBar(string $inside ='', $top = false, $icon = true, $return = false):string
{
+
$top = $top ? ' abs top' : '';
- ?>
- <div class="progress<?=$top?>">
+ $bar = sprintf(
+ '<div class="progress%s">
<div class="bar">
<div class="fill"></div>
</div>
<div class="row btw">
- <?php if ($icon) { ?>
- <i class="icon"></i>
- <?php } ?>
+ %s
<div class="details">
- <?=$inside?>
+ %s
</div>
</div>
- </div>
- <?php
+ </div>',
+ $top,
+ ($icon) ? '<i class="icon"></i>': '',
+ $inside
+ );
+ if (!$return) {
+ echo $bar;
+ }
+ return $bar;
}
function jvbFormStatus(string $message = '') {
--
Gitblit v1.10.0