| 1 |
<?php |
| 2 |
/** |
| 3 |
* The template for Categories Management. |
| 4 |
* |
| 5 |
* This is the template that table, search layout |
| 6 |
* |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; // Exit if accessed directly. |
| 11 |
} |
| 12 |
?> |
| 13 |
<!-- This file should primarily consist of HTML with a little bit of PHP. --> |
| 14 |
|
| 15 |
<div class="wrap wdk-wrap"> |
| 16 |
<h1 class="wp-heading-inline"><?php echo __('Categories','wpdirectorykit'); ?> <a href="<?php echo esc_url(get_admin_url() . "admin.php?page=wdk_category&function=edit"); ?>" class="button button-primary" id="add_category_button"><?php echo __('Add Category','wpdirectorykit'); ?></a></h1> |
| 17 |
<br /> |
| 18 |
<?php |
| 19 |
$success_message = NULL; |
| 20 |
if(isset($_GET['custom_message'])) |
| 21 |
$success_message = esc_html(urldecode($_GET['custom_message'])); |
| 22 |
|
| 23 |
$form->messages('class="alert alert-danger"', $success_message); |
| 24 |
?> |
| 25 |
<br /> |
| 26 |
<form method="GET" action="<?php echo esc_url(wmvc_current_edit_url()); ?>" novalidate="novalidate"> |
| 27 |
<table class="wp-list-table widefat fixed striped table-view-list pages"> |
| 28 |
<thead> |
| 29 |
<tr> |
| 30 |
<td id="cb" class="manage-column column-cb check-column"><label class="screen-reader-text" for="cb-select-all-1"><?php echo __('Select All', 'wpdirectorykit'); ?></label><input id="cb-select-all-1" type="checkbox"></td> |
| 31 |
<th><?php echo __('Title','wpdirectorykit'); ?></th> |
| 32 |
<th><?php echo __('Order','wpdirectorykit'); ?></th> |
| 33 |
<th><?php echo __('Level','wpdirectorykit'); ?></th> |
| 34 |
<th><?php echo __('Date','wpdirectorykit'); ?></th> |
| 35 |
<th class="actions_column"><?php echo __('Actions','wpdirectorykit'); ?></th> |
| 36 |
</tr> |
| 37 |
</thead> |
| 38 |
<?php if(count($categories) == 0): ?> |
| 39 |
<tr class="no-items"><td class="colspanchange" colspan="6"><?php echo __('No Categories found.','wpdirectorykit'); ?></td></tr> |
| 40 |
<?php endif; ?> |
| 41 |
<?php foreach ( $categories as $category ):?> |
| 42 |
<tr> |
| 43 |
<th scope="row" class="check-column"> |
| 44 |
<input id="cb-select-<?php echo wmvc_show_data('idcategory', $category, '-'); ?>" type="checkbox" name="post[]" value="<?php echo wmvc_show_data('idcategory', $category, '-'); ?>"> |
| 45 |
<div class="locked-indicator"> |
| 46 |
<span class="locked-indicator-icon" aria-hidden="true"></span> |
| 47 |
<span class="screen-reader-text"><?php echo __('Is Locked', 'wpdirectorykit'); ?></span> |
| 48 |
</div> |
| 49 |
</th> |
| 50 |
<td> |
| 51 |
<?php echo str_pad('', wmvc_show_data('level', $category, 0)*12, ' ').'|-'; ?><a href="<?php echo esc_url(get_admin_url() . "admin.php?page=wdk_category&function=edit&id=".wmvc_show_data('idcategory', $category, '-')); ?>"><?php echo wmvc_show_data('category_title', $category, '-').' #'.wmvc_show_data('idcategory', $category, '-'); ?></a> |
| 52 |
</td> |
| 53 |
<td> |
| 54 |
<?php echo wmvc_show_data('order_index', $category, '-'); ?> |
| 55 |
</td> |
| 56 |
<td> |
| 57 |
<?php echo wmvc_show_data('level', $category, '-'); ?> |
| 58 |
</td> |
| 59 |
<td> |
| 60 |
<?php echo wdk_get_date(wmvc_show_data('date', $category), false); ?> |
| 61 |
</td> |
| 62 |
<td class="actions_column"> |
| 63 |
<a href="<?php echo esc_url(get_admin_url() . "admin.php?page=wdk_category&function=edit&id=".wmvc_show_data('idcategory', $category, '-')); ?>" title="<?php echo esc_attr__('Edit','wpdirectorykit');?>"><span class="dashicons dashicons-edit"></span></a> |
| 64 |
<a class="question_sure" title="<?php echo esc_attr__('Remove','wpdirectorykit');?>" href="<?php echo esc_url(get_admin_url() . "admin.php?page=wdk_category&function=delete&id=".wmvc_show_data('idcategory', $category, '-')); ?>&_wpnonce=<?php echo wp_create_nonce( 'wdk-category-delete_'.wmvc_show_data('idcategory', $category, '-'));?>"><span class="dashicons dashicons-no"></span></a> |
| 65 |
</td> |
| 66 |
</tr> |
| 67 |
<?php endforeach; ?> |
| 68 |
<tfoot> |
| 69 |
<tr> |
| 70 |
<td class="manage-column column-cb check-column"><label class="screen-reader-text" for="cb-select-all-2"><?php echo __('Select All', 'wpdirectorykit'); ?></label><input id="cb-select-all-2" type="checkbox"></td> |
| 71 |
<th><?php echo __('Title','wpdirectorykit'); ?></th> |
| 72 |
<th><?php echo __('Order','wpdirectorykit'); ?></th> |
| 73 |
<th><?php echo __('Level','wpdirectorykit'); ?></th> |
| 74 |
<th><?php echo __('Date','wpdirectorykit'); ?></th> |
| 75 |
<th class="actions_column"><?php echo __('Actions','wpdirectorykit'); ?></th> |
| 76 |
</tr> |
| 77 |
</tfoot> |
| 78 |
</table> |
| 79 |
<div class="tablenav bottom"> |
| 80 |
<div class="alignleft actions bulkactions"> |
| 81 |
<?php wp_nonce_field( 'wdk-category-bulk', '_wpnonce'); ?> |
| 82 |
<label for="bulk-action-selector-bottom" class="screen-reader-text"><?php echo __('Select bulk action', 'wpdirectorykit'); ?></label> |
| 83 |
<select name="action" id="bulk-action-selector-bottom"> |
| 84 |
<option value="-1"><?php echo __('Bulk actions', 'wpdirectorykit'); ?></option> |
| 85 |
<option value="delete" class="hide-if-no-js"><?php echo __('Delete', 'wpdirectorykit'); ?></option> |
| 86 |
</select> |
| 87 |
<input type="hidden" name="page" value="wdk_category" /> |
| 88 |
<input type="submit" id="table_action" class="button action" name="table_action" value="<?php echo esc_attr__('Apply', 'wpdirectorykit'); ?>"> |
| 89 |
</div> |
| 90 |
<br class="clear"> |
| 91 |
</div> |
| 92 |
</form> |
| 93 |
<br /> |
| 94 |
<div class="alert alert-info" style="margin-bottom:20px" role="alert"><?php echo sprintf(__('%1$s How to manage Categories documentation%2$s', 'wpdirectorykit'),'<a href="//wpdirectorykit.com/documentation/#!/categories" target="_blank">','</a>'); ?></div> |
| 95 |
<iframe width="560" height="315" src="//www.youtube.com/embed/051E9Lzn0Vs" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> |
| 96 |
|
| 97 |
</div> |
| 98 |
|
| 99 |
<script> |
| 100 |
// Generate table |
| 101 |
jQuery(document).ready(function($) { |
| 102 |
$('.question_sure').on('click', function(){ |
| 103 |
return confirm("<?php echo esc_js(__('Are you sure? Selected item will be completely removed!','wpdirectorykit')); ?>"); |
| 104 |
}); |
| 105 |
}); |
| 106 |
</script> |
| 107 |
|
| 108 |
<?php $this->view('general/footer', $data); ?> |
| 109 |
|