$banana is the only global variable !
[banana.git] / install.d / format.inc.php
1 <?php
2 /********************************************************************************
3 * install.d/format.inc.php : HTML output subroutines
4 * --------------------------
5 *
6 * This file is part of the banana distribution
7 * Copyright: See COPYING files that comes with this distribution
8 ********************************************************************************/
9
10
11 /** contextual links
12 * @return STRING HTML output
13 */
14 function displayshortcuts($first = -1) {
15 global $banana;
16 $sname = basename($_SERVER['SCRIPT_NAME']);
17
18 echo '<div class="shortcuts">';
19 echo '[<a href="disconnect.php">'._b_('Déconnexion').'</a>] ';
20
21 switch ($sname) {
22 case 'thread.php' :
23 echo '[<a href="index.php">'._b_('Liste des forums').'</a>] ';
24 echo "[<a href=\"post.php?group={$banana->spool->group}\">"._b_('Nouveau message')."</a>] ";
25 if (sizeof($banana->spool->overview)>$banana->tmax) {
26 for ($ndx=1; $ndx<=sizeof($banana->spool->overview); $ndx += $banana->tmax) {
27 if ($first==$ndx) {
28 echo "[$ndx-".min($ndx+$banana->tmax-1,sizeof($banana->spool->overview))."] ";
29 } else {
30 echo "[<a href=\"".$_SERVER['PHP_SELF']."?group={$banana->spool->group}&amp;first="
31 ."$ndx\">$ndx-".min($ndx+$banana->tmax-1,sizeof($banana->spool->overview))
32 ."</a>] ";
33 }
34 }
35 }
36 break;
37 case 'article.php' :
38 echo '[<a href="index.php">'._b_('Liste des forums').'</a>] ';
39 echo "[<a href=\"thread.php?group={$banana->spool->group}\">{$banana->spool->group}</a>] ";
40 echo "[<a href=\"post.php?group={$banana->spool->group}&amp;id={$banana->post->id}&amp;type=followup\">"
41 ._b_('Répondre')."</a>] ";
42 if ($banana->post->checkcancel()) {
43 echo "[<a href=\"article.php?group={$banana->spool->group}&amp;id={$banana->post->id}&amp;type=cancel\">"
44 ._b_('Annuler ce message')."</a>] ";
45 }
46 break;
47 case 'post.php' :
48 echo '[<a href="index.php">'._b_('Liste des forums').'</a>] ';
49 echo "[<a href=\"thread.php?group={$banana->spool->group}\">{$banana->spool->group}</a>]";
50 break;
51 }
52 echo '</div>';
53 }
54
55 ?>
56