| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined('WPINC') ) { |
| 4 |
wp_die(); |
| 5 |
} |
| 6 |
|
| 7 |
$post_id = $post->ID; |
| 8 |
$filters = flrt_get_configured_filters( $post_id ); |
| 9 |
$filterSet = \FilterEverything\Filter\Container::instance()->getFilterSetService(); |
| 10 |
|
| 11 |
?> |
| 12 |
<div class="wpc-filter-set-wrapper"> |
| 13 |
<div class="wpc-filter-set-hidden-fields"> |
| 14 |
<input type="hidden" id="wpc_set_nonce" name="_flrt_nonce" value="<?php echo esc_attr( flrt_create_filters_nonce() ); ?>" /> |
| 15 |
</div> |
| 16 |
<div class="wpc-column-labels-wrapper"> |
| 17 |
<table class="wpc-form-fields-table"> |
| 18 |
<?php |
| 19 |
|
| 20 |
$attributes = $filterSet->getPostTypeField($post_id); |
| 21 |
flrt_include_admin_view('filter-field', array( |
| 22 |
'field_key' => key($attributes), |
| 23 |
'attributes' => reset($attributes) |
| 24 |
) |
| 25 |
); |
| 26 |
|
| 27 |
?> |
| 28 |
</table> |
| 29 |
</div> |
| 30 |
<div class="wpc-column-labels-wrapper"> |
| 31 |
<div class="wpc-column-labels widget-title"> |
| 32 |
<ul class="wpc-custom-row"> |
| 33 |
<li class="wpc-filter-order"><?php esc_html_e('#', 'filter-everything'); ?></li> |
| 34 |
<li class="wpc-filter-label"><?php esc_html_e('Label', 'filter-everything' ); ?></li> |
| 35 |
<li class="wpc-filter-entity"><?php esc_html_e('Filter by', 'filter-everything' ); ?></li> |
| 36 |
<li class="wpc-filter-view"><?php esc_html_e('View', 'filter-everything' ); ?></li> |
| 37 |
<li class="wpc-filter-slug"><?php esc_html_e('URL Prefix', 'filter-everything' ); ?></li> |
| 38 |
</ul> |
| 39 |
</div> |
| 40 |
</div> |
| 41 |
<div class="wpc-no-filters"<?php if( ! $filters ){ echo ' style="display: block;"'; }?>> |
| 42 |
<?php |
| 43 |
echo wp_kses( |
| 44 |
__('No filters yet. Click the <strong>Add Filter</strong> button to create your first one.', 'filter-everything' ), |
| 45 |
array( 'strong' => array() ) |
| 46 |
); |
| 47 |
?> |
| 48 |
</div> |
| 49 |
<div class="wpc-filters-list"> |
| 50 |
|
| 51 |
<?php if( $filters ): |
| 52 |
|
| 53 |
foreach( $filters as $filter ): |
| 54 |
|
| 55 |
flrt_include_admin_view( 'filter-row', array( 'filter' => $filter ) ); |
| 56 |
|
| 57 |
endforeach; |
| 58 |
|
| 59 |
endif; ?> |
| 60 |
</div> |
| 61 |
|
| 62 |
<div class="wpc-add-filter-wrapper"> |
| 63 |
<div class="wpc-add-filter-div"> |
| 64 |
<a href="#" class="button button-primary button-large wpc-add-filter"><?php esc_html_e('Add Filter','filter-everything' ); ?></a> |
| 65 |
</div> |
| 66 |
</div> |
| 67 |
|
| 68 |
<script type="text/html" id="wpc-new-filter"> |
| 69 |
<?php |
| 70 |
flrt_include_admin_view( 'filter-row', array( 'filter' => flrt_get_empty_filter() ) ); |
| 71 |
?> |
| 72 |
</script> |
| 73 |
</div> |