2015-11-24 03:27:14 +01:00
|
|
|
<div class="taxonomies index">
|
2018-07-20 09:29:50 +02:00
|
|
|
<h2><?php echo __('Taxonomies');?></h2>
|
|
|
|
<div class="pagination">
|
|
|
|
<ul>
|
|
|
|
<?php
|
|
|
|
$this->Paginator->options(array(
|
|
|
|
'update' => '.span12',
|
|
|
|
'evalScripts' => true,
|
|
|
|
'before' => '$(".progress").show()',
|
|
|
|
'complete' => '$(".progress").hide()',
|
|
|
|
));
|
2015-11-24 03:27:14 +01:00
|
|
|
|
2018-07-20 09:29:50 +02:00
|
|
|
echo $this->Paginator->prev('« ' . __('previous'), array('tag' => 'li', 'escape' => false), null, array('tag' => 'li', 'class' => 'prev disabled', 'escape' => false, 'disabledTag' => 'span'));
|
|
|
|
echo $this->Paginator->numbers(array('modulus' => 20, 'separator' => '', 'tag' => 'li', 'currentClass' => 'active', 'currentTag' => 'span'));
|
|
|
|
echo $this->Paginator->next(__('next') . ' »', array('tag' => 'li', 'escape' => false), null, array('tag' => 'li', 'class' => 'next disabled', 'escape' => false, 'disabledTag' => 'span'));
|
|
|
|
?>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<table class="table table-striped table-hover table-condensed">
|
|
|
|
<tr>
|
|
|
|
<th><?php echo $this->Paginator->sort('id');?></th>
|
|
|
|
<th><?php echo $this->Paginator->sort('namespace');?></th>
|
|
|
|
<th><?php echo $this->Paginator->sort('description');?></th>
|
|
|
|
<th><?php echo $this->Paginator->sort('version');?></th>
|
|
|
|
<th><?php echo $this->Paginator->sort('enabled');?></th>
|
2019-03-21 15:59:02 +01:00
|
|
|
<th><?php echo $this->Paginator->sort('required', __('Required'));?></th>
|
2018-07-20 09:29:50 +02:00
|
|
|
<th><?php echo __('Active Tags');?></th>
|
|
|
|
<th class="actions"><?php echo __('Actions');?></th>
|
|
|
|
</tr><?php
|
2015-11-24 03:27:14 +01:00
|
|
|
foreach ($taxonomies as $item): ?>
|
2018-07-20 09:29:50 +02:00
|
|
|
<tr>
|
|
|
|
<td class="short" ondblclick="document.location.href ='<?php echo $baseurl."/taxonomies/view/".h($item['Taxonomy']['id']);?>'"><?php echo h($item['Taxonomy']['id']); ?> </td>
|
|
|
|
<td class="short" ondblclick="document.location.href ='<?php echo $baseurl."/taxonomies/view/".h($item['Taxonomy']['id']);?>'"><?php echo h($item['Taxonomy']['namespace']); ?> </td>
|
|
|
|
<td ondblclick="document.location.href ='<?php echo $baseurl."/taxonomies/view/".h($item['Taxonomy']['id']);?>'"><?php echo h($item['Taxonomy']['description']); ?> </td>
|
|
|
|
<td class="short" ondblclick="document.location.href ='<?php echo $baseurl."/taxonomies/view/".h($item['Taxonomy']['id']);?>'"><?php echo h($item['Taxonomy']['version']); ?> </td>
|
|
|
|
<td class="short" ondblclick="document.location.href ='<?php echo $baseurl."/taxonomies/view/".h($item['Taxonomy']['id']);?>'"><?php echo $item['Taxonomy']['enabled'] ? '<span class="green">Yes</span>' : '<span class="red">No</span>'; ?> </td>
|
2019-03-19 15:59:31 +01:00
|
|
|
<td class="short"><input type="checkbox" data-taxonomy-id="<?php echo h($item['Taxonomy']['id']); ?>" class="required-toggle" <?php echo $item['Taxonomy']['required'] ? 'checked' : '';?> id="TaxonomyRequired"></td>
|
2018-07-20 09:29:50 +02:00
|
|
|
<td class="shortish"><span><span class="bold"><?php echo h($item['current_count']);?></span> / <?php echo h($item['total_count']);?> <?php if ($item['current_count'] != $item['total_count'] && $isSiteAdmin && $item['Taxonomy']['enabled']) echo '(' . $this->Form->postLink(__('enable all'), array('action' => 'addTag', h($item['Taxonomy']['id'])), array('title' => __('Enable all tags')), (__('Are you sure you want to enable every tag associated to this taxonomy?'))) . ')'; ?></span></td>
|
|
|
|
<td class="short action-links">
|
|
|
|
<?php
|
|
|
|
if ($isSiteAdmin) {
|
|
|
|
if ($item['Taxonomy']['enabled']) {
|
|
|
|
echo $this->Form->postLink('', array('action' => 'disable', h($item['Taxonomy']['id'])), array('class' => 'icon-minus', 'title' => __('Disable')), (__('Are you sure you want to disable this taxonomy library?')));
|
|
|
|
} else {
|
|
|
|
echo $this->Form->postLink('', array('action' => 'enable', h($item['Taxonomy']['id'])), array('class' => 'icon-plus', 'title' => __('Enable')), (__('Are you sure you want to enable this taxonomy library?')));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
Accessibility: added roles and aria labels for many icons and icon links (server list, tags, users, roles, attributes, ...)
There is still much work to be done. But we are on the road.
Ideally, and in order to avoid code dupplicates, we should have some utility functions to generate a proper and accessible yes/no icon, an accessible icon link, etc. This would prevent the code from being filled with "aria-label" tags, since the "title" and "aria-label" properties are nearly always the same.
2019-04-02 15:31:34 +02:00
|
|
|
<a href='<?php echo $baseurl."/taxonomies/view/". h($item['Taxonomy']['id']);?>' class = "fa fa-eye" title = "<?php echo __('View');?>" aria-label = "<?php echo __('View');?>"></a>
|
2019-03-23 11:18:22 +01:00
|
|
|
<span class="fa fa-trash useCursorPointer" title="<?php echo __('Delete taxonomy');?>" role="button" tabindex="0" aria-label="<?php echo __('Delete taxonomy');?>" onClick="deleteObject('taxonomies', 'delete', '<?php echo h($item['Taxonomy']['id']); ?>', '<?php echo h($item['Taxonomy']['id']); ?>');"></span>
|
2018-07-20 09:29:50 +02:00
|
|
|
</td>
|
|
|
|
</tr><?php
|
2015-11-24 03:27:14 +01:00
|
|
|
endforeach; ?>
|
2018-07-20 09:29:50 +02:00
|
|
|
</table>
|
|
|
|
<p>
|
|
|
|
<?php
|
|
|
|
echo $this->Paginator->counter(array(
|
|
|
|
'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
|
|
|
|
));
|
|
|
|
?>
|
|
|
|
</p>
|
|
|
|
<div class="pagination">
|
|
|
|
<ul>
|
|
|
|
<?php
|
|
|
|
echo $this->Paginator->prev('« ' . __('previous'), array('tag' => 'li', 'escape' => false), null, array('tag' => 'li', 'class' => 'prev disabled', 'escape' => false, 'disabledTag' => 'span'));
|
|
|
|
echo $this->Paginator->numbers(array('modulus' => 20, 'separator' => '', 'tag' => 'li', 'currentClass' => 'active', 'currentTag' => 'span'));
|
|
|
|
echo $this->Paginator->next(__('next') . ' »', array('tag' => 'li', 'escape' => false), null, array('tag' => 'li', 'class' => 'next disabled', 'escape' => false, 'disabledTag' => 'span'));
|
|
|
|
?>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2015-11-24 03:27:14 +01:00
|
|
|
</div>
|
2016-06-04 01:10:45 +02:00
|
|
|
<?php
|
2019-02-13 14:45:01 +01:00
|
|
|
echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'taxonomies', 'menuItem' => 'index'));
|
2016-06-06 10:09:55 +02:00
|
|
|
?>
|
2019-03-19 15:59:31 +01:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('.required-toggle').click(function(e) {
|
|
|
|
changeTaxonomyRequiredState(this);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|