Dotclear

source: plugins/tags/tags.php @ 1339:11fdde189adb

Revision 1339:11fdde189adb, 1.9 KB checked in by franck <carnet.franck.paul@…>, 11 years ago (diff)

New dcPage::breadcrumb function, last step at least

Line 
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 -----------------------------------------
12if (!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
23dcPage::breadcrumb(
24     array(
25          html::escapeHTML($core->blog->name) => '',
26          '<span class="page-title">'.__('Tags').'</span>' => ''
27     ));
28?>
29
30<?php
31if (!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;
42while ($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          '&amp;m=tag_posts&amp;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
66if ($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}
75else
76{
77     echo '<p>'.__('No tags on this blog.').'</p>';
78}
79?>
80
81</body>
82</html>
Note: See TracBrowser for help on using the repository browser.

Sites map