1 | <?php |
---|
2 | # -- BEGIN LICENSE BLOCK --------------------------------------- |
---|
3 | # |
---|
4 | # This file is part of Dotclear 2. |
---|
5 | # |
---|
6 | # Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear |
---|
7 | # Licensed under the GPL version 2.0 license. |
---|
8 | # See LICENSE file or |
---|
9 | # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
---|
10 | # |
---|
11 | # -- END LICENSE BLOCK ----------------------------------------- |
---|
12 | if (!defined('DC_CONTEXT_ADMIN')) { return; } |
---|
13 | |
---|
14 | ?> |
---|
15 | <html> |
---|
16 | <head> |
---|
17 | <title><?php echo __('Tags'); ?></title> |
---|
18 | <link rel="stylesheet" type="text/css" href="index.php?pf=tags/style.css" /> |
---|
19 | </head> |
---|
20 | |
---|
21 | <body> |
---|
22 | <?php |
---|
23 | dcPage::breadcrumb( |
---|
24 | array( |
---|
25 | html::escapeHTML($core->blog->name) => '', |
---|
26 | '<span class="page-title">'.__('Tags').'</span>' => '' |
---|
27 | )); |
---|
28 | ?> |
---|
29 | |
---|
30 | <?php |
---|
31 | if (!empty($_GET['del'])) { |
---|
32 | dcPage::message(__('Tag has been successfully removed')); |
---|
33 | } |
---|
34 | |
---|
35 | $tags = $core->meta->getMetadata(array('meta_type' => 'tag')); |
---|
36 | $tags = $core->meta->computeMetaStats($tags); |
---|
37 | $tags->sort('meta_id_lower','asc'); |
---|
38 | |
---|
39 | $last_letter = null; |
---|
40 | $cols = array('',''); |
---|
41 | $col = 0; |
---|
42 | while ($tags->fetch()) |
---|
43 | { |
---|
44 | $letter = mb_strtoupper(mb_substr($tags->meta_id,0,1)); |
---|
45 | |
---|
46 | if ($last_letter != $letter) { |
---|
47 | if ($tags->index() >= round($tags->count()/2)) { |
---|
48 | $col = 1; |
---|
49 | } |
---|
50 | $cols[$col] .= '<tr class="tagLetter"><td colspan="2"><span>'.$letter.'</span></td></tr>'; |
---|
51 | } |
---|
52 | |
---|
53 | $cols[$col] .= |
---|
54 | '<tr class="line">'. |
---|
55 | '<td class="maximal"><a href="'.$p_url. |
---|
56 | '&m=tag_posts&tag='.rawurlencode($tags->meta_id).'">'.$tags->meta_id.'</a></td>'. |
---|
57 | '<td class="nowrap"><strong>'.$tags->count.'</strong> '. |
---|
58 | (($tags->count==1) ? __('entry') : __('entries')).'</td>'. |
---|
59 | '</tr>'; |
---|
60 | |
---|
61 | $last_letter = $letter; |
---|
62 | } |
---|
63 | |
---|
64 | $table = '<div class="col"><table class="tags">%s</table></div>'; |
---|
65 | |
---|
66 | if ($cols[0]) |
---|
67 | { |
---|
68 | echo '<div class="two-cols">'; |
---|
69 | printf($table,$cols[0]); |
---|
70 | if ($cols[1]) { |
---|
71 | printf($table,$cols[1]); |
---|
72 | } |
---|
73 | echo '</div>'; |
---|
74 | } |
---|
75 | else |
---|
76 | { |
---|
77 | echo '<p>'.__('No tags on this blog.').'</p>'; |
---|
78 | } |
---|
79 | ?> |
---|
80 | |
---|
81 | </body> |
---|
82 | </html> |
---|