[phplib-dev] cvs commit From: uw (phplib-dev <email protected>)
Date: 12/19/00

From: uw
Date: Tue Dec 19 13:58:14 2000
Modified files:
      php-lib/php/form/assistant.inc
      php-lib/php/form/panemanager.inc
      php-lib/php/form/panemanager_gifimage.inc

Log message:
- cleanup
- removed reload bug
- generalized isFinishPressed(), isHelpPressed(), isExitPressed()

Index: php-lib/php/form/assistant.inc
diff -u php-lib/php/form/assistant.inc:1.16 php-lib/php/form/assistant.inc:1.17
--- php-lib/php/form/assistant.inc:1.16 Wed Dec 13 16:10:30 2000
+++ php-lib/php/form/assistant.inc Tue Dec 19 13:58:12 2000
@@ -3,7 +3,7 @@
 * Assistant/wizard that guides a user through several forms.
 *
 *  <email protected> Ulf Wendel <ulf.wendel <email protected>>
-*  <email protected> $Id: assistant.inc,v 1.16 2000/12/13 15:10:30 uw Exp $
+*  <email protected> $Id: assistant.inc,v 1.17 2000/12/19 12:58:12 uw Exp $
 */
 class assistant extends panemanager {
         
@@ -222,7 +222,6 @@
         */
         function get() {
                 
- $this->lastviewed = $this->now;
                 $this->newTemplate();
 
                 // Tablist
@@ -521,7 +520,7 @@
         *  <email protected> boolean
         */
         function findSelected() {
-
+
                 if ("GET" == $this->method)
                         $data =& $GLOBALS["HTTP_GET_VARS"];
                 else
@@ -532,26 +531,43 @@
                 if (!is_array($data) || 0 == count($data))
                         return false;
                 
- if (isset($data[$this->help["name"]])) {
+ if (0 != count($regs = $this->arrayRegexpKeySearch($data, "/" . $this->help["name"] . "_(\d+)_(\d+)/"))) {
                         $this->selected = -2;
+ $this->lastviewed = $regs[1];
                         return false;
                 }
- if (isset($data[$this->exit["name"]])) {
+ if (0 != count($regs = $this->arrayRegexpKeySearch($data, "/" . $this->exit["name"] . "_(\d+)_(\d+)/"))) {
                         $this->selected = -3;
+ $this->lastviewed = $regs[1];
                         return false;
                 }
 
- $len = strlen($this->buttonname);
- foreach ($data as $varname => $v)
- if (substr($varname, 0, $len) == $this->buttonname) {
- if (preg_match(sprintf("/^%s_([0-9]+)_[x|y]$/i", $this->buttonname), $varname, $regs))
- $this->selected = (int)$regs[1];
- else
- $this->selected = (int)substr($varname, $len + 1);
+ foreach ($data as $varname => $v)
+ if (preg_match(sprintf("/%s_(\d+)_(\d+)(?:_[x|y])?/i", $this->buttonname), $varname, $regs)) {
+ $this->selected = (int)$regs[2];
+ print "Last aus findSelected(): " . (int)$regs[1] . "<hr>";
+ } else {
+ print $varname . "<br>";
                         }
                         
                 return true;
- } // end func findSelected
+ }
+
+ /**
+ * Scans the given array for a key that matches the given regexp.
+ *
+ *  <email protected> array
+ *  <email protected> string
+ *  <email protected> array $regs Matches
+ */
+ function arrayRegexpKeySearch($array, $reg) {
+
+ foreach ($array as $k => $v)
+ if (preg_match($reg, $k, $regs))
+ return $regs;
+
+ return array();
+ } // end func arrayRegexKeySearch
         
         /**
         * Find the page that was gets shown next.
Index: php-lib/php/form/panemanager.inc
diff -u php-lib/php/form/panemanager.inc:1.3 php-lib/php/form/panemanager.inc:1.4
--- php-lib/php/form/panemanager.inc:1.3 Tue Dec 19 11:39:51 2000
+++ php-lib/php/form/panemanager.inc Tue Dec 19 13:58:12 2000
@@ -3,7 +3,7 @@
 * Base class of Assistant and TabbedPane. This class holds some functions to
 * render buttons and to care on persistant data
 *  <email protected> Ulf Wendel <ulf <email protected>>
-*  <email protected> $Id: panemanager.inc,v 1.3 2000/12/19 10:39:51 uw Exp $
+*  <email protected> $Id: panemanager.inc,v 1.4 2000/12/19 12:58:12 uw Exp $
 */
 class panemanager extends form_commonobject {
 
@@ -74,16 +74,8 @@
         *  <email protected> setMethod()
         */
         var $method = "POST";
-
         
         /**
- * Last error object
- *  <email protected> object exception $error
- *  <email protected> private
- */
- var $error;
-
- /**
         * Opening form tag
         *  <email protected> string $form_start
         *  <email protected> private
@@ -109,7 +101,7 @@
         *  <email protected> public
         */
         function Init() {
- $this->exceptions[] = new FormError("Call to abstract method", __FILE__, __LINE__);
+ $this->exceptions[] = new form_error("Call to abstract method", __FILE__, __LINE__);
         } // end func Init()
 
         /**
@@ -119,7 +111,7 @@
         *  <email protected>
         */
         function restoreAssistant() {
- $this->exceptions[] = new FormError("Call to abstract method", __FILE__, __LINE__);
+ $this->exceptions[] = new form_error("Call to abstract method", __FILE__, __LINE__);
         } // end func restoreAssistant
         
         /**
@@ -131,7 +123,7 @@
         *  <email protected>
         */
         function get() {
- $this->exceptions[] = new FormError("Call to abstract method", __FILE__, __LINE__);
+ $this->exceptions[] = new form_error("Call to abstract method", __FILE__, __LINE__);
         } // end func get
         
         /**
@@ -140,7 +132,7 @@
         *  <email protected>
         */
         function addPage() {
- $this->exceptions[] = new FormError("Call to abstract method", __FILE__, __LINE__);
+ $this->exceptions[] = new form_error("Call to abstract method", __FILE__, __LINE__);
         } // end func addPage
         
         /*
@@ -148,7 +140,7 @@
         *
         *  <email protected> string $page_name = "", "" means return all pages
         *  <email protected> array $page_values
- *  <email protected> FormError
+ *  <email protected> form_error
         *  <email protected> public
         *  <email protected> isValid()
         */
@@ -158,7 +150,7 @@
                         
                 $p_id = $this->PageNametoPageID($page_name);
                 if (-1 == $p_id) {
- $this->exceptions[] = new FormError("getPageValues(), unknown page '$page_name'",__FILE__, __LINE__);
+ $this->exceptions[] = new form_error("getPageValues(), unknown page '$page_name'",__FILE__, __LINE__);
                         return array();
                 }
                 return array($p_id => $this->page_values[$p_id]);
@@ -214,12 +206,12 @@
         * Returns a HTML reset button
         *  <email protected> string $label
         *  <email protected> string $hmtl
- *  <email protected> FormError
+ *  <email protected> form_error
         *  <email protected> private
         */
         function getResetButton($label) {
                 if (""== (string)$label) {
- $this->exceptions[] = new FormError("getResetButton(), illegal function call", __FILE__, __LINE__);
+ $this->exceptions[] = new form_error("getResetButton(), illegal function call", __FILE__, __LINE__);
                         return "";
                 }
                 return sprintf('<input type="reset" value="%s">', $label);
@@ -236,13 +228,11 @@
         */
         function getButton($label, $value, $name = "") {
                 if ("" == (string)$label || ("" == (string)$value && "" == (string)$name)) {
- $this->exceptions[] = new FormError("assistent -> getButton(), illegal function call", __FILE__, __LINE__);
+ $this->exceptions[] = new form_error("assistent -> getButton(), illegal function call", __FILE__, __LINE__);
                         return "";
                 }
                 
- if ("" == $name)
- $name = sprintf("%s_%d_%d", $this->buttonname, $this->now, $value);
-
+ $name = sprintf("%s_%d_%d", ("" == $name) ? $this->buttonname : $name, $this->now, $value);
                 $html = sprintf('<input type="submit" value="%s" name="%s">',
                                                                                         $label,
                                                                                         $name
@@ -276,39 +266,34 @@
         } // end func getTab
         
         /**
- * checks the existance of a HTTP_POST|GET_VARS
+ * Checks the existance of a HTTP_POST|GET_VARS.
+ *
         *  <email protected> string $varname name of the variable you're looking for.
         * The varibale must be scalar, arrays are not
         * supported
- *  <email protected> bool $ok
+ *  <email protected> boolean $regexp
+ *  <email protected> boolean $ok
         *  <email protected> isHelpPressed(), isExitPressed(), isFinishPressed()
         *  <email protected> private
- *  <email protected> FormError
+ *  <email protected> form_error
         */
- function issetHTTPXVAR($varname) {
- global $HTTP_POST_VARS, $HTTP_GET_VARS;
-
- if("" == $varname) {
- $this->exceptions = new FormError("issetHTTPXVars(), no varname given.", __FILE__, __LINE__);
+ function issetHTTPXVAR($varname, $regexp = false) {
+
+ if ("GET" == $this->method)
+ $data = &$GLOBALS["HTTP_GET_VARS"];
+ else
+ $data = &$GLOBALS["HTTP_POST_VARS"];
+
+ if ("" == $varname) {
+ $this->exceptions[] = new form_error("issetHTTPXVars(), no varname given.", __FILE__, __LINE__);
                         return false;
                 }
-
- $ok = false;
- switch ($this->method) {
- case "POST":
- $ok = isset($HTTP_POST_VARS[$varname]);
- break;
-
- case "GET":
- $ok = isset($HTTP_GET_VARS[$varname]);
- break;
-
- default:
- $this->exceptions[] = new form_error("issetHTTPXVAR(), unknown form method", __FILE__, __LINE__);
- $ok = false;
- break;
- }
                 
+ if (!$regexp)
+ $ok = isset($data[$varname]);
+ else
+ $ok = (0 == count($this->arrayKeyRegexpSearch($data, $regexp)) ? false : true;
+
                 return $ok;
         } // end func issetHTTPXVAR
         
@@ -317,15 +302,15 @@
         *  <email protected> bool $ok
         *  <email protected> isExitPressed(), isHelpPressed()
         *  <email protected> public
- *  <email protected> FormError
+ *  <email protected> form_error
         */
         function isFinishPressed() {
                 if (!isset($this->finish_button["name"])) {
- $this->exceptions[] = new FormError("isFinishPressed(), there's no finish button defined", __FILE__, __LINE__);
+ $this->exceptions[] = new form_error("isFinishPressed(), there's no finish button defined", __FILE__, __LINE__);
                         return false;
                 }
                         
- return $this->issetHTTPXVAR($this->finish_button["name"]);
+ return $this->issetHTTPXVAR("/" . $this->finish_button["name"] . "_\d+_\d+(?:_[x|y])?");
         } // end func isFinishPressed()
         
         /**
@@ -333,42 +318,44 @@
         *  <email protected> bool $ok
         *  <email protected> isFinishPressed(), isHelpPressed()
         *  <email protected> public
- *  <email protected> FormError
+ *  <email protected> form_error
         */
         function isExitPressed() {
                 if (!isset($this->exit["name"])) {
- $this->exceptions[] = new FormError("isExitPressed(), there's no exit button defined", __FILE__, __LINE__);
+ $this->exceptions[] = new form_error("isExitPressed(), there's no exit button defined", __FILE__, __LINE__);
                         return false;
                 }
- return $this->issetHTTPXVARS($this->exit["name"]);
+
+ return $this->issetHTTPXVAR("/" . $this->exit["name"] . "_\d+_\d+(?:_[x|y])?");
         } // end func isExitPressed()
         
         /**
         * Is the Button "Help" pressed?
         *  <email protected> bool $ok
- *  <email protected> FormError
+ *  <email protected> form_error
         *  <email protected> isFinishPressed(), isExitPressed()
         *  <email protected> public
         */
         function isHelpPressed() {
                 if (!isset($this->help["name"])) {
- $this->exceptions[] = new FormError("isHelpPressed(), there's no help button defined", 68, __FILE__, __LINE__);
+ $this->exceptions[] = new form_error("isHelpPressed(), there's no help button defined", 68, __FILE__, __LINE__);
                         return false;
                 }
- return $this->issetHTTPXVARS($this->help["name"]);
+
+ return $this->issetHTTPXVAR("/" . $this->help["name"] . "_\d+_\d+(?:_[x|y])?");
         } // end func isHelpPressed()
         
         /**
         * Set the label, name and comment text that belongs to the help button
         *  <email protected> array $data
         *  <email protected> bool $ok
- *  <email protected> FormError
+ *  <email protected> form_error
         *  <email protected> public
         *  <email protected> setExitButton()
         */
         function setHelp($data) {
                 if (!is_array($data)) {
- $this->exceptions[] = new FormError("setHelp(), illegal function call", __FILE__, __LINE__);
+ $this->exceptions[] = new form_error("setHelp(), illegal function call", __FILE__, __LINE__);
                         return false;
                 }
           $this->help = array (
@@ -383,7 +370,7 @@
         * Set the laben and the name of the exit button
         *  <email protected> string $label
         *  <email protected> string $name
- *  <email protected> FormError
+ *  <email protected> form_error
         *  <email protected> public
         *  <email protected> setHelp()
         */
@@ -391,7 +378,7 @@
                 global $PHP_SELF;
                 
                 if ("" == $name || "" == $label) {
- $this->exceptions[] = new FormError("setExitButton(), illegal function call", __FILE__, __LINE__);
+ $this->exceptions[] = new form_error("setExitButton(), illegal function call", __FILE__, __LINE__);
                         return false;
                 }
                 if ("" == $action)
@@ -410,12 +397,12 @@
         *  <email protected> string $name
         *  <email protected> string $label
         *  <email protected> bool $ok
- *  <email protected> FormError
+ *  <email protected> form_error
         *  <email protected> $finish
         */
         function setFinishButton($label, $name) {
                 if ("" == $name || "" == $label ) {
- $this->exceptions[] = new FormError("setFinishButton(), illegal function call", __FILE__, __LINE__);
+ $this->exceptions[] = new form_error("setFinishButton(), illegal function call", __FILE__, __LINE__);
                         return false;
                 }
                 
@@ -444,7 +431,7 @@
         *  <email protected> string $method
         *  <email protected> bool $ok
         *  <email protected> public
- *  <email protected> FormError
+ *  <email protected> form_error
         *  <email protected> getStart(), Start(), $form_start
         */
         function setStart($html, $method = "POST") {
@@ -533,7 +520,7 @@
         */
         function setFinish($html) {
                 if ("" == $html) {
- $this->exceptions[] = new FormError("assistant -> setFinish(), illegal function call", __FILE__, __LINE__);
+ $this->exceptions[] = new form_error("assistant -> setFinish(), illegal function call", __FILE__, __LINE__);
                         return false;
                 }
                 $this->form_end = $html;
Index: php-lib/php/form/panemanager_gifimage.inc
diff -u php-lib/php/form/panemanager_gifimage.inc:1.1 php-lib/php/form/panemanager_gifimage.inc:1.2
--- php-lib/php/form/panemanager_gifimage.inc:1.1 Tue Jun 20 08:40:12 2000
+++ php-lib/php/form/panemanager_gifimage.inc Tue Dec 19 13:58:13 2000
@@ -1,6 +1,8 @@
 <?php
 /**
-* Doku
+* Renders GIF image buttons.
+*
+*  <email protected> $Id: panemanager_gifimage.inc,v 1.2 2000/12/19 12:58:13 uw Exp $
 */
 class panemanager_gifimage extends panemanger {
 
@@ -154,13 +156,13 @@
         *  <email protected> string $value
         *  <email protected> string $name
         *  <email protected> string $html
- *  <email protected> runtime_wrongparam, runtime_io
+ *  <email protected> form_error
         *  <email protected> private
         *  <email protected> createButton()
         */
- function getButton($label, $value, $name="") {
- if (""==(string)$label || (""==(string)$value && ""==(string)$name)) {
- $this->error = new exception_runtime_wrongparam("getButton(), illegal function call", 15, __FILE__, __LINE__);
+ function getButton($label, $value, $name = "") {
+ if ("" == $label || ("" == $value && "" == $name)) {
+ $this->exceptions[] = new form_error("getButton(), illegal function call", __FILE__, __LINE__);
                         return "";
                 }
         
@@ -171,7 +173,7 @@
                 if (!file_exists($this->cache_dir) || !is_dir($this->cache_dir)) {
                         $ok =  <email protected>($this->cache_dir, 0755);
                         if (false == $ok) {
- $this->error = new exception_io("assistant_gifimage -> getButton(), can't create cache directory.", 52, __FILE__, __LINE__);
+ $this->exceptions[] = new form_error("assistant_gifimage -> getButton(), can't create cache directory.", __FILE__, __LINE__);
                                 return "";
                         }
                 }
@@ -183,39 +185,37 @@
                 }
 
                 $size =  <email protected>($file);
-
- if (""==$name)
- $name = sprintf("%s_%d", $this->buttonname, $value);
-
- $html = sprintf('<input type="image" name="%s" value="%s" src="%s" %s border="%s" alt="%s">',
- $name,
+ return sprintf('<input type="image" name="%s_%d_%d" value="%s" src="%s" %s border="%s" alt="%s">',
+ ("" == $name) ? $this->buttonname : $name,
+ $this->now,
+ $value,
                                                                                         $value,
                                                                                         $url,
                                                                                         $size[3],
                                                                                         $this->tab_border,
                                                                                         $label
                                                                                 );
- return $html;
         } // end func getButton
         
         /**
- * Creates a graphical button
+ * Creates a graphical button.
+ *
         *  <email protected> string $file
         *  <email protected> string $label
         *  <email protected> string $value
         *  <email protected> string $name = ""
         *  <email protected> private
         *  <email protected> bool $ok
- *  <email protected> system
- *  <email protected> getButton()
+ *  <email protected> getButton()
+ *  <email protected> form_error
         */
- function createButton($file, $label, $value, $name="") {
+ function createButton($file, $label, $value, $name = "") {
                 
                 if (true == $this->flag_button_autosize) {
                 
                         $im =  <email protected>(500, 100);
                         if (false == $im) {
- $this->error = new exception_system("createButton(), can't create an image, no image support?", 53, __FILE__, __LINE__);
+ $this->exceptions[] = new form_error("createButton(), can't create image, no image support?", __FILE__, __LINE__);
                                 return false;
                         }
                         $pos = ImageTTFBBox($this->fsize, 0, $this->font, $label);
@@ -231,7 +231,7 @@
                 
                 $im =  <email protected>($width, $height);
                 if ( false == $im) {
- $this->error = new exception_system("assistant_gifimage -> createButton(), can't create an image.", 53, __FILE__, __LINE__);
+ $this->exceptions[] = new form_error("createButton(), can't create image.", __FILE__, __LINE__);
                         return false;
                 }
                 
@@ -251,15 +251,15 @@
                         $col = $this->GDColor($this->button_color["3d"]["dark"]);
                         $black = ImageColorAllocate($im, $col[0], $col[1], $col[3]);
                         
- ImageLine($im, 0, 0, ($width)-0, 0, $white);
+ ImageLine($im, 0, 0, ($width) - 0, 0, $white);
                         ImageLine($im, $width, 0, $width, $height, $black);
- ImageLine($im, 0, ($height)-1, $width, ($height)-1, $black);
+ ImageLine($im, 0, ($height) - 1, $width, ($height) - 1, $black);
                         ImageLine($im, 0, 0, 0, ($height)-1, $black);
                 }
                 
                 $pos = ImageTTFBBox($this->fsize, 0, $this->font, $label);
- $x = (int)($width-($pos[2]-$pos[0]))/2 ;
- $y = (int)($height-($pos[7]-$pos[1]))/2 -1;
+ $x = (int)($width - ($pos[2] - $pos[0])) / 2 ;
+ $y = (int)($height - ($pos[7] - $pos[1])) / 2 - 1;
                 
                 ImageTTFText($im, $this->fsize, 0, $x, $y, $tx, $this->font, $label);
                 ImageGif($im, $file);
@@ -274,7 +274,7 @@
         *  <email protected> bool $optional
         *  <email protected> bool $noerror
         *  <email protected> array ( $tab, $bgcolor )
- *  <email protected> io
+ *  <email protected> form_error
         *  <email protected> private
         */
         function getTab($label, $value, $optional, $noerror) {
@@ -285,19 +285,15 @@
                 
                 if (true == $optional)
                         $k = "optional";
- else {
- if ( true == $noerror)
- $k = "ok";
- else
- $k = "error";
- }
+ else
+ $k = ($noerror) ? "ok" : "error";
+
                 $bgcolor = $this->HTMLColor($this->tab_bgcolor[$k]);
                 
                 if (!file_exists($this->cache_dir) || !is_dir($this->cache_dir)) {
- echo is_dir($this->cache_dir), "<br>", file_exists($this->cache_dir), "<br>";
                         $ok =  <email protected>($this->cache_dir, 0755);
                         if (false == $ok) {
- $this->error = new exception_io("assistant_gifimage -> getTab(), can't create cache directory.", 50, __FILE__, __LINE__);
+ $this->exceptions[] = new form_error("getTab(), can't create cache directory.", __FILE__, __LINE__);
                                 return array("", $bgcolor);
                         }
                 }
@@ -310,8 +306,9 @@
 
                 $size =  <email protected>($file);
                 
- $html = sprintf('<input type="image" name="%s_%d" value="%s" src="%s" %s border="%s" alt="%s">',
+ $html = sprintf('<input type="image" name="%s_%d_%d" value="%s" src="%s" %s border="%s" alt="%s">',
                                                                                         $this->buttonname,
+ $this->now,
                                                                                         $value,
                                                                                         $value,
                                                                                         $url,
@@ -319,18 +316,20 @@
                                                                                         $this->tab_border,
                                                                                         $label
                                                                                 );
+
                 return array($html, $bgcolor);
         } // end func getTab
         
         /**
- * Creates (renders) a graphical tab
+ * Creates (renders) a graphical tab.
+ *
         *  <email protected> string $file filename used to save the tab
         *  <email protected> string $label
         *  <email protected> string $value
         *  <email protected> bool $optional
         *  <email protected> bool $noerror
         *  <email protected> bool $ok
- *  <email protected> system
+ *  <email protected> form_error
         *  <email protected> private
         *  <email protected> getTab()
         */
@@ -338,18 +337,14 @@
                 
                 $im =  <email protected>($this->tab_width, $this->tab_height);
                 if ( false == $im) {
- $this->error = new exception_system("assistant_gifimage -> createTab(), can't create an image.", 50, __FILE__, __LINE__);
+ $this->exceptions[] = new form_error("createTab(), can't create an image.", __FILE__, __LINE__);
                         return false;
                 }
                 
                 if (true == $optional)
                         $k = "optional";
- else {
- if ( true == $noerror)
- $k = "ok";
- else
- $k = "error";
- }
+ else
+ $k = ($noerror) ? "ok" : "error";
                 
                 $col = $this->GDColor($this->tab_color["label"][$k]);
                 $tx = ImageColorAllocate($im, $col[0], $col[1], $col[2]);
@@ -367,16 +362,16 @@
                         $col = $this->GDColor($this->tab_color["3d"]["dark"]);
                         $black = ImageColorAllocate($im, $col[0], $col[1], $col[3]);
                         
- ImageLine($im, 0, 0, ($this->tab_width)-0, 0, $white);
+ ImageLine($im, 0, 0, ($this->tab_width) - 0, 0, $white);
                         ImageLine($im, $this->tab_width, 0, $this->tab_width, $this->tab_height, $black);
- ImageLine($im, 0, ($this->tab_height)-1, $this->tab_width, ($this->tab_height)-1, $black);
- ImageLine($im, 0, 0, 0, ($this->tab_height)-1, $black);
+ ImageLine($im, 0, $this->tab_height - 1, $this->tab_width, $this->tab_height - 1, $black);
+ ImageLine($im, 0, 0, 0, $this->tab_height - 1, $black);
                 }
                 
                 $pos = ImageTTFBBox($this->fsize, 0, $this->font, $label);
                 
- $x = (int)($this->tab_width-($pos[2]-$pos[0]))/2 ;
- $y = (int)($this->tab_height-($pos[7]-$pos[1]))/2 -1;
+ $x = (int)($this->tab_width - ($pos[2] - $pos[0])) / 2;
+ $y = (int)($this->tab_height - ($pos[7] - $pos[1])) / 2 - 1;
                 
                 ImageTTFText($im, $this->fsize, 0, $x, $y, $tx, $this->font, $label);
                 ImageGif($im, $file);
@@ -397,12 +392,10 @@
         *  <email protected> private
         *  <email protected> GDColor()
         */
- function HTMLColor($value) {
- if (""==$value)
+ function HTMLColor($value = "") {
+ if ("" == $value)
                         $value = $this->default_color;
- if (""==$value)
- return "";
-
+
                 if (!is_array($value))
                         return $value;
 
@@ -416,65 +409,19 @@
         *  <email protected> private
         *  <email protected> HTMLColor()
         */
- function GDColor($value) {
- if (""==$value)
+ function GDColor($value = "") {
+ if ("" == $value)
                         $value = $this->default_color;
                 
                 if (is_array($value))
                         return $value;
         
- $hex = array (
+ return array (
                                                                                 0 => HexDec(substr($value, 1, 2)),
                                                                                 1 => HexDec(substr($value, 3, 2)),
                                                                                 2 => HexDec(substr($value, 5, 2))
                                                                         );
- return $hex;
         } // end func GDColor
-
- /**
- * Is the Button "Finish" pressed?
- *  <email protected> bool $ok
- *  <email protected> runtime
- *  <email protected> isExitPressed(), isHelpPressed
- *  <email protected> public
- */
- function isFinishPressed() {
- if (!isset($this->finish_button["name"])) {
- $this->error = new exception_runtime("isFinishPressed(), there's no finish button defined", 66, __FILE__, __LINE__);
- return false;
- }
- return $this->issetHTTPXVAR($this->finish_button["name"]."_x");
- } // end func isFinishPressed()
-
- /**
- * Is the Button "Exit" pressed?
- *  <email protected> bool $ok
- *  <email protected> runtime
- *  <email protected> isFinishPressed(), isHelpPressed()
- *  <email protected> public
- */
- function isExitPressed() {
- if (!isset($this->exit["name"])) {
- $this->error = new exception_runtime("isExitPressed(), there's no exit button defined", 67, __FILE__, __LINE__);
- return false;
- }
- return $this->issetHTTPXVAR($this->exit["name"]."_x");
- } // end func isExitPressed()
-
- /**
- * Is the Button "Help" pressed?
- *  <email protected> bool $ok
- *  <email protected> runtime
- *  <email protected> isFinishPressed(), isExitPressed()
- *  <email protected> public
- */
- function isHelpPressed() {
- if (!isset($this->help["name"])) {
- $this->error = new exception_runtime("isHelpPressed(), there's no help button defined", 68, __FILE__, __LINE__);
- return false;
- }
- return $this->issetHTTPXVAR($this->help["name"]."_x");
- } // end func isHelpPressed()
         
 } // end class assistant_gifimage
 ?>

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-dev-unsubscribe <email protected>
For additional commands, e-mail: phplib-dev-help <email protected>