| | |
| | | return; |
| | | } |
| | | ?> |
| | | <div class="radio-options view row"> |
| | | <div class="radio-options view row left"> |
| | | <span class="label">View:</span> |
| | | <?php |
| | | $views = [ |
| | |
| | | <label for="view-<?=$view?>" |
| | | title="<?=$views[$view]['label']?>"> |
| | | <?= jvbDashIcon($views[$view]['icon']) ?> |
| | | <span class="screen-reader-text"><?=$views[$view]['label']?></span> |
| | | <span class="label"><?=$views[$view]['label']?></span> |
| | | </label> |
| | | <?php |
| | | } |
| | |
| | | return; |
| | | } |
| | | ?> |
| | | <div class="radio-options status row"> |
| | | <div class="radio-options status row left"> |
| | | <span class="label">Status:</span> |
| | | <?php |
| | | $i = 1; |
| | |
| | | <input type="radio" class="btn" data-filter="status" value="<?=$status?>" name="status" id="<?=$status?>"<?=$checked?>> |
| | | <label for="<?=$status?>" title="<?=$config['label']?>"> |
| | | <?= jvbDashIcon($config['icon']) ?> |
| | | <span class="label"><?= $config['label'] ?></span> |
| | | </label> |
| | | <?php |
| | | $i++; |
| | |
| | | <?php |
| | | $order = [ |
| | | 'orderby' => [ |
| | | 'date' => 'Order by date created', |
| | | 'alphabetical' => 'Order alphabetically' |
| | | [ |
| | | 'slug' => 'date', |
| | | 'label' => 'Date Created', |
| | | 'icon' => 'calendar' |
| | | ], |
| | | [ |
| | | 'slug' => 'alphabetical', |
| | | 'label' => 'Alphabetically', |
| | | 'icon' => 'alphabetical', |
| | | ], |
| | | [ |
| | | 'slug' => 'date_modified', |
| | | 'icon' => 'clock-clockwise', |
| | | 'label' => 'Date Modified', |
| | | ], |
| | | ], |
| | | 'order' => [ |
| | | 'sort-ascending' => 'In ascending order (Z-A, oldest to newest)', |
| | | 'sort-descending' => 'In descending order (A-Z, newest to oldest)' |
| | | [ |
| | | 'slug' => 'desc', |
| | | 'icon' => 'sort-descending', |
| | | 'label' => 'Descending (A-Z, 1-10)' |
| | | ], |
| | | [ |
| | | 'slug' => 'asc', |
| | | 'icon' => 'sort-ascending', |
| | | 'label' => 'Ascending (Z-A, 10-1)' |
| | | ] |
| | | ] |
| | | ]; |
| | | |
| | |
| | | <div class="row left"> |
| | | <span class="label"><?= ucfirst($o)?>:</span> |
| | | <?php |
| | | $title = $o === 'orderby' ? 'Order by ' : 'Sort '; |
| | | $i = 0; |
| | | foreach ($option as $opt => $label) { |
| | | $icon = $opt === 'date' ? 'calendar' : $opt; |
| | | $value = $opt; |
| | | $value = ($value === 'sort-ascending') ? 'asc' : $value; |
| | | $value = ($value === 'sort-descending') ? 'desc' : $value; |
| | | foreach ($option as $conf) { |
| | | ?> |
| | | <input id="<?=$opt?>" class="btn" type="radio" name="<?=$o?>" data-filter="<?=$o?>" value="<?=$value?>"<?=$i===0 ? ' checked':''?>> |
| | | <input id="<?=$o.'-'.$conf['slug'] ?>" class="btn" type="radio" name="<?=$o?>" data-filter="<?=$o?>" value="<?=$conf['slug']?>"<?=$i===0 ? ' checked':''?>> |
| | | |
| | | <label for="<?=$opt?>" title="<?=$label?>"><?=jvbDashIcon($icon)?></label> |
| | | <label for="<?=$o.'-'.$conf['slug']?>" title="<?=$title.' '.$conf['label']?>"><?=jvbDashIcon($conf['icon'])?><span class="label"><?= $conf['label'] ?></span></label> |
| | | <?php |
| | | $i++; |
| | | } |
| | |
| | | } |
| | | |
| | | $fields = $this->fields; |
| | | |
| | | if (!$this->isTimeline) { |
| | | $first = ['post_thumbnail', 'post_title', 'price']; |
| | | $first = $this->registrar->getType() === 'post' ? |
| | | ['post_thumbnail', 'post_title', 'price'] : |
| | | ( $this->registrar->getType() === 'term' ? |
| | | ['name', 'thumbnail', 'description'] : |
| | | ['username', 'display_name', 'description']); |
| | | |
| | | foreach ($first as $f) { |
| | | if (array_key_exists($f, $fields)) { |
| | |
| | | $out = ob_get_clean(); |
| | | echo Form::fieldWrap('post_status', $out, ['type'=>'group']); |
| | | } |
| | | |
| | | |
| | | public static function searchFilter():string |
| | | { |
| | | $self = new self(); |
| | | $self->hasSearch = true; |
| | | ob_start(); |
| | | $self->renderSearch(); |
| | | return ob_get_clean(); |
| | | } |
| | | |
| | | public static function viewFilter(array $views):string |
| | | { |
| | | $self = new self(); |
| | | $self->views = $views; |
| | | ob_start(); |
| | | $self->renderViewControls(); |
| | | return ob_get_clean(); |
| | | } |
| | | |
| | | public static function orderFilter(bool $random = false):string |
| | | { |
| | | $self = new self(); |
| | | ob_start(); |
| | | $self->renderOrderControls(); |
| | | return ob_get_clean(); |
| | | } |
| | | } |