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

From: uw
Date: Fri Apr 28 13:14:19 2000
Modified files:
      php-lib/php/form/assistant.inc
      php-lib/php/form/assistant_gifimage.inc

Log message:
- $this->page_errors is true if a page is valid, it's false if a page is
invalid. This caused some confusion in getTab(). I fixed that, but I did not
change the name page_errors, so be careful.

Index: php-lib/php/form/assistant.inc
diff -u php-lib/php/form/assistant.inc:1.5 php-lib/php/form/assistant.inc:1.6
--- php-lib/php/form/assistant.inc:1.5 Thu Apr 27 18:14:38 2000
+++ php-lib/php/form/assistant.inc Fri Apr 28 13:14:18 2000
@@ -389,7 +389,7 @@
                 $finished = 0;
                 reset($this->page_errors);
                 while (list($k, $v)=each($this->page_errors))
- if ($v)
+ if (true == $v)
                                 $finished++;
 
                 list($prev, $next)=$this->getNeighbour($this->now);
@@ -482,24 +482,24 @@
         } // end func getButton
 
         /**
- * Generate a tab
+ * Generate a tab.
         *  <email protected> string $label
         *  <email protected> boolean $optional
- *  <email protected> boolean $error
+ *  <email protected> boolean $noerror
         *  <email protected> array ( $tab, $bgcolor )
         *  <email protected> private
         */
- function getTab($label, $value, $optional, $error) {
+ function getTab($label, $value, $optional, $noerror) {
                 
                 $html = sprintf('<input type="submit" value="%s" name="%s_%d">',
                                                                                         $label,
                                                                                         $this->buttonname,
                                                                                         $value
                                                                                 );
- if (!$error)
- $bgcolor = ' bgcolor="#ffe0e0"';
- else
+ if ($noerror)
                         $bgcolor = ' bgcolor="#e0ffe0"';
+ else
+ $bgcolor = ' bgcolor="#ffe0e0"';
                                                                                                         
                 return array($html, $bgcolor);
         } // end func getTab
Index: php-lib/php/form/assistant_gifimage.inc
diff -u php-lib/php/form/assistant_gifimage.inc:1.2 php-lib/php/form/assistant_gifimage.inc:1.3
--- php-lib/php/form/assistant_gifimage.inc:1.2 Thu Apr 27 19:30:23 2000
+++ php-lib/php/form/assistant_gifimage.inc Fri Apr 28 13:14:18 2000
@@ -6,7 +6,7 @@
         *  <email protected> string $font
         *  <email protected> private
         */
- var $font = "/home/www/servers/ulf.dev.netuse.de/fonts/arial.ttf";
+ var $font = "/home/www/servers/ulf.dev.netuse.de/fonts/arialbd.ttf";
         
         /**
         * Font size of a tab
@@ -106,7 +106,7 @@
         var $tab_color = array(
                                                                                                                 "label" => array(
                                                                                                                                                                                                         "ok" => array(244, 255, 255),
- "error" => array(244, 255, 255),
+ "error" => array(253, 178, 96),
                                                                                                                                                                                                         "optional" => array(244, 255, 255)
                                                                                                                                                                                                 ),
                                                                                                         
@@ -267,12 +267,15 @@
         * Generate a graphical tab
         *  <email protected> string $label
         *  <email protected> boolean $optional
- *  <email protected> boolean $error
+ *  <email protected> boolean $noerror
         *  <email protected> array ( $tab, $bgcolor )
         *  <email protected> private
         */
- function getTab($label, $value, $optional, $error) {
+ function getTab($label, $value, $optional, $noerror) {
         
+ if (!$noerror)
+ $label = "! $label";
+
                 $imgname = md5(sprintf("%s:%s%s", $label, $optional, $error));
                 $file = sprintf("%s/%s.gif", $this->cache_dir, $imgname);
                 $url = sprintf("%s/%s.gif", $this->cache_url, $imgname);
@@ -280,10 +283,10 @@
                 if (true == $optional)
                         $k = "optional";
                 else {
- if ( true == $error)
- $k = "error";
- else
+ if ( true == $noerror)
                                 $k = "ok";
+ else
+ $k = "error";
                 }
                 $bgcolor = $this->HTMLColor($this->tab_bgcolor[$k]);
                 
@@ -297,7 +300,7 @@
                 }
                 
                 if (!file_exists($file)) {
- $ok = $this->createTab($file, $label, $value, $optional, $error);
+ $ok = $this->createTab($file, $label, $value, $optional, $noerror);
                         if (false == $ok)
                                 return array("", $bgcolor);
                 }
@@ -322,12 +325,12 @@
         *  <email protected> string $label
         *  <email protected> string $value
         *  <email protected> boolean $optional
- *  <email protected> boolean $error
- *  <email protected> boolean $oks
+ *  <email protected> boolean $noerror
+ *  <email protected> boolean $ok
         *  <email protected> private
         *  <email protected> getTab()
         */
- function createTab($file, $label, $value, $optional, $error) {
+ function createTab($file, $label, $value, $optional, $noerror) {
                 
                 $im =  <email protected>($this->tab_width, $this->tab_height);
                 if ( false == $im) {
@@ -338,10 +341,10 @@
                 if (true == $optional)
                         $k = "optional";
                 else {
- if ( true == $error)
- $k = "error";
- else
+ if ( true == $noerror)
                                 $k = "ok";
+ else
+ $k = "error";
                 }
                 
                 $col = $this->GDColor($this->tab_color["label"][$k]);

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