exit format.inc.php
authorx2000habouzit <x2000habouzit>
Mon, 3 Jan 2005 11:30:54 +0000 (11:30 +0000)
committerx2000habouzit <x2000habouzit>
Mon, 3 Jan 2005 11:30:54 +0000 (11:30 +0000)
include/misc.inc.php
install.d/format.inc.php [deleted file]

index 4171988..88bb39e 100644 (file)
@@ -137,6 +137,56 @@ function formatFrom($text) {
     return preg_replace("/\\\(\(|\))/","\\1",$result);
 }
 
+function displayshortcuts($first = -1) {
+    global $banana, $css;
+    $sname = basename($_SERVER['SCRIPT_NAME']);
+
+    echo "<div class=\"{$css['bananashortcuts']}\">";
+
+    if (function_exists('hook_displayshortcuts')) {
+        hook_displayshortcuts($sname, $first);
+    } else {
+        echo '[<a href="disconnect.php">'._b_('Déconnexion').'</a>] ';
+    }
+
+    switch ($sname) {
+        case 'thread.php' :
+            echo '[<a href="index.php">'._b_('Liste des forums').'</a>] ';
+            echo "[<a href=\"post.php?group={$banana->spool->group}\">"._b_('Nouveau message')."</a>] ";
+            if (sizeof($banana->spool->overview)>$banana->tmax) {
+                for ($ndx=1; $ndx<=sizeof($banana->spool->overview); $ndx += $banana->tmax) {
+                    if ($first==$ndx) {
+                        echo "[$ndx-".min($ndx+$banana->tmax-1,sizeof($banana->spool->overview))."] ";
+                    } else {
+                        echo "[<a href=\"?group={$banana->spool->group}&amp;first="
+                            ."$ndx\">$ndx-".min($ndx+$banana->tmax-1,sizeof($banana->spool->overview))
+                            ."</a>] ";
+                    }
+                }
+            }
+            break;
+        case 'article.php' :
+            echo '[<a href="index.php">'._b_('Liste des forums').'</a>] ';
+            echo "[<a href=\"thread.php?group={$banana->spool->group}\">{$banana->spool->group}</a>] ";
+            echo "[<a href=\"post.php?group={$banana->spool->group}&amp;id={$banana->post->id}&amp;type=followup\">"
+                ._b_('Répondre')."</a>] ";
+            if ($banana->post->checkcancel()) {
+                echo "[<a href=\"article.php?group={$banana->spool->group}&amp;id={$banana->post->id}&amp;type=cancel\">"
+                    ._b_('Annuler ce message')."</a>] ";
+            }
+            break;
+        case 'post.php' :
+            echo '[<a href="index.php">'._b_('Liste des forums').'</a>] ';
+            echo "[<a href=\"thread.php?group={$banana->spool->group}\">{$banana->spool->group}</a>]";
+            break;
+    }
+    echo '</div>';
+}
+
+/********************************************************************************
+ *  FORMATTING STUFF : BODY
+ */
+
 function wrap($text, $_prefix="")
 {
     $parts = preg_split("/\n-- ?\n/", $text);
diff --git a/install.d/format.inc.php b/install.d/format.inc.php
deleted file mode 100644 (file)
index 064b7ad..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-/********************************************************************************
-* install.d/format.inc.php : HTML output subroutines
-* --------------------------
-*
-* This file is part of the banana distribution
-* Copyright: See COPYING files that comes with this distribution
-********************************************************************************/
-
-
-/** contextual links 
- * @return STRING HTML output
- */
-function displayshortcuts($first = -1) {
-    global $banana;
-    $sname = basename($_SERVER['SCRIPT_NAME']);
-
-    echo '<div class="shortcuts">';
-    echo '[<a href="disconnect.php">'._b_('Déconnexion').'</a>] ';
-
-    switch ($sname) {
-        case 'thread.php' :
-            echo '[<a href="index.php">'._b_('Liste des forums').'</a>] ';
-            echo "[<a href=\"post.php?group={$banana->spool->group}\">"._b_('Nouveau message')."</a>] ";
-            if (sizeof($banana->spool->overview)>$banana->tmax) {
-                for ($ndx=1; $ndx<=sizeof($banana->spool->overview); $ndx += $banana->tmax) {
-                    if ($first==$ndx) {
-                        echo "[$ndx-".min($ndx+$banana->tmax-1,sizeof($banana->spool->overview))."] ";
-                    } else {
-                        echo "[<a href=\"".$_SERVER['PHP_SELF']."?group={$banana->spool->group}&amp;first="
-                            ."$ndx\">$ndx-".min($ndx+$banana->tmax-1,sizeof($banana->spool->overview))
-                            ."</a>] ";
-                    }
-                }
-            }
-            break;
-        case 'article.php' :
-            echo '[<a href="index.php">'._b_('Liste des forums').'</a>] ';
-            echo "[<a href=\"thread.php?group={$banana->spool->group}\">{$banana->spool->group}</a>] ";
-            echo "[<a href=\"post.php?group={$banana->spool->group}&amp;id={$banana->post->id}&amp;type=followup\">"
-                ._b_('Répondre')."</a>] ";
-            if ($banana->post->checkcancel()) {
-                echo "[<a href=\"article.php?group={$banana->spool->group}&amp;id={$banana->post->id}&amp;type=cancel\">"
-                    ._b_('Annuler ce message')."</a>] ";
-            }
-            break;
-        case 'post.php' :
-            echo '[<a href="index.php">'._b_('Liste des forums').'</a>] ';
-            echo "[<a href=\"thread.php?group={$banana->spool->group}\">{$banana->spool->group}</a>]";
-            break;
-    }
-    echo '</div>';
-}
-
-?>
-