Add height parameter to makeImg
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Mon, 10 Jul 2006 09:26:17 +0000 (09:26 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 4 Jan 2008 23:34:51 +0000 (00:34 +0100)
git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@75 9869982d-c50d-0410-be91-f2a2ec7c7c7b

banana/misc.inc.php
banana/spool.inc.php

index 5f35d80..926cac1 100644 (file)
@@ -99,7 +99,7 @@ function makeHREF($params, $text = null)
  *
  * This function can be overloaded by defining hook_makeImg()
  */
-function makeImg($img, $alt, $width = null)
+function makeImg($img, $alt, $height = null, $width = null)
 {
     if (function_exists('hook_makeImg')
             && $res = hook_makeImg($img, $alt, $width)) {
@@ -109,13 +109,16 @@ function makeImg($img, $alt, $width = null)
     if (!is_null($width)) {
         $width = ' width="' . $width . '"';
     }
-
+    if (!is_null($height)) {
+        $height = ' height="' . $height . '"';
+    }
+    
     $proto = empty($_SERVER['HTTPS']) ? 'http://' : 'https://';
     $host  = $_SERVER['HTTP_HOST'];
     $file  = dirname($_SERVER['PHP_SELF']) . '/img/' . $img . '.gif';
     $url   = $proto . $host . $file; 
 
-    return '<img src="' . $url . '"' . $width . ' alt="' . $alt . '" />';
+    return '<img src="' . $url . '"' . $height . $width . ' alt="' . $alt . '" />';
 }
 
 /********************************************************************************
index 5b5bfb3..0b121e9 100644 (file)
@@ -313,16 +313,16 @@ class BananaSpool
 
     function _to_html($_id, $_index, $_first=0, $_last=0, $_ref="", $_pfx_node="", $_pfx_end="", $_head=true)
     {
-        $spfx_f   = makeImg('k1',       'o', 9); 
-        $spfx_n   = makeImg('k2',       '*', 9);
-        $spfx_Tnd = makeImg('T-direct', '+', 12);
-        $spfx_Lnd = makeImg('L-direct', '`', 12);
-        $spfx_snd = makeImg('s-direct', '-', 5);
-        $spfx_T   = makeImg('T',        '+', 12);
-        $spfx_L   = makeImg('L',        '`', 12);
-        $spfx_s   = makeImg('s',        '-', 5);
-        $spfx_e   = makeImg('e',        '&nbsp;', 12);
-        $spfx_I   = makeImg('I',        '|', 12);
+        $spfx_f   = makeImg('k1',       'o', 21, 9); 
+        $spfx_n   = makeImg('k2',       '*', 21, 9);
+        $spfx_Tnd = makeImg('T-direct', '+', 21, 12);
+        $spfx_Lnd = makeImg('L-direct', '`', 21, 12);
+        $spfx_snd = makeImg('s-direct', '-', 21, 5);
+        $spfx_T   = makeImg('T',        '+', 21, 12);
+        $spfx_L   = makeImg('L',        '`', 21, 12);
+        $spfx_s   = makeImg('s',        '-', 21, 5);
+        $spfx_e   = makeImg('e',        '&nbsp;', 21, 12);
+        $spfx_I   = makeImg('I',        '|', 21, 12);
 
         if ($_index + $this->overview[$_id]->desc < $_first || $_index > $_last) {
             return;