| | |
| | | |
| | | use JVBase\managers\Cache; |
| | | use JVBase\registrar\Registrar; |
| | | use JVBase\utility\Features; |
| | | use JVBase\base\Site; |
| | | use JVBase\forms\TaxonomySelector; |
| | | use WP_Block; |
| | | |
| | |
| | | |
| | | foreach ($content as $contentType) { |
| | | $registrar = Registrar::getInstance($contentType); |
| | | |
| | | if (!$registrar) { |
| | | continue; |
| | | } |
| | | $contentTaxonomies = $registrar->registrar->taxonomies; |
| | | $contentTaxonomies = array_filter($contentTaxonomies, function($taxonomy) { |
| | | return Registrar::getInstance($taxonomy)->hasFeature('show_feed'); |
| | | return Registrar::getInstance($taxonomy)?->hasFeature('show_feed'); |
| | | }); |
| | | $taxonomies = array_merge($taxonomies, $contentTaxonomies); |
| | | } |
| | |
| | | <?php if ($hasMany) { |
| | | //If we have multiple content, only show the content first |
| | | ?> |
| | | <details class="col a-start"> |
| | | <summary class="row btw"> |
| | | <details class="col left"> |
| | | <summary class="row x-btw"> |
| | | <span class="label">SHOWING: </span> |
| | | <?php |
| | | $labels = []; |
| | |
| | | <?php } ?> |
| | | |
| | | |
| | | <?php if (Features::forSite()->has('favourites') && is_user_logged_in()) : ?> |
| | | <?php if (Site::has('favourites') && is_user_logged_in()) : ?> |
| | | <input type="checkbox" id="favourites" class="btn" name="favourites" value="on" |
| | | data-filter="favourites"> |
| | | <label for="favourites" title="Show Favourites" class="row"> |
| | |
| | | if (!empty ($this->config['taxonomies'])) { |
| | | ?> |
| | | <div class="filters"> |
| | | <div class="filter-group row start"> |
| | | <div class="filter-group row left"> |
| | | <span class="label">FILTER BY:</span> |
| | | |
| | | <?php |
| | |
| | | </div> |
| | | </div> |
| | | <?php } ?> |
| | | <div class="row btw nowrap"> |
| | | <div class="order-by filter-group row start w-full"> |
| | | <div class="row x-btw nowrap"> |
| | | <div class="order-by filter-group row left w-full"> |
| | | <span class="label">ORDER BY:</span> |
| | | <?php |
| | | //TODO: Get content types that can be sorted alphabetically |
| | |
| | | |
| | | </div> |
| | | |
| | | <div class="order-direction filter-group row start w-full" data-for-order="date,modified,title<?= $custom === '' ? '' : ','.$custom?>"> |
| | | <div class="order-direction filter-group row left w-full" data-for-order="date,modified,title<?= $custom === '' ? '' : ','.$custom?>"> |
| | | <span class="label">ORDER:</span> |
| | | <input type="radio" id="order-desc" class="btn" name="order" value="desc" data-filter="order" checked> |
| | | <label for="order-desc" title="Sort Descending (A-Z, 1-10)" class="row"> |
| | |
| | | protected function getFavouritesButton(string $content):string |
| | | { |
| | | $registrar = Registrar::getInstance($content); |
| | | if (!$registrar || !Features::forSite()->has('favourites') || !$registrar->hasFeature('favouritable')) { |
| | | if (!$registrar || !Site::has('favourites') || !$registrar->hasFeature('favouritable')) { |
| | | return ''; |
| | | } |
| | | return '<button class="favourite" type="button" title="Add to favourites" data-action="favourite"> |
| | |
| | | protected function getUpvotesButton(string $content):string |
| | | { |
| | | $registrar = Registrar::getInstance($content); |
| | | if (!Features::forSite()->has('karma') || !$registrar || !$registrar->hasFeature('karma')){ |
| | | if (!Site::has('karma') || !$registrar || !$registrar->hasFeature('karma')){ |
| | | return ''; |
| | | } |
| | | return '<div class="karma row"> |