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

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

Log message:
- fixed typos (sorry - I'm writinh the source without a possibility to test
it)

Index: php-lib/php/form/assistant.inc
diff -u php-lib/php/form/assistant.inc:1.17 php-lib/php/form/assistant.inc:1.18
--- php-lib/php/form/assistant.inc:1.17 Tue Dec 19 13:58:12 2000
+++ php-lib/php/form/assistant.inc Tue Dec 19 14:34:14 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.17 2000/12/19 12:58:12 uw Exp $
+*  <email protected> $Id: assistant.inc,v 1.18 2000/12/19 13:34:14 uw Exp $
 */
 class assistant extends panemanager {
         
@@ -542,32 +542,11 @@
                         return false;
                 }
 
- 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>";
- }
-
+ if (0 != count($regs = $this->arrayRegexpKeySearch($data, sprintf("/%s_(\d+)_(\d+)(?:_[x|y])?/i", $this->buttonname), $varname, $regs)))
+ $this->selected = (int)$regs[2];
+
                 return true;
         }
-
- /**
- * 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.5 php-lib/php/form/panemanager.inc:1.6
--- php-lib/php/form/panemanager.inc:1.5 Tue Dec 19 14:00:30 2000
+++ php-lib/php/form/panemanager.inc Tue Dec 19 14:34:15 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.5 2000/12/19 13:00:30 uw Exp $
+*  <email protected> $Id: panemanager.inc,v 1.6 2000/12/19 13:34:15 uw Exp $
 */
 class panemanager extends form_commonobject {
 
@@ -292,7 +292,7 @@
                 if (!$regexp)
                         $ok = isset($data[$varname]);
                 else
- $ok = (0 == count($this->arrayKeyRegexpSearch($data, $regexp))) ? false : true;
+ $ok = (0 == count($this->arrayRegexpKeySearch($data, $varname))) ? false : true;
 
                 return $ok;
         } // end func issetHTTPXVAR
@@ -310,7 +310,7 @@
                         return false;
                 }
                         
- return $this->issetHTTPXVAR("/" . $this->finish_button["name"] . "_\d+_\d+(?:_[x|y])?");
+ return $this->issetHTTPXVAR("/" . $this->finish_button["name"] . "_\d+_\d+(?:_[x|y])?", true);
         } // end func isFinishPressed()
         
         /**
@@ -326,7 +326,7 @@
                         return false;
                 }
                 
- return $this->issetHTTPXVAR("/" . $this->exit["name"] . "_\d+_\d+(?:_[x|y])?");
+ return $this->issetHTTPXVAR("/" . $this->exit["name"] . "_\d+_\d+(?:_[x|y])?", true);
         } // end func isExitPressed()
         
         /**
@@ -342,7 +342,7 @@
                         return false;
                 }
                 
- return $this->issetHTTPXVAR("/" . $this->help["name"] . "_\d+_\d+(?:_[x|y])?");
+ return $this->issetHTTPXVAR("/" . $this->help["name"] . "_\d+_\d+(?:_[x|y])?", true);
         } // end func isHelpPressed()
         
         /**
@@ -548,6 +548,22 @@
         function Finish($additional_html = "") {
                 $this->form_end = $this->getFinish($additional_html = "");
         } // end func Finish()
+
+ /**
+ * 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
 
 } // end class panemanager
 ?>

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