Display the list of pages in a shorter way :
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Wed, 12 Jul 2006 13:35:26 +0000 (13:35 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 4 Jan 2008 23:34:53 +0000 (00:34 +0100)
Page : 1 2 3 ...
instead of
[001-050] [051-100] [101-150] ...

Message range is still available as a popup

git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@84 9869982d-c50d-0410-be91-f2a2ec7c7c7b

banana/banana.inc.php.in
banana/misc.inc.php

index f67c746..0823932 100644 (file)
@@ -450,7 +450,8 @@ class Banana
             }
             redirectInBanana($dir);
         } else {
-            return "<p class=\"error\">"._b_('Impossible de poster le message')."</p>".$this->action_showThread($group, $artid);
+            return '<p class="error">' . _b_('Impossible de poster le message') . '</p>'
+                   . $this->action_showThread($group, $artid);
         }
     }
 
index 2bb1905..25a9246 100644 (file)
@@ -83,17 +83,20 @@ function makeLink($params)
 /** Format a link to be use in a link
  * @ref makeLink
  */
-function makeHREF($params, $text = null)
+function makeHREF($params, $text = null, $popup = null)
 {
     $link = makeLink($params);
     if (is_null($text)) {
         $text = $link;
     }
+    if (!is_null($popup)) {
+        $popup = ' title="' . $popup . '"';
+    }
     $target = null;
     if (isset($params['action']) && $params['action'] == 'view') {
         $target = ' target="_blank"';
     }
-    return '<a href="' . htmlentities($link) . $target . '">' . $text . '</a>';
+    return '<a href="' . htmlentities($link) . $target . '"' . $popup . '>' . $text . '</a>';
 }
 
 /** Format tree images links
@@ -358,17 +361,20 @@ function displayshortcuts($first = -1) {
                                _b_('Nouveau message'))
               . '] ';
         if (sizeof($banana->spool->overview)>$banana->tmax) {
-            $res .= '<br />';
+            $res .= '<br />Page : ';
             $n = intval(log(count($banana->spool->overview), 10))+1;
-            for ($ndx=1; $ndx <= sizeof($banana->spool->overview); $ndx += $banana->tmax) {
+            $i = 1;
+            for ($ndx = 1 ; $ndx <= sizeof($banana->spool->overview) ; $ndx += $banana->tmax) {
                 if ($first==$ndx) {
-                    $fmt = "[%0{$n}u-%0{$n}u] ";
+                    $fmt = $i . ' ';
                 } else {
-                    $fmt = '[' . makeHREF(Array('group' => $group,
-                                                'first' => $ndx),
-                                          '%0' . $n . 'u-%0' . $n . 'u')
-                         . '] ';
+                    $fmt = makeHREF(Array('group' => $group,
+                                          'first' => $ndx),
+                                    $i, 
+                                    '%0' . $n . 'u-%0' . $n . 'u')
+                         . ' ';
                 }
+                $i++;
                 $res .= sprintf($fmt, $ndx, min($ndx+$banana->tmax-1,sizeof($banana->spool->overview)));
             }
         }