From: x2003bruneau Date: Wed, 12 Jul 2006 13:35:26 +0000 (+0000) Subject: Display the list of pages in a shorter way : X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=f0dc6af4c4b07ab453c1cef08cd7bf997d2843de;p=banana.git Display the list of pages in a shorter way : 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 --- diff --git a/banana/banana.inc.php.in b/banana/banana.inc.php.in index f67c746..0823932 100644 --- a/banana/banana.inc.php.in +++ b/banana/banana.inc.php.in @@ -450,7 +450,8 @@ class Banana } redirectInBanana($dir); } else { - return "

"._b_('Impossible de poster le message')."

".$this->action_showThread($group, $artid); + return '

' . _b_('Impossible de poster le message') . '

' + . $this->action_showThread($group, $artid); } } diff --git a/banana/misc.inc.php b/banana/misc.inc.php index 2bb1905..25a9246 100644 --- a/banana/misc.inc.php +++ b/banana/misc.inc.php @@ -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 '' . $text . ''; + return '' . $text . ''; } /** Format tree images links @@ -358,17 +361,20 @@ function displayshortcuts($first = -1) { _b_('Nouveau message')) . '] '; if (sizeof($banana->spool->overview)>$banana->tmax) { - $res .= '
'; + $res .= '
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))); } }