Skip to content

Commit

Permalink
Issue #1193 : Add a pagination to the tag manager and fix design on d…
Browse files Browse the repository at this point in the history
…ropdown
  • Loading branch information
Zacharieg authored and plegall committed Jul 8, 2020
1 parent 5462e8a commit 14cd4d3
Show file tree
Hide file tree
Showing 5 changed files with 365 additions and 137 deletions.
19 changes: 11 additions & 8 deletions admin/tags.php
Expand Up @@ -92,7 +92,7 @@ class="icon-eye"
// +-----------------------------------------------------------------------+
// | form creation |
// +-----------------------------------------------------------------------+

$per_page = 100;

// tag counters
$query = '
Expand All @@ -103,7 +103,7 @@ class="icon-eye"

// all tags
$query = '
SELECT *
SELECT name, id, url_name
FROM '.TAGS_TABLE.'
;';
$result = pwg_query($query);
Expand All @@ -112,9 +112,11 @@ class="icon-eye"
{
$raw_name = $tag['name'];
$tag['name'] = trigger_change('render_tag_name', $raw_name, $tag);
$tag['counter'] = intval(@$tag_counters[ $tag['id'] ]);
$tag['U_VIEW'] = make_index_url(array('tags'=>array($tag)));
$tag['U_EDIT'] = 'admin.php?page=batch_manager&filter=tag-'.$tag['id'];
$counter = intval(@$tag_counters[ $tag['id'] ]);
if ($counter > 0)
{
$tag['counter'] = intval(@$tag_counters[ $tag['id'] ]);
}

$alt_names = trigger_change('get_tag_alt_names', array(), $raw_name);
$alt_names = array_diff( array_unique($alt_names), array($tag['name']) );
Expand All @@ -126,11 +128,12 @@ class="icon-eye"
}
usort($all_tags, 'tag_alpha_compare');



$template->assign(
array(
'all_tags' => $all_tags,
'first_tags' => array_slice($all_tags, 0, $per_page),
'data' => $all_tags,
'total' => count($all_tags),
'per_page' => $per_page
)
);

Expand Down

0 comments on commit 14cd4d3

Please sign in to comment.