| | |
| | | <?php |
| | | |
| | | use JVBase\managers\CacheManager; |
| | | use JVBase\managers\Cache; |
| | | use JVBase\meta\Form; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | | exit; // Exit if accessed directly |
| | |
| | | wp_redirect(get_home_url(null, '/dash')); |
| | | exit; |
| | | } |
| | | $cache = CacheManager::for('news', 3600); |
| | | $cache = Cache::for('news', 3600); |
| | | $check = $cache->get('type-options'); |
| | | |
| | | if ($check) { |
| | |
| | | foreach ($terms as $term) { |
| | | $typeOptions[] = [ |
| | | 'id' => $term->term_id, |
| | | 'name' => $term->name, |
| | | 'name' => html_entity_decode($term->name), |
| | | 'count' => $term->count, |
| | | ]; |
| | | } |
| | |
| | | </div> |
| | | |
| | | <details class="type-filters"> |
| | | <summary class="row btw">Filters: |
| | | <summary class="row x-btw">Filters: |
| | | <button class="clear-filters row"> |
| | | <?= jvbIcon('x', ['title' => 'Clear Filters'])?> |
| | | <span>Clear Filters</span> |
| | |
| | | </div> |
| | | <?php |
| | | $handler = JVB()->getContent('news'); |
| | | $meta = new JVBase\meta\MetaManager(); |
| | | |
| | | foreach ($handler->getFields() as $field_name => $field_config) { |
| | | $meta->render('form', $field_name, $field_config); |
| | | echo Form::render($field_name, null, $field_config); |
| | | } |
| | | ?> |
| | | |
| | |
| | | </dialog> |
| | | <template class="template-own"> |
| | | <details class="news item" data-keyboard-nav="true" tabindex="0"> |
| | | <summary class="row btw"> |
| | | <summary class="row x-btw"> |
| | | <div class="item-select"> |
| | | <input type="checkbox" class="select-checkbox"> |
| | | <label> |
| | |
| | | </template> |
| | | <template class="template-all template-watching"> |
| | | <details class="news item" data-keyboard-nav="true" tabindex="0"> |
| | | <summary class="row btw"> |
| | | <summary class="row x-btw"> |
| | | <button class="favourite-button" data-type="news" title="Add to watch list" onclick="toggleFavourite(this)"> |
| | | |
| | | </button> |