| | |
| | | <?php |
| | | |
| | | use JVBase\meta\Form; |
| | | use JVBase\utility\Features; |
| | | use JVBase\utility\Image; |
| | | |
| | |
| | | <div class="actions row end"> |
| | | <button class="retry" data-action="retry"><span>Retry</span><?= jvbIcon('arrows-clockwise')?></button> |
| | | <button class="cancel" data-action="cancel"><span>Cancel</span><?= jvbIcon('x-square')?></button> |
| | | <button class="refresh" data-action="refresh" title="Refresh to see changes"><span>Refresh</span><?= jvbIcon('arrows-clockwise')?></button> |
| | | <button class="dismiss" data-action="dismiss"><span>Dismiss</span><?= jvbIcon('eye-closed')?></button> |
| | | |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | */ |
| | | 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); |
| | | } |
| | | |
| | | |
| | |
| | | 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 = '') { |