cvs: pear /HTML_OOH_Form/examples/wizard/order adress_page.php custom_validators.php foo.php index.php menu.php order.php page.php
/HTML_OOH_Form/examples/wizard/order/templates 1x1.gif add.gif back.gif cancel.gif delete.gif delivery_adress.html edit.gif finish.gif help.js
invoice_adress.html login.html m_delivery_adress.gif m_delivery_adress_act.gif m_invoice_adress.gif m_invoice_adress_act.gif m_login.gif
m_login_act.gif m_payment.gif m_payment_act.gif m_personal_data.gif m_personal_data_act.gif m_shipping.gif m_shipping_act.gif m_update.gif
m_update_act.gif n_delivery_address.gif n_delivery_address_act.gif n_invoice_address.gif n_invoice_address_act.gif n_login.gif n_login_act.gif
n_payment.gif n_payment_act.gif n_personal_data.gif n_personal_data_act.gif n_shipping.gif n_shipping_act.gif n_update.gif n_update_act.gif next.gif
ooh.gif paper1.gif paper2.gif paper3.gif payment.html personal_data.html save.gif shipping.html spacer120x1.gif spacer470x1.gif spacer470x1_light.gif
spacer_475x1.gif ua.js update.gif update_adress.html /HTML_OOH_Form/examples/wizard/order/xml delivery_adress.xml invoice_adress.xml login.xml
payment.xml personal_data.xml shipping.xml update_adress.xml

From: Date: Thu, 01 Nov 2001 05:11:56 +0000
Subject: cvs: pear /HTML_OOH_Form/examples/wizard/order adress_page.php custom_validators.php foo.php index.php menu.php order.php page.php
/HTML_OOH_Form/examples/wizard/order/templates 1x1.gif add.gif back.gif cancel.gif delete.gif delivery_adress.html edit.gif finish.gif help.js
invoice_adress.html login.html m_delivery_adress.gif m_delivery_adress_act.gif m_invoice_adress.gif m_invoice_adress_act.gif m_login.gif
m_login_act.gif m_payment.gif m_payment_act.gif m_personal_data.gif m_personal_data_act.gif m_shipping.gif m_shipping_act.gif m_update.gif
m_update_act.gif n_delivery_address.gif n_delivery_address_act.gif n_invoice_address.gif n_invoice_address_act.gif n_login.gif n_login_act.gif
n_payment.gif n_payment_act.gif n_personal_data.gif n_personal_data_act.gif n_shipping.gif n_shipping_act.gif n_update.gif n_update_act.gif next.gif
ooh.gif paper1.gif paper2.gif paper3.gif payment.html personal_data.html save.gif shipping.html spacer120x1.gif spacer470x1.gif spacer470x1_light.gif
spacer_475x1.gif ua.js update.gif update_adress.html /HTML_OOH_Form/examples/wizard/order/xml delivery_adress.xml invoice_adress.xml login.xml
payment.xml personal_data.xml shipping.xml update_adress.xml
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-1223@lists.php.net to get a copy of this message
uw Thu Nov 1 00:11:56 2001 EDT Added files: /pear/HTML_OOH_Form/examples/wizard/order adress_page.php custom_validators.php foo.php index.php menu.php order.php page.php /pear/HTML_OOH_Form/examples/wizard/order/templates 1x1.gif add.gif back.gif cancel.gif delete.gif delivery_adress.html edit.gif finish.gif help.js invoice_adress.html login.html m_delivery_adress.gif m_delivery_adress_act.gif m_invoice_adress.gif m_invoice_adress_act.gif m_login.gif m_login_act.gif m_payment.gif m_payment_act.gif m_personal_data.gif m_personal_data_act.gif m_shipping.gif m_shipping_act.gif m_update.gif m_update_act.gif n_delivery_address.gif n_delivery_address_act.gif n_invoice_address.gif n_invoice_address_act.gif n_login.gif n_login_act.gif n_payment.gif n_payment_act.gif n_personal_data.gif n_personal_data_act.gif n_shipping.gif n_shipping_act.gif n_update.gif n_update_act.gif next.gif ooh.gif paper1.gif paper2.gif paper3.gif payment.html personal_data.html save.gif shipping.html spacer120x1.gif spacer470x1.gif spacer470x1_light.gif spacer_475x1.gif ua.js update.gif update_adress.html /pear/HTML_OOH_Form/examples/wizard/order/xml delivery_adress.xml invoice_adress.xml login.xml payment.xml personal_data.xml shipping.xml update_adress.xml Log: A more complicated wizard example, showing almost all features

Index: pear/HTML_OOH_Form/examples/wizard/order/adress_page.php +++ pear/HTML_OOH_Form/examples/wizard/order/adress_page.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ // | PHP version 4.0 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> | // +----------------------------------------------------------------------+ // // $Id: adress_page.php,v 1.1 2001/11/01 05:11:55 uw Exp $ require_once('HTML_OOH_Form/examples/wizard/order/page.php'); require_once('HTML/IT.php'); class adress_page extends order_page { var $adress_id = NULL; var $events = NULL; function getFormPage($startfinish = false, $reload = false) { global $adresslist; if ($reload) { // reload HTTP_[POST|GET]_VARS $this->form->autoloadValues(); } $it = new IntegratedTemplate(FORM_FILE_DIR); $it->loadTemplateFile($this->template, false); $ellist = $this->form->getElements(); reset($ellist); while (list($k, $name) = each($ellist)) { $it->setVariable(strtoupper($name), $this->form->getElement($name)); $it->setVariable('LABEL_' . strtoupper($name), $name); } if ($this->first_call) { $this->first_call = false; } else { $valres = $this->form->validate(); $valres = $valres[1]; reset($valres); while (list($name, $msg) = each($valres)) { if ($it->setCurrentBlock('error_' . strtolower($name))) { $it->setVariable('ERROR_' . strtoupper($name), $msg); $it->parseCurrentBlock(); } } } if ($startfinish) { $it->setVariable('START_FORM', $this->form->Start()); $it->setVariable('END_FORM', $this->form->Finish()); } // the difference starts right here... // check if our customer is registred and we have a customer_id if ('customer_id' == $this->message) { // hello old fellow if (!$this->form->elementExists('radio_new')) $this->form->addElement( array( 'type' => 'radio', 'name' => 'radio_adress', 'elname'=> 'radio_new', 'value' => 'enter_new', 'validator' => 'address', 'validator_callback' => true, 'checked' => true ) ); $it->setVariable('RADIO_NEW', $this->form->getElement('radio_new')); // add a list of previously used adresses to the page // and rember the buttons a user can press to update // an adress $this->events = array(); // ... no, I won't query the database but use a class variable $i = 1; reset($adresslist); while (list($k, $adress) = each($adresslist)) { // add a radio selector for each adress if we did not before if (!$this->form->elementExists('radio_' . $k)) { $this->form->addElement( array( 'type' => 'radio', 'name' => 'radio_adress', 'elname'=> 'radio_' . $k, 'value' => $k ) ); } $it->setCurrentBlock('radio_' . $i); $it->setVariable('RADIO_' . $i, $this->form->getElement('radio_' . $k)); $it->parseCurrentBlock(); // dump the adress data as plain text $it->setCurrentBlock('adress_row'); $it->setVariable('FIRST_NAME_' . $i, $adress['first_name']); $it->setVariable('LAST_NAME_' . $i, $adress['last_name']); $it->setVariable('STREET_' . $i, $adress['street']); $it->setVariable('STREET_NUMBER_' . $i, $adress['street_number']); $it->setVariable('ZIP_CODE_' . $i, $adress['zip_code']); $it->setVariable('CITY_' . $i, $adress['city']); $it->setVariable('COUNTRY_' . $i, $adress['country']); $this->form->addElement( array( 'type' => 'image', 'name' => 'adress_update_' . $k, 'src' => 'templates/edit.gif' ) ); $it->setVariable('BUTTON_EDIT_' . $i, $this->form->getElement('adress_update_' . $k)); $this->events[$k] = 'adress_update_' . $k; // parse the block every second data set // two td in one tr if (++$i > 2) { $it->parseCurrentBlock(); $i = 1; } } $it->parseCurrentBlock(); } else { $this->events = NULL; } return $it->get(); } // end func getFormPage function getMessage() { global $adresslist; // get the submitted values $http_x_vars = &$GLOBALS['HTTP_' . $this->form->getMethod() . '_VARS']; if (is_array($this->events)) { // page delivery or invoice => check if "edit" adress pressed reset($this->events); while (list($adr_id, $button) = each($this->events)) { $name = $this->form->getElementnameprefix() . $button; if (isset($http_x_vars[$name]) || isset($http_x_vars[$name . '_x'])) { // select the radio button of this adress $this->form->setChecked('radio_' . $adr_id); return array('adress_page', $adr_id); } } } $message = NULL; $name = $this->form->getElementnameprefix(); if (isset($http_x_vars[$name . 'save']) || isset($http_x_vars[$name . 'save_x'])) { // button save reset($adresslist[$this->adress_id]); while (list($field, $value) = each($adresslist[$this->adress_id])) $adresslist[$this->adress_id][$field] = $this->form->getValue($field); $message = 'remove_page'; } else if (isset($http_x_vars[$name . 'delete']) || isset($http_x_vars[$name . 'delete_x'])) { // button delete unset($adresslist[$this->adress_id]); $message = 'remove_and_deselect'; } else if (isset($http_x_vars[$name . 'cancel']) || isset($http_x_vars[$name . 'cancel_x'])) { // button cancel $message = 'remove_and_deselect'; } if ($message) { // remove the radio selector $this->form->removeElement('radio_' . $this->adress_id); } return array($message, $this->adress_id); } // end func getMessage function setMessage($message, $message_value) { global $adresslist; parent::setMessage($message, $message_value); if ('load_adress' == $message) { $this->adress_id = $message_value; $this->form->setValues($adresslist[$message_value]); } } } // end class adress_page ?> Index: pear/HTML_OOH_Form/examples/wizard/order/custom_validators.php +++ pear/HTML_OOH_Form/examples/wizard/order/custom_validators.php <?php /** * Custom validators of the order process wizard * * @module custom_validators * @package HTML_OOH_Form * @author Ulf Wendel <ulf.wendel@phpdoc.de> * @version $Id: custom_validators.php,v 1.1 2001/11/01 05:11:55 uw Exp $ */ /** * Custom validator: page login * * @param object form */ function login(&$form) { // some user forget to set the radio button manually // we've to guess what they mean... $unregistered = ($form->getValue('first_name') || $form->getValue('last_name') || $form->getValue('email')); $registered = ($form->getValue('username') || $form->getValue('password')); $selected = $form->getValue('status'); if ('unregistered' == $selected && !$unregistered && $registered) { // radio unregistered, unregistered form empty, registered form filled $form->setChecked('registered'); $selected = 'registered'; } else if ('registered' == $selected && $unregistered && !$registered) { // radio registered, unregistered form filled, registered form empty $form->setChecked('unregistered'); $selected = 'unregistered'; } // validate certain fields depending on the selected option if ('unregistered' == $selected) { $form->validationOff(array('username' => 'all', 'password' => 'all')); $form->validationOn(array('first_name' => 'all', 'last_name' => 'all', 'email' => 'all')); } else { $form->validationOn(array('username' => 'all', 'password' => 'all')); $form->validationOff(array('first_name' => 'all', 'last_name' => 'all', 'email' => 'all')); // in real life you'd query a database to look up account data if ('test' != $form->getValue('username') || 'test' != $form->getValue('password')) $form->setValidationError('username', 'Use test/test to login. '); } } // end func login /** * Custom validator: delivery address or invoice address * * @param object form */ function address(&$form) { if ('enter_new' == $form->getValue('radio_new')) { // user want's to enter a new address $form->validationOn(array('first_name' => 'all', 'last_name' => 'all', 'street' => 'all', 'street_number' => 'all', 'city' => 'all', 'country' => 'all', 'zip_code' => 'all') ); } else { // user has selected a previously entered address $form->validationOff(array('first_name' => 'all', 'last_name' => 'all', 'street' => 'all', 'street_number' => 'all', 'city' => 'all', 'country' => 'all', 'zip_code' => 'all') ); } } // end func address /** * Custom validator: method of paymnet * * @param object form */ function payment(&$form) { if ('purchase order' == $form->getValue('method')) { // do not validate the credit card fields... $form->validationOff(array('card_type' => 'all', 'holder_name' => 'all', 'card_number' => 'all', 'expiration_date' => 'all' ) ); } else { // validate the credit card fields $form->validationOn(array('card_type' => 'all', 'holder_name' => 'all', 'card_number' => 'all', 'expiration_date' => 'all' ) ); } } // end func payment /** * Custom validator: shipping / paper selection * * @param object form */ function paper(&$form) { if ('wrapped' == $form->getValue('wrapped') && '' == $form->getValue('paper')) { $form->setChecked('paper1'); } } // end func paper /** * Custom validator: shipping / gift card * * @param object form */ function card(&$form) { if ('card' == $form->getValue('card')) { $message = $form->getValue('message'); if ('' == $message) $form->setValidationError('message', 'Please enter a message (max. 100 character).'); else if (strlen($message) > 100) $form->setValidationError('message', 'Shorten your message. 100 characters are allowed, you have entered ' . strlen($message) . '.'); } } // end func card ?> Index: pear/HTML_OOH_Form/examples/wizard/order/foo.php +++ pear/HTML_OOH_Form/examples/wizard/order/foo.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Untitled</title> </head> <body> <form> <input type="image" name="_login_direct" src="templates/m_login.gif"> </form> </body> </html> Index: pear/HTML_OOH_Form/examples/wizard/order/index.php +++ pear/HTML_OOH_Form/examples/wizard/order/index.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ // | PHP version 4.0 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> | // +----------------------------------------------------------------------+ // // $Id: index.php,v 1.1 2001/11/01 05:11:55 uw Exp $ function getMicrotime() { list($usec, $sec) = explode(' ', microtime()); return (float)$usec + (float)$sec; } $time['Start'] = getMicrotime(); // Modify this! define('FORM_FILE_DIR', $DOCUMENT_ROOT . 'projekte/'); require_once('HTML_OOH_Form/examples/wizard/order/custom_validators.php'); require_once('HTML_OOH_Form/examples/wizard/order/order.php'); require_once('HTML_OOH_Form/examples/wizard/order/page.php'); require_once('HTML_OOH_Form/examples/wizard/session_helper.php'); $time['first Include'] = getMicrotime(); // custom validator function serialnumber(&$form) { $serial = $form->getValue('serialnumber'); if ('' == $serial) { $form->setValidationError('serialnumber', 'Please enter the serialnumber.'); } else if ('2001-OCT-23-#1957' != $serial) { // in real life you'd query a database or something similar $form->setValidationError('serialnumber', 'Please check the serialnumber. It is invalid'); } } // end func serialnumber $total_inc = session_pre_include(); $time['Session pre include'] = getMicrotime(); session_register('w'); if (!is_object($w)) { $w = new order(); $time['Order Init'] = getMicrotime(); $m = "HTTP_ACCEPT_LANGUAGE : $HTTP_ACCEPT_LANGUAGE\n"; $m.= "HTTP_HOST : $HTTP_HOST\n"; $m.= "HTTP_REFERER : $HTTP_REFERER\n"; $m.= "HTTP_USER_AGENT : $HTTP_USER_AGENT\n"; $m.= "REMOTE_ADDR : $REMOTE_ADDR\n"; #mail('ulf.wendel@phpdoc.de', "HTML_OOH_Form: Installer [$REMOTE_ADDR]", $m); $adresslist = array( array( 'first_name' => 'Ulf', 'last_name' => 'Wendel', 'street' => 'Papenkamp', 'street_number' => '17', 'zip_code' => '24114', 'city' => 'Kiel', 'country' => 'Germany' ), array( 'first_name' => 'Joe', 'last_name' => 'Dolittle', 'street' => 'Example St.t', 'street_number' => '123', 'zip_code' => '4567', 'city' => 'Dolittle City', 'country' => 'Joe United' ) ); session_register('adresslist'); } $time['Session register']; $w->show(); $time['Installer show()'] = getMicrotime(); session_save_include(); $time['Session save include'] = getMicrotime(); // some profiling print '<p style="margin-top: 40px;"><pre style="color: #F9CE8E; font: bold 8pt monospace;">'; $last = end($time); reset($time); list($label, $first) = each($time); $prev = $first; reset($time); while (list($label, $sec) = each($time)) { printf("%40s %2.3f s (%2.2f %%) %2.3f s\n", $label, $sec - $prev, (100 / ($last - $first)) * ($sec - $prev), $sec - $first ); $prev = $sec; } $t = serialize($w); $start = getMicrotime(); unserialize($t); $end = getMicrotime(); printf("\n%40s %2.3f s (%2.2f %%) %2.3f s\n", "appoximate unserialization time", $end - $start, (100 / ($last - $first)) * ($end - $start), $end - $last ); print "</pre></p>"; ?> Index: pear/HTML_OOH_Form/examples/wizard/order/menu.php +++ pear/HTML_OOH_Form/examples/wizard/order/menu.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ // | PHP version 4.0 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> | // +----------------------------------------------------------------------+ // // $Id: menu.php,v 1.1 2001/11/01 05:11:55 uw Exp $ require_once('HTML/Menu.php'); class menu extends HTML_Menu { var $form; function menu($menu, &$form) { $this->setMenu($menu); $this->form = &$form; } // end func menu function buildMenu($menu, $level = 0, $flag_stop_level = -1) { static $submenu; if ('rows' != $this->menu_type) return parent::buildMenu($menu, $level, $flag_stop_level); if (0 == $level) $this->html .= $this->getStart(); $cell = 0; $num = 0; $submenu = false; // loop through the (sub)menu foreach ($menu as $node_id => $node) { if ($this->current_url == $node['url']) { // menu item that fits to this url - 'active' menu item $type = 1; } else if (isset($this->path[$level]) && $this->path[$level] == $node_id) { // processed menu item is part of the path to the active menu item $type = 2; } else { // not selected, not a part of the path to the active menu item $type = 0; } $this->html .= $this->getEntry($node, $level, $type); // remember the subtree if ($type && isset($node['sub'])) $submenu = $node['sub']; else { if (!$submenu) $cell++; } if (!isset($node['sub'])) $num++; } // go deeper if neccessary if ($submenu) { $this->html .= '</tr><tr>'; for ($i = 0; $i < $cell; $i++) $this->html .= '<td align="left" valign="top" bgcolor="#6C000E"><img src="templates/1x1.gif" width="1" height="1"></td>'; $this->html .= '<td align="left" valign="top" bgcolor="#F9CE8E"><img src="templates/1x1.gif" width="1" height="1"></td>'; for ($i = $cell; $i < $num; $i++) $this->html .= '<td align="left" valign="top" bgcolor="#6C000E"><img src="templates/1x1.gif" width="1" height="1"></td>'; $this->html .= '</tr><tr>'; $painted = $this->buildMenu($submenu, $level + 1); for ($i = $painted; $i <= $num; $i++) $this->html .= '<td align="left" valign="top" bgcolor="#F9CE8E"><img src="templates/1x1.gif" width="1" height="1"></td>'; } if (0 == $level) $this->html .= $this->getEnd(); return $num; } function getStart() { switch ($this->menu_type) { case 'rows': $html = '<table cellspacing="0" cellpadding="0"><tr>'; break; case 'tree': $html = '<table border="0" cellspacing="2" cellpadding="0">'; break; default: $html = parent::getStart(); } return $html; } function getEntry(&$node, $level, $item_type) { static $j = 0; switch ($this->menu_type) { case 'tree': // tree menu $html .= '<tr>'; $indent = ''; if ($level) for ($i = 0; $i < $level; $i++) $indent .= '&nbsp;&nbsp;&nbsp;'; $src = ($node['valid2']) ? '_act.gif' : '.gif'; if (!$this->form->ElementExists($node['name'] . '_')) $this->form->addElement(array( 'type' => 'image', 'name' => $node['name'], 'elname'=> $node['name'] . '_', 'src' => $node['src2'] . $src, 'alt' => $node['alt'] ) ); $html .= sprintf('<td align="left" valign="top">%s%s</td>', $indent, $this->form->getElement($node['name'] . '_') ); $html .= '</tr>'; break; case 'rows': // we have to do this, otherwise the event handling will not work! $src = (1 == $item_type) ? '_act.gif' : '.gif'; if (!$this->form->ElementExists($node['name'])) $this->form->addElement(array( 'type' => 'image', 'name' => $node['name'], 'src' => $node['src'] . $src, 'alt' => $node['alt'] ) ); $html = sprintf('<td align="left" valign="top" bgcolor="#F5B757">%s</td>', $this->form->getElement($node['name']) ); break; default: return parent::getEntry(&$node, $level, $item_type); break; } return $html; } } // end class menu ?> Index: pear/HTML_OOH_Form/examples/wizard/order/order.php +++ pear/HTML_OOH_Form/examples/wizard/order/order.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ // | PHP version 4.0 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> | // +----------------------------------------------------------------------+ // // $Id: order.php,v 1.1 2001/11/01 05:11:55 uw Exp $ require_once('HTML_OOH_Form/form_wizard.php'); require_once('HTML/IT.php'); require_once('HTML_OOH_Form/examples/wizard/order/menu.php'); require_once('HTML_OOH_Form/examples/wizard/order/page.php'); require_once('HTML_OOH_Form/examples/wizard/order/adress_page.php'); /** * Customized wizard consisting of plain text pages and forms * * @author Ulf Wendel <ulf.wendel@phpdoc.de> * @version $Id: order.php,v 1.1 2001/11/01 05:11:55 uw Exp $ * @package HTML_OOH_Form */ class order extends form_wizard { var $customer_id = NULL; var $event_images = array( 'next' => 'templates/next.gif', 'back' => 'templates/back.gif', 'finish' => 'templates/finish.gif', 'cancel' => 'templates/cancel.gif' ); var $pagelist = array( 'login' => array( 'tpl' => 'HTML_OOH_Form/examples/wizard/order/templates/login.html', 'xml' => 'HTML_OOH_Form/examples/wizard/order/xml/login.xml', 'title' => 'login', 'button' => 'templates/m_login', 'button2' => 'templates/n_login', 'alt' => 'Login', 'type' => 'page' ), 'personal' => array( 'tpl' => 'HTML_OOH_Form/examples/wizard/order/templates/personal_data.html', 'xml' => 'HTML_OOH_Form/examples/wizard/order/xml/personal_data.xml', 'title' => 'personal', 'button' => 'templates/m_personal_data', 'button2' => 'templates/n_personal_data', 'alt' => 'Personal data', 'type' => 'page' ), 'delivery' => array( 'tpl' => 'HTML_OOH_Form/examples/wizard/order/templates/delivery_adress.html', 'xml' => 'HTML_OOH_Form/examples/wizard/order/xml/delivery_adress.xml', 'title' => 'delivery', 'button' => 'templates/m_delivery_adress', 'button2' => 'templates/n_delivery_address', 'alt' => 'Delivery address', 'type' => 'adress_page' ), 'invoice' => array( 'tpl' => 'HTML_OOH_Form/examples/wizard/order/templates/invoice_adress.html', 'xml' => 'HTML_OOH_Form/examples/wizard/order/xml/invoice_adress.xml', 'title' => 'invoice', 'button' => 'templates/m_invoice_adress', 'button2' => 'templates/n_invoice_address', 'alt' => 'Invoice address', 'type' => 'adress_page' ), 'payment' => array( 'tpl' => 'HTML_OOH_Form/examples/wizard/order/templates/payment.html', 'xml' => 'HTML_OOH_Form/examples/wizard/order/xml/payment.xml', 'title' => 'payment', 'button' => 'templates/m_payment', 'button2' => 'templates/n_payment', 'alt' => 'Method of payment', 'type' => 'page' ), 'shipping' => array( 'tpl' => 'HTML_OOH_Form/examples/wizard/order/templates/shipping.html', 'xml' => 'HTML_OOH_Form/examples/wizard/order/xml/shipping.xml', 'title' => 'shipping', 'button' => 'templates/m_shipping', 'button2' => 'templates/n_shipping', 'alt' => 'Shipping', 'type' => 'page' ), 'edit_adr' => array( 'tpl' => 'HTML_OOH_Form/examples/wizard/order/templates/update_adress.html', 'xml' => 'HTML_OOH_Form/examples/wizard/order/xml/update_adress.xml', 'title' => 'edit_adress', 'button' => 'templates/m_update', 'button2' => 'templates/n_update', 'alt' => 'Edit adress', 'type' => 'adress_page' ) ); /** * List of initianal pages * * @var */ var $default_pages = array( 'login', 'personal'); /** * Loads the order wizard with some pages * */ function order() { // depending on the user (registered/unregistered) we'll add pages later on $this->addPage($this->pagelist['login']['title'], $this->createPage('login')); // allow switching pages only if the last page is valid $this->mode = 'modal'; } // end constructor function get() { global $PHP_SELF; // no change to the base class: $last_page = $this->last_page; // get the page list($page, $event) = $this->findPage(); if ('invoice' == $page || 'delivery' == $page) { // registered customer => add list of old adresses // these pages need a message if this is a registed customer // well, this is a simple way of communications but it demonstrates // what I wanna say $this->pages[$page]->setMessage('customer_id', $this->customer_id); // let's see if we get an answer... list($message, $message_value) = $this->pages[$page]->getMessage(); if ('adress_page' == $message) { // someone pressed 'update' on an old adress... // insert a new page to our wizard and present it. $this->insertPage('edit_adr_' . $page, $this->createPage('edit_adr'), $page); $page = 'edit_adr_' . $page; // set the last page flag to make sure // that events from the new page will be recognized correct. $this->last_page = $page; // preload the form of the page with the selected adress $this->pages[$page]->setMessage('load_adress', $message_value); } } if ('edit_adr_invoice' == $page || 'edit_adr_delivery' == $page) { // edit_* page list($message, $message_value) = $this->pages[$page]->getMessage(); if ('remove_page' == $message) { // save $this->removePage($page); $page = substr($page, strlen('edit_adr_')); $this->last_page = $page; } else if ('remove_and_deselect' == $message) { // delete of cancel // remove the edit_* page $this->removePage($page); $page = substr($page, strlen('edit_adr_')); $this->last_page = $page; // select "enter new adress" and revalidate $this->forms[$page]->setChecked('radio_new'); $this->validation_flags[$page] = $this->pages[$page]->isValid(); } } // no back button on the first page... reset($this->pages); list($first, ) = each($this->pages); if ($first == $page) $this->disableButton($page, array('back' => true)); // dump the page if ('form' == $this->pages[$page]->type) { $html = $this->dumpPage($page, $this->pages[$page]->get(false, ($last_page == $page))); } else { $html = $this->dumpPage($page, $this->pages[$page]->get(false, ($last_page == $page))); } // add navigation to the page $m = &$this->buildMenu($page); $html = str_replace('__MENU__', $m->get('rows'), $html); $html = str_replace('__MENU_TREE__', $m->get('tree'), $html); return $html; } // end func get /** * Creates a Menu3 menu hash from the list of pages * * @param string current page * @return object Menu3 */ function &buildMenu($page) { global $PHP_SELF; // build the menu dynamically according to list of pages $prev = true; $menu = array(); reset($this->pages); while (list($name, ) = each($this->pages)) { $menu[$name] = array( 'alt' => $this->pagelist[$name]['alt'], 'src' => $this->pagelist[$name]['button'], 'src2' => $this->pagelist[$name]['button2'], 'url' => ($page == $name) ? $PHP_SELF : '', 'valid' => $this->validation_flags[$name], 'valid2' => $prev, // note: this name format must not be changed! // getEvent() will not work otherwise! 'name' => '_' . $page . '_direct_' . $name ); if (!$this->validation_flags[$name]) $prev = false; } // well build the submenu manually if (isset($this->pages['edit_adr_delivery'])) { unset($menu['edit_adr_delivery']); $menu['delivery']['sub'] = array( 'edit_adr_delivery' => array( 'alt' => $this->pagelist['edit_adr']['alt'], 'src' => $this->pagelist['edit_adr']['button'], 'url' => ($page == 'edit_adr_delivery') ? $PHP_SELF : '', 'valid' => $this->validation_flags['edit_adr_delivery'], 'name' => '_' . $page . '_direct_edit_adr_delivery' ) ); } // generate the menu return new menu($menu, &$this->forms[$page]); } // end func buildMenu function &createPage($name) { if ('page' == $this->pagelist[$name]['type']) $p = new order_page($this->pagelist[$name]['tpl'], $name, $this->pagelist[$name]['xml']); else $p = new adress_page($this->pagelist[$name]['tpl'], $name, $this->pagelist[$name]['xml']); return $p; } // end func createPage function dumpPage($page, $html = '') { // create a template object $it = new IntegratedTemplate(); $it->setTemplate($html); // add page switching buttons $buttons = array( 'help' => 'BUTTON_HELP', 'finish' => 'BUTTON_FINISH', 'cancel' => 'BUTTON_CANCEL', 'back' => 'BUTTON_BACK', 'next' => 'BUTTON_NEXT' ); reset($buttons); while (list($event, $var) = each($buttons)) if ($this->buttons[$page][$event]['active']) { $it->setVariable($var, $this->forms[$page]->getElement($this->buttons[$page][$event]['name'])); } // add opening and closing form tag $it->setVariable('START_FORM', $this->forms[$page]->getStart()); $it->setVariable('END_FORM', $this->forms[$page]->getFinish()); return $it->get(); } // end func dumpPage function handleNext($last) { if (1 == count($this->pages) && $this->validation_flags[$last]) { // First page login if ('unregistered' == $this->forms[$last]->getValue('status')) { // unregistered customer // add these pages $pages = array('personal', 'delivery', 'payment', 'shipping'); reset($pages); while (list($k, $name) = each($pages)) $this->addPage( $this->pagelist[$name]['title'], $this->createPage($name) ); // preload the page personal data with the login data $fields = array('first_name', 'last_name', 'email'); reset($fields); while (list($k, $field) = each($fields)) $this->forms['personal']->setValue($field, $this->forms['login']->getValue($field)); // next one is personal data $next = 'personal'; } else { // registred customer // add these pages $pages = array('delivery', 'payment', 'shipping'); reset($pages); while (list($k, $name) = each($pages)) $this->addPage( $this->pagelist[$name]['title'], $this->createPage($name) ); // in real life here goes some db query code... $this->customer_id = 1; $next = 'delivery'; } // remove the login page $this->removePage('login'); return $next; } return parent::handleNext($last); } // end func handleNext function handleBackNext($last, $event) { if ('delivery' == $last) { if (isset($this->pages['invoice'])) { // check if we have to remove the page if ('equal_delivery' == $this->forms[$last]->getValue('invoice_adr')) { $this->removePage('invoice'); return ('next' == $event) ? 'payment' : 'personal'; } } else { // the customer wants to provide a payment adress if ('equal_delivery' != $this->forms[$last]->getValue('invoice_adr')) { // insert the payment page after the delivery adress $this->insertPage( $this->pagelist['invoice']['title'], $this->createPage('invoice'), 'delivery' ); // make it the next page return ('next' == $event) ? 'invoice' : 'personal'; } } } return parent::handleBackNext($last, $event); } // end func handleBackNext function handleDirect($last, $directpage) { if (('edit_adr_invoice' == $last && 'invoice' == $directpage) || ('edit_adr_delivery' == $last && 'delivery' == $directpage)) { // last page: "edit adress" - tab "invoice" or "delivery" selected => cancel => remove // cancel = select "enter new adress" $this->forms[$directpage]->setChecked('radio_new'); // form changed => revalidate $this->validation_flags[$directpage] = $this->pages[$directpage]->isValid(); // remove edit_* page $this->removePage($last); // allow page switch return $directpage; } return parent::handleDirect($last, $directpage); } // end func handleDirect function handleCancel($last) { die("Cancel: this has not been coded yet. >:-)"); } // end func handleCancel function handleFinish($last) { die("Finish: this has not been coded yet. >:-)"); } // end func handleFinish function createButton(&$form, $page, $event, $label) { $form->addElement(array( 'name' => '_' . $page . '_' . $event, 'type' => 'image', 'src' => $this->event_images[$event], 'alt' => ucfirst($event) ) ); // don't forget to remember the button so that we can find out which // event a request caused. Note getElementnamePrefix(). $this->buttons[$page][$event]['name'] = '_' . $page . '_' . $event; } // end func createButton } // end class order ?> Index: pear/HTML_OOH_Form/examples/wizard/order/page.php +++ pear/HTML_OOH_Form/examples/wizard/order/page.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ // | PHP version 4.0 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> | // +----------------------------------------------------------------------+ // // $Id: page.php,v 1.1 2001/11/01 05:11:55 uw Exp $ require_once('HTML_OOH_Form/form.php'); require_once('HTML_OOH_Form/form_page_form.php'); require_once('HTML_OOH_Form/layoutmanager/form_itmanager.php'); require_once('HTML_OOH_Form/form_xmlfactory.php'); /** * Form page that can handle real form pages and plain text pages * * You should study this class if your're going to use the wizard * features. It's a very helpful starting point. * * @author Ulf Wendel <ulf.wendel@phpdoc.de> * @version $Id: page.php,v 1.1 2001/11/01 05:11:55 uw Exp $ * @package HTML_OOH_Form */ class order_page extends form_page_form { /** * Message field used to communicate with the order wizard * * @var mixed * @see $message_value, getMessage(), setMessage() */ var $message = NULL; /** * Optional message content used to communicate with the order wizard * * @var mixed * @see $message, getMessage(), setMessage() */ var $message_value = NULL; /** * True if a page is shown the first time, later on false * * Used to suppress error messages in case a page is shown the first time. * * @var boolean */ var $first_call = true; /** * Template file to be used. * * @var string */ var $template = ''; /** * Creates a wizard page containing a plain text page or a itmanaged form * * @param string template file * @param string page name * @param string xml form definition file * @global FORM_FILE_DIR */ function order_page($template, $name = '', $xml_form = '') { $this->template = $template; $this->name = $name; if ('' != $xml_form) { $this->form = new form_xmlfactory(FORM_FILE_DIR . $xml_form); // inform the wizard that this page contains a form $this->type = 'form'; } else { // this is not a form page - the wizard has to create it's own // form to be able to add the page switching buttons $this->type = 'template'; } } // end constructor function getMessage() { return array($this->message, $this->message_value); } // end func getMessage function setMessage($message, $message_value) { $this->message = $message; $this->message_value = $message_value; } // end func setMessage function get($startfinish = false, $reload = false) { return ('form' != $this->type) ? $this->getTemplatePage($startfinish) : $this->getFormPage($startfinish, $reload); } // end func get /** * Returns a wizard page consisting of plain text (template) * * @return string * @see get(), getFormPage() * @global FORM_FILE_DIR */ function getTemplatePage($startfinish = false) { return implode('', file(FORM_FILE_DIR . $this->template)); } // end func getTemplatePage /** * Returns a wizard page containing a form * * @param boolean print opening and closing form tag? * @param boolean is this a reload? * @return string * @see get(), getTemplatePage() * @global FORM_FILE_DIR */ function getFormPage($startfinish = false, $reload = false) { if ($reload) // reload HTTP_[POST|GET]_VARS $this->form->autoloadValues(); // store validation flags $valres = $this->form->validate(); $valres = $valres[1]; $itx = new itmanager(); $itx->setTemplate($this->template, FORM_FILE_DIR, false); // opening form tag if ($startfinish) $itx->addContent($this->form->Start(), 'START_FORM'); // dumping the form elements $ellist = $this->form->getElements(); reset($ellist); while (list($k, $name) = each($ellist)) { $itx->addContent($this->form->getElement($name), $name); $itx->addContent($this->form->getLabel($name), 'LABEL_' . $name); } if ($this->first_call) { // don't show error message the first time a page is presented $this->first_call = false; } else { // show error messages reset($valres); while (list($name, $msg) = each($valres)) $itx->addContent($msg, 'ERROR_' . $name); } // closing form tag if ($startfinish) $itx->addContent($this->form->Finish(), 'END_FORM'); return $itx->get(); } // end func getFormPage function isValid() { // template pages are always valid return ('form' != $this->type) ? true : form_page_form::isValid(); } // end func isValid function getValues() { // template pages do not contain any values return ('form' != $this->type) ? array() : parent::getValues(); } // end func getValues } // end class order_page ?> Index: pear/HTML_OOH_Form/examples/wizard/order/templates/delivery_adress.html +++ pear/HTML_OOH_Form/examples/wizard/order/templates/delivery_adress.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>OOH Form Rewrite: order process wizard</title> <link rel="stylesheet" href="templates/order.css" type="text/css"> <!-- Netscape cross-browser Vodoo: http://developer.netscape.com/evangelism/docs/articles/updating-dhtml-web-pages/ --> <script type="text/javascript" src="templates/ua.js"></script> <script type="text/javascript" src="templates/help.js"></script> </head> <body> {START_FORM} <table border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td height="12" colspan="5" align="left" valign="top" bgcolor="#6C000E"><img src="templates/1x1.gif" width="1" height="12" border="0" alt=""></td> </tr> <tr> <td width="49%" rowspan="10" align="right" valign="top"> &nbsp; </td> <td width="480" colspan="2" align="left" valign="top" bgcolor="#EE9C00" style="padding-top: 4px; padding-left: 2px;"> __MENU__ </td> <td width="120" align="right" valign="bottom" bgcolor="#6C000E"><img src="templates/ooh.gif" width="120" height="20" border="0" alt="OOH!"></td> <td width="49%" rowspan="10" align="left" valign="top"> &nbsp; </td> </tr> <tr> <td height="6" colspan="3" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td> </tr> <tr> <td width="475" align="left" valign="top" style="padding-left: 2"> <h1>Delivery adress</h1> Where do you want the goods to be delivered? Choose one of your previously entered addresses (if available) or enter a new adress. <img src="templates/spacer470x1.gif" width="470" height="1" border="0" alt="" vspace="4"> <!-- BEGIN old_adresses --> <table cellspacing="4" cellpadding="0"> <tr> <td colspan="3"><b>Use one of my previously entered addresses:</b></td> </tr> <tr> <td colspan="3" align="left" valign="top"><img src="templates/1x1.gif" width="1" height="1" border="0" alt=""></td> </tr> <!-- BEGIN adress_row --> <tr> <td align="left" valign="top"> <!-- BEGIN radio_1 -->{RADIO_1} use:<br><!-- END radio_1 --> <b>{FIRST_NAME_1} {LAST_NAME_1}</b><br> {STREET_1} {STREET_NUMBER_1}<br> {ZIP_CODE_1} {CITY_1}<br> {COUNTRY_1}<br style="margin-bottom: 2px;"> {BUTTON_EDIT_1} </td> <td>&nbsp;</td> <td align="left" valign="top"> <!-- BEGIN radio_2 -->{RADIO_2} use:<br><!-- END radio_2 --> <b>{FIRST_NAME_2} {LAST_NAME_2}</b><br> {STREET_2} {STREET_NUMBER_2}<br> {ZIP_CODE_2} {CITY_2}<br> {COUNTRY_2}<br style="margin-bottom: 2px;"> {BUTTON_EDIT_2} </td> </tr> <!-- END adress_row --> </table> <img src="templates/spacer470x1_light.gif" width="470" height="1" border="0" alt="" vspace="4"> <div style="margin-bottom: 9px;"><b>{RADIO_NEW} I want to enter a new address.</b><br> Check this button if you want to use the address entered below.</div> <!-- END old_adresses --> <table border="0" cellspacing="0" cellpadding="1"> <tr> <td align="left" valign="top">First name</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {FIRST_NAME} </td> </tr> <tr> <td align="left" valign="top">Last name</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {LAST_NAME} <!-- BEGIN error_last_name --> <br><font color="#6C000E" style="font-size: 8pt;">{ERROR_LAST_NAME}</font> <!-- END error_last_name --> </td> </tr> <tr> <td align="left" valign="top">Street</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top"> {STREET} </td> <td width="99%" align="left" valign="top"> {STREET_NUMBER} </td> </tr> <tr> <td colspan="2" align="left" valign="top"> <!-- BEGIN error_street --> <font color="#6C000E" style="font-size: 8pt;">{ERROR_STREET}</font> <!-- END error_street --> <!-- BEGIN error_street_number --> <font color="#6C000E" style="font-size: 8pt;">{ERROR_STREET_NUMBER}</font> <!-- END error_street_number --> </td> </tr> </table> </td> </tr> <tr> <td align="left" valign="top" nowrap>Zip Code, City</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top"> {ZIP_CODE} </td> <td width="99%" align="left" valign="top"> {CITY} </td> </tr> <tr> <td colspan="2" align="left" valign="top"> <!-- BEGIN error_zip_code --> <font color="#6C000E" style="font-size: 8pt;">{ERROR_ZIP_CODE}</font> <!-- END error_zip_code --> <!-- BEGIN error_city --> <font color="#6C000E" style="font-size: 8pt;">{ERROR_CITY}</font> <!-- END error_city --> </td> </tr> </table> </td> </tr> <tr> <td align="left" valign="top">Country</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {COUNTRY} <!-- BEGIN error_country --> <br><font color="#6C000E" style="font-size: 8pt;">{ERROR_COUNTRY}</font> <!-- END error_country --> </td> </tr> </table> <img src="templates/spacer470x1_light.gif" width="470" height="1" border="0" alt="" vspace="4"> <b>{INVOICE_ADR} Invoice address and delivery address are the same.</b> <img src="templates/spacer_475x1.gif" width="475" height="1" border="0" alt=""> </td> <td width="5" rowspan="5" align="left" valign="top"><img src="templates/1x1.gif" width="5" height="1" border="0" alt=""></td> <td width="120" rowspan="5" align="left" valign="top"> <div style="color:#F5B757";"> <div style="color: #6C000E; font-weight: bold; font-size: 10pt;">Help</div> <br> <div id="help_addresses" style="position:relative; padding: 2px; font-size:8pt" onMouseOver="showHelp('addresses', true);" onMouseOut="showHelp('addresses', false);"> <b>Invoice address</b><br> Hint: Check the box on the bottom of the page if the delivery and the invoice address are the same. </div> <img src="templates/spacer120x1.gif" width="120" height="1" border="0" alt="----" hspace="2"> <br> <div style="color: #FF8000; font-weight: bold; font-size: 8pt; padding-bottom: 2px;">You are here:</div> __MENU_TREE__ </div> </td> </tr> <tr> <td height="12" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="12"></td> </tr> <tr> <td height="1" align="left" valign="top" bgcolor="#F5B757"><img src="templates/1x1.gif" width="1" height="1" border="0" alt=""></td> </tr> <tr> <td height="2" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td> </tr> <tr> <td width="475" align="left" valign="top"> <table cellspacing="0" cellpadding="2"> <tr> <td align="left" valign="top">{BUTTON_BACK}</td> <td width="49%">&nbsp;</td> <td align="left" valign="top">{BUTTON_CANCEL}</td> <td width="49%" align="left" valign="top">&nbsp;</td> <td align="left" valign="top">{BUTTON_NEXT}</td> </tr> </table> </td> </tr> <tr><td height="6" colspan="3" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td></tr> <tr> <td height="3" colspan="3" align="left" valign="top" bgcolor="#F5B757"><img src="templates/1x1.gif" width="1" height="3" border="0" alt=""></td> </tr> <tr> <td height="2" colspan="3" align="left" valign="top" bgcolor="#6C000E"><img src="templates/1x1.gif" width="1" height="2" border="0" alt=""></td> </tr> </table> {END_FORM} </body> </html> Index: pear/HTML_OOH_Form/examples/wizard/order/templates/help.js +++ pear/HTML_OOH_Form/examples/wizard/order/templates/help.js var fgcolor_on = "#6C000E"; var fgcolor_off = "#F5B757"; var bgcolor_on = "#F0F0F0"; var bgcolor_off = "#FFFFFF"; var last = ""; function showHelp(name, on) { var id = 'help_' + name; var box, fgcolor, bgcolor; if (on) { if ("" != last) showHelp(last, false); last = name; fgcolor = fgcolor_on; bgcolor = bgcolor_on; } else { fgcolor = fgcolor_off; bgcolor = bgcolor_off; } if ("nn4" == navigator.family) { // Proprietary Navigator 4.x code box = document.layers[id]; if (box) { box.bgColor = bgcolor; box.color = fgcolor; } } else if (navigator.family == 'ie4' && navigator.version >= 4 && navigator.version < 5) { // Proprietary IE4 box = documents.all[id]; if (box != undefined) { box.style.backgroundColor = bgcolor; box.style.color = fgcolor; } } else if (navigator.DOMHTML && navigator.DOMCSS2) { // The Standards Compliant Way .. recommended. box = document.getElementById(id); if (box) { box.style.backgroundColor = bgcolor; box.style.color = fgcolor; } } } // end func showHelp Index: pear/HTML_OOH_Form/examples/wizard/order/templates/invoice_adress.html +++ pear/HTML_OOH_Form/examples/wizard/order/templates/invoice_adress.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>OOH Form Rewrite: order process wizard</title> <link rel="stylesheet" href="templates/order.css" type="text/css"> <!-- Netscape cross-browser Vodoo: http://developer.netscape.com/evangelism/docs/articles/updating-dhtml-web-pages/ --> <script type="text/javascript" src="templates/ua.js"></script> <script type="text/javascript" src="templates/help.js"></script> </head> <body> {START_FORM} <table border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td height="12" colspan="5" align="left" valign="top" bgcolor="#6C000E"><img src="templates/1x1.gif" width="1" height="12" border="0" alt=""></td> </tr> <tr> <td width="49%" rowspan="10" align="right" valign="top"> &nbsp; </td> <td width="480" colspan="2" align="left" valign="top" bgcolor="#EE9C00" style="padding-top: 4px; padding-left: 2px;"> __MENU__ </td> <td width="120" align="right" valign="bottom" bgcolor="#6C000E"><img src="templates/ooh.gif" width="120" height="20" border="0" alt="OOH!"></td> <td width="49%" rowspan="10" align="left" valign="top"> &nbsp; </td> </tr> <tr> <td height="6" colspan="3" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td> </tr> <tr> <td width="475" align="left" valign="top" style="padding-left: 2"> <h1>Invoice adress</h1> Where do you want the bill to be sent? <img src="templates/spacer470x1.gif" width="470" height="1" border="0" alt="" vspace="4"> <!-- BEGIN old_adresses --> <table cellspacing="4" cellpadding="0"> <tr> <td colspan="3"><b>Use one of my previously entered addresses:</b></td> </tr> <tr> <td colspan="3" align="left" valign="top"><img src="templates/1x1.gif" width="1" height="1" border="0" alt=""></td> </tr> <!-- BEGIN adress_row --> <tr> <td align="left" valign="top"> <!-- BEGIN radio_1 -->{RADIO_1} use:<br><!-- END radio_1 --> <b>{FIRST_NAME_1} {LAST_NAME_1}</b><br> {STREET_1} {STREET_NUMBER_1}<br> {ZIP_CODE_1} {CITY_1}<br> {COUNTRY_1}<br style="margin-bottom: 2px;"> {BUTTON_EDIT_1} </td> <td>&nbsp;</td> <td align="left" valign="top"> <!-- BEGIN radio_2 -->{RADIO_2} use:<br><!-- END radio_2 --> <b>{FIRST_NAME_2} {LAST_NAME_2}</b><br> {STREET_2} {STREET_NUMBER_2}<br> {ZIP_CODE_2} {CITY_2}<br> {COUNTRY_2}<br style="margin-bottom: 2px;"> {BUTTON_EDIT_2} </td> </tr> <!-- END adress_row --> </table> <img src="templates/spacer470x1_light.gif" width="470" height="1" border="0" alt="" vspace="4"> <div style="margin-bottom: 9px;"><b>{RADIO_NEW} I want to enter a new address.</b><br> Check this button if you want to use the address entered below.</div> <!-- END old_adresses --> <table border="0" cellspacing="0" cellpadding="1"> <tr> <td align="left" valign="top">First name</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {FIRST_NAME} </td> </tr> <tr> <td align="left" valign="top">Last name</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {LAST_NAME} <!-- BEGIN error_last_name --> <br><font color="#6C000E" style="font-size: 8pt;">{ERROR_LAST_NAME}</font> <!-- END error_last_name --> </td> </tr> <tr> <td align="left" valign="top">Street</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top"> {STREET} </td> <td width="99%" align="left" valign="top"> {STREET_NUMBER} </td> </tr> <tr> <td colspan="2" align="left" valign="top"> <!-- BEGIN error_street --> <font color="#6C000E" style="font-size: 8pt;">{ERROR_STREET}</font> <!-- END error_street --> <!-- BEGIN error_street_number --> <font color="#6C000E" style="font-size: 8pt;">{ERROR_STREET_NUMBER}</font> <!-- END error_street_number --> </td> </tr> </table> </td> </tr> <tr> <td align="left" valign="top" nowrap>Zip Code, City</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top"> {ZIP_CODE} </td> <td width="99%" align="left" valign="top"> {CITY} </td> </tr> <tr> <td colspan="2" align="left" valign="top"> <!-- BEGIN error_zip_code --> <font color="#6C000E" style="font-size: 8pt;">{ERROR_ZIP_CODE}</font> <!-- END error_zip_code --> <!-- BEGIN error_city --> <font color="#6C000E" style="font-size: 8pt;">{ERROR_CITY}</font> <!-- END error_city --> </td> </tr> </table> </td> </tr> <tr> <td align="left" valign="top">Country</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {COUNTRY} <!-- BEGIN error_country --> <br><font color="#6C000E" style="font-size: 8pt;">{ERROR_COUNTRY}</font> <!-- END error_country --> </td> </tr> </table> <img src="templates/spacer_475x1.gif" width="475" height="1" border="0" alt=""> </td> <td width="5" rowspan="5" align="left" valign="top"><img src="templates/1x1.gif" width="5" height="1" border="0" alt=""></td> <td width="120" rowspan="5" align="left" valign="top"> <div style="color:#F5B757";"> <div style="color: #6C000E; font-weight: bold; font-size: 10pt;">Help</div> <br> <div id="help_addresses" style="position:relative; padding: 2px; font-size:8pt" onMouseOver="showHelp('addresses', true);" onMouseOut="showHelp('addresses', false);"> <b>Invoice address</b><br> Hint: Check the box on the bottom of the page if the delivery and the invoice address are the same. </div> <img src="templates/spacer120x1.gif" width="120" height="1" border="0" alt="----" hspace="2"> <br> <div style="color: #FF8000; font-weight: bold; font-size: 8pt; padding-bottom: 2px;">You are here:</div> __MENU_TREE__ </div> </td> </tr> <tr> <td height="12" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="12"></td> </tr> <tr> <td height="1" align="left" valign="top" bgcolor="#F5B757"><img src="templates/1x1.gif" width="1" height="1" border="0" alt=""></td> </tr> <tr> <td height="2" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td> </tr> <tr> <td width="475" align="left" valign="top"> <table cellspacing="0" cellpadding="2"> <tr> <td align="left" valign="top">{BUTTON_BACK}</td> <td width="49%">&nbsp;</td> <td align="left" valign="top">{BUTTON_CANCEL}</td> <td width="49%" align="left" valign="top">&nbsp;</td> <td align="left" valign="top">{BUTTON_NEXT}</td> </tr> </table> </td> </tr> <tr><td height="6" colspan="3" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td></tr> <tr> <td height="3" colspan="3" align="left" valign="top" bgcolor="#F5B757"><img src="templates/1x1.gif" width="1" height="3" border="0" alt=""></td> </tr> <tr> <td height="2" colspan="3" align="left" valign="top" bgcolor="#6C000E"><img src="templates/1x1.gif" width="1" height="2" border="0" alt=""></td> </tr> </table> {END_FORM} </body> </html> Index: pear/HTML_OOH_Form/examples/wizard/order/templates/login.html +++ pear/HTML_OOH_Form/examples/wizard/order/templates/login.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>OOH Form Rewrite: order process wizard</title> <link rel="stylesheet" href="templates/order.css" type="text/css"> <!-- Netscape cross-browser Vodoo: http://developer.netscape.com/evangelism/docs/articles/updating-dhtml-web-pages/ --> <script type="text/javascript" src="templates/ua.js"></script> <script type="text/javascript" src="templates/help.js"></script> </head> <body> {START_FORM} <table border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td height="12" colspan="5" align="left" valign="top" bgcolor="#6C000E"><img src="templates/1x1.gif" width="1" height="12" border="0" alt=""></td> </tr> <tr> <td width="49%" rowspan="10" align="left" valign="top">&nbsp; </td> <td width="480" colspan="2" align="left" valign="top" bgcolor="#EE9C00" style="padding-top: 4px; padding-left: 2px;"> __MENU__ </td> <td width="120" align="right" valign="bottom" bgcolor="#6C000E"><img src="templates/ooh.gif" width="120" height="20" border="0" alt="OOH!"></td> <td width="49%" rowspan="10">&nbsp;</td> </tr> <tr> <td height="6" colspan="3" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td> </tr> <tr> <td width="475" align="left" valign="top" style="padding-left: 2"> <h1>Login</h1> This wizard will guide you step-by-step through the order process. Help messages are on the left. Ordering starts with a login. <img src="templates/spacer470x1.gif" width="470" height="1" border="0" alt="" vspace="4"> <table cellspacing="0" cellpadding="1"> <tr> <td colspan="3" align="left" valign="top"> {UNREGISTERED} <b>I am a new customer</b>. </td> </tr> <tr><td colspan="3" height="3"><img src="1x1.gif" width="1" height="3" border="0" alt=""></td></tr> <tr> <td align="left" valign="top" nowrap width="80">First name</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {FIRST_NAME} <!-- BEGIN error_first_name --> <br><font color="#6C000E" style="font-size: 8pt;">{ERROR_FIRST_NAME}</font> <!-- END error_first_name --> </td> </tr> <tr> <td align="left" valign="top" nowrap>Last name</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {LAST_NAME} <!-- BEGIN error_last_name --> <br><font color="#6C000E" style="font-size: 8pt;">{ERROR_LAST_NAME}</font> <!-- END error_last_name --> </td> </tr> <tr> <td align="left" valign="top" nowrap>E-Mail adress</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {EMAIL} <!-- BEGIN error_email --> <br><font color="#6C000E" style="font-size: 8pt;">{ERROR_EMAIL}</font> <!-- END error_email --> </td> </tr> </table> <img src="templates/spacer470x1_light.gif" width="470" height="1" border="0" alt="" vspace="4"> <table cellspacing="0" cellpadding="1"> <tr> <td colspan="3" align="left" valign="top"> {REGISTERED} <b>I am a registred customer</b>. </td> </tr> <tr><td colspan="3" height="3"><img src="1x1.gif" width="1" height="3" border="0" alt=""></td></tr> <tr> <td align="left" valign="top"> Username </td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {USERNAME} <!-- BEGIN error_username --> <br><font color="#6C000E" style="font-size: 8pt;">{ERROR_USERNAME}</font> <!-- END error_username --> </td> </tr> <tr> <td align="left" valign="top">Password</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {PASSWORD} <!-- BEGIN error_password --> <br><font color="#6C000E" style="font-size: 8pt;">{ERROR_PASSWORD}</font> <!-- END error_password --> </td> </tr> </table> <img src="spacer_475x1.gif" width="475" height="1" border="0" alt="-"> </td> <td width="5" rowspan="5" align="left" valign="top"><img src="templates/1x1.gif" width="5" height="1" border="0" alt=""></td> <td width="120" rowspan="5" align="left" valign="top"> <div style="color:#F5B757";"> <div style="color: #6C000E; font-weight: bold; font-size: 10pt;">Help</div> <br> <div id="help_email" style="position:relative; padding: 2px; font-size:8pt" onMouseOver="showHelp('email', true);" onMouseOut="showHelp('email', false);"> <b>E-Mail adress</b><br> Please make sure that your email is valid. We need it to confirm the order and to contact you. </div> <img src="templates/spacer120x1.gif" width="120" height="1" border="0" alt="----" hspace="2"> <div id="help_password" style="position:relative; padding: 2px; font-size:8pt" onMouseOver="showHelp('password', true);" onMouseOut="showHelp('password', false);"> <b>Password</b><br> Watch out: your password is case sensitive. Use test:test for the test account. </div> <img src="templates/spacer120x1.gif" width="120" height="1" border="0" alt="----" hspace="2"> <div id="help_registration" style="position:relative; padding: 2px; font-size:8pt" onMouseOver="showHelp('registration', true);" onMouseOut="showHelp('registration', false);"> <b>Registration</b><br> Registration saves you a lot of time. It allows us to load all required input fields with your data. </div> <img src="templates/spacer120x1.gif" width="120" height="1" border="0" alt="----" hspace="2"> </div> </td> </tr> <tr> <td height="12" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="12"></td> </tr> <tr> <td height="1" align="left" valign="top" bgcolor="#F5B757"><img src="templates/1x1.gif" width="1" height="1" border="0" alt=""></td> </tr> <tr> <td height="2" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td> </tr> <tr> <td width="475" align="left" valign="top"> <table cellspacing="0" cellpadding="2"> <tr> <td align="left" valign="top">{BUTTON_BACK}</td> <td width="49%">&nbsp;</td> <td align="left" valign="top">{BUTTON_CANCEL}</td> <td width="49%" align="left" valign="top">&nbsp;</td> <td align="left" valign="top">{BUTTON_NEXT}</td> </tr> </table> </td> </tr> <tr><td height="6" colspan="3" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td></tr> <tr> <td height="3" colspan="3" align="left" valign="top" bgcolor="#F5B757"><img src="templates/1x1.gif" width="1" height="3" border="0" alt=""></td> </tr> <tr> <td height="2" colspan="3" align="left" valign="top" bgcolor="#6C000E"><img src="templates/1x1.gif" width="1" height="2" border="0" alt=""></td> </tr> </table> {END_FORM} </body> </html> Index: pear/HTML_OOH_Form/examples/wizard/order/templates/payment.html +++ pear/HTML_OOH_Form/examples/wizard/order/templates/payment.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>OOH Form Rewrite: order process wizard</title> <link rel="stylesheet" href="templates/order.css" type="text/css"> <!-- Netscape cross-browser Vodoo: http://developer.netscape.com/evangelism/docs/articles/updating-dhtml-web-pages/ --> <script type="text/javascript" src="templates/ua.js"></script> <script type="text/javascript" src="templates/help.js"></script> </head> <body> {START_FORM} <table border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td height="12" colspan="5" align="left" valign="top" bgcolor="#6C000E"><img src="templates/1x1.gif" width="1" height="12" border="0" alt=""></td> </tr> <tr> <td width="49%" rowspan="10">&nbsp;</td> <td width="480" colspan="2" align="left" valign="top" bgcolor="#EE9C00" style="padding-top: 4px; padding-left: 2px;"> __MENU__ </td> <td width="120" align="right" valign="bottom" bgcolor="#6C000E"><img src="templates/ooh.gif" width="120" height="20" border="0" alt="OOH!"></td> <td width="49%" rowspan="10">&nbsp;</td> </tr> <tr> <td height="6" colspan="3" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td> </tr> <tr> <td width="475" align="left" valign="top"style="padding-left: 2"> <h1>Payment</h1> How do you want to pay? Choose wheter you want to make a purchase order or pay by a credit card. <img src="templates/spacer470x1.gif" width="470" height="1" border="0" alt="" vspace="4"> <b>{PURCHASE} I want to make a purchase order</b><br> <img src="templates/spacer470x1_light.gif" width="470" height="1" border="0" alt="" vspace="4"> <table border="0" cellspacing="0" cellpadding="1"> <tr> <td colspan="3" align="left" valign="top"><b>{CREDIT_CARD} I want to pay by a credit card</b></td> </tr> <tr><td colspan="3" height="3"><img src="1x1.gif" width="1" height="3" border="0" alt=""></td></tr> <tr> <td align="left" valign="top">Card</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {CARD_TYPE} </td> </tr> <tr> <td align="left" valign="top">Card Holder Name</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {HOLDER_NAME} <!-- BEGIN error_holder_name --> <br><font color="#6C000E" style="font-size: 8pt;">{ERROR_HOLDER_NAME}</font> <!-- END error_holder_name --> </td> </tr> <tr> <td align="left" valign="top">Card number</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {CARD_NUMBER} <!-- BEGIN error_card_number --> <br><font color="#6C000E" style="font-size: 8pt;">{ERROR_CARD_NUMBER}</font> <!-- END error_card_number --> </td> </tr> <tr> <td align="left" valign="top">Expiration Date</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {EXPIRATION_DATE} </td> </tr> </table> <img src="spacer_475x1.gif" width="475" height="1" border="0" alt="-"> </td> <td width="5" rowspan="5" align="left" valign="top"><img src="templates/1x1.gif" width="5" height="1" border="0" alt=""></td> <td width="120" rowspan="5" align="left" valign="top"> <div style="color:#F5B757";"> <div style="color: #6C000E; font-weight: bold; font-size: 10pt;">Help</div> <br> <div id="help_phone" style="position:relative; padding: 2px; font-size:8pt" onMouseOver="showHelp('phone', true);" onMouseOut="showHelp('phone', false);"> <b>Phonenumber</b><br> Hint: Enter a phone number this makes service faster. </div> <img src="templates/spacer120x1.gif" width="120" height="1" border="0" alt="----" hspace="2"> <br> <div style="color: #FF8000; font-weight: bold; font-size: 8pt; padding-bottom: 2px;">You are here:</div> __MENU_TREE__ </div> </td> </tr> <tr> <td height="12" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="12"></td> </tr> <tr> <td height="1" align="left" valign="top" bgcolor="#F5B757"><img src="templates/1x1.gif" width="1" height="1" border="0" alt=""></td> </tr> <tr> <td height="2" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td> </tr> <tr> <td width="475" align="left" valign="top"> <table cellspacing="0" cellpadding="2"> <tr> <td align="left" valign="top">{BUTTON_BACK}</td> <td width="49%">&nbsp;</td> <td align="left" valign="top">{BUTTON_CANCEL}</td> <td width="49%" align="left" valign="top">&nbsp;</td> <td align="left" valign="top">{BUTTON_NEXT}</td> </tr> </table> </td> </tr> <tr><td height="6" colspan="3" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td></tr> <tr> <td height="3" colspan="3" align="left" valign="top" bgcolor="#F5B757"><img src="templates/1x1.gif" width="1" height="3" border="0" alt=""></td> </tr> <tr> <td height="2" colspan="3" align="left" valign="top" bgcolor="#6C000E"><img src="templates/1x1.gif" width="1" height="2" border="0" alt=""></td> </tr> </table> {END_FORM} </body> </html> Index: pear/HTML_OOH_Form/examples/wizard/order/templates/personal_data.html +++ pear/HTML_OOH_Form/examples/wizard/order/templates/personal_data.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>OOH Form Rewrite: order process wizard</title> <link rel="stylesheet" href="templates/order.css" type="text/css"> <!-- Netscape cross-browser Vodoo: http://developer.netscape.com/evangelism/docs/articles/updating-dhtml-web-pages/ --> <script type="text/javascript" src="templates/ua.js"></script> <script type="text/javascript" src="templates/help.js"></script> </head> <body> {START_FORM} <table border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td height="12" colspan="5" align="left" valign="top" bgcolor="#6C000E"><img src="templates/1x1.gif" width="1" height="12" border="0" alt=""></td> </tr> <tr> <td width="49%" rowspan="10" align="left" valign="top"> &nbsp;</td> <td width="480" colspan="2" align="left" valign="top" bgcolor="#EE9C00" style="padding-top: 4px; padding-left: 2px;"> __MENU__ </td> <td width="120" align="right" valign="bottom" bgcolor="#6C000E"><img src="templates/ooh.gif" width="120" height="20" border="0" alt="OOH!"></td> <td width="49%" rowspan="10">&nbsp;</td> </tr> <tr> <td height="6" colspan="3" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td> </tr> <tr> <td width="475" align="left" valign="top" style="padding-left: 2"> <h1>New Customer: Your personal data</h1> <p> Please enter your personal data so that we can contact you. Your adress allows us to service you in case of problems. We will not pass your adress to anybody else. </p> <img src="templates/spacer470x1.gif" width="470" height="1" border="0" alt="" vspace="4"> <table border="0" cellspacing="0" cellpadding="1"> <tr> <td colspan="3" align="left" valign="top"><b>My adress</b></td> </tr> <tr><td colspan="3" height="3"><img src="1x1.gif" width="1" height="3" border="0" alt=""></td></tr> <tr> <td align="left" valign="top">First name</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {FIRST_NAME} </td> </tr> <tr> <td align="left" valign="top">Last name</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {LAST_NAME} </td> </tr> <tr> <td align="left" valign="top">E-Mail adress</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {EMAIL} </td> </tr> <tr> <td align="left" valign="top">Street</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top"> {STREET} </td> <td width="49%%" align="left" valign="top"> {STREET_NUMBER} </td> </tr> <tr> <td colspan="2" align="left" valign="top"> <!-- BEGIN error_street --> <font color="#6C000E" style="font-size: 8pt;">{ERROR_STREET}</font> <!-- END error_street --> <!-- BEGIN error_street_number --> <font color="#6C000E" style="font-size: 8pt;">{ERROR_STREET_NUMBER}</font> <!-- END error_street_number --> </td> </tr> </table> </td> </tr> <tr> <td align="left" valign="top" nowrap>Zip Code, City</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top"> {ZIP_CODE} </td> <td width="49%%" align="left" valign="top"> {CITY} </td> </tr> <tr> <td colspan="2" align="left" valign="top"> <!-- BEGIN error_zip_code --> <font color="#6C000E" style="font-size: 8pt;">{ERROR_ZIP_CODE}</font> <!-- END error_zip_code --> <!-- BEGIN error_city --> <font color="#6C000E" style="font-size: 8pt;">{ERROR_CITY}</font> <!-- END error_city --> </td> </tr> </table> </td> </tr> <tr> <td align="left" valign="top">Country</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {COUNTRY} <!-- BEGIN error_country --> <br><font color="#6C000E" style="font-size: 8pt;">{ERROR_COUNTRY}</font> <!-- END error_country --> </td> </tr> <tr> <td align="left" valign="top">Daytime phone</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {DAYTIME_PHONE} </td> </tr> <tr> <td align="left" valign="top">Evening phone</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {EVENING_PHONE} </td> </tr> </table> <img src="templates/spacer_475x1.gif" width="475" height="1" border="0" alt="-"> </td> <td width="5" rowspan="5" align="left" valign="top"><img src="templates/1x1.gif" width="5" height="1" border="0" alt=""></td> <td width="120" rowspan="5" align="left" valign="top"> <div style="color:#F5B757"> <div style="color: #FF8000; font-weight: bold; font-size: 10pt;">Help</div> <br> <div id=r"help_phone" style="position:relative; padding: 2px; font-size:8pt" onMouseOver="showHelp('phone', true);" onMouseOut="showHelp('phone', false);"> <b>Phonenumber</b><br> Hint: Enter a phone number this makes service faster. </div> <img src="templates/spacer120x1.gif" width="120" height="1" border="0" alt="----" hspace="2"> <br> <div style="color: #FF8000; font-weight: bold; font-size: 8pt; padding-bottom: 2px;">You are here:</div> __MENU_TREE__ </div> </td> </tr> <tr> <td height="12" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="12"></td> </tr> <tr> <td height="1" align="left" valign="top" bgcolor="#F5B757"><img src="templates/1x1.gif" width="1" height="1" border="0" alt=""></td> </tr> <tr> <td height="2" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td> </tr> <tr> <td width="475" align="left" valign="top"> <table cellspacing="0" cellpadding="2"> <tr> <td align="left" valign="top">&nbsp;</td> <td width="49%">&nbsp;</td> <td align="left" valign="top">{BUTTON_CANCEL}</td> <td width="49%" align="left" valign="top">&nbsp;</td> <td align="left" valign="top">{BUTTON_NEXT}</td> </tr> </table> </td> </tr> <tr><td height="6" colspan="3" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td></tr> <tr> <td height="3" colspan="3" align="left" valign="top" bgcolor="#F5B757"><img src="templates/1x1.gif" width="1" height="3" border="0" alt=""></td> </tr> <tr> <td height="2" colspan="3" align="left" valign="top" bgcolor="#6C000E"><img src="templates/1x1.gif" width="1" height="2" border="0" alt=""></td> </tr> </table> {END_FORM} </body> </html> Index: pear/HTML_OOH_Form/examples/wizard/order/templates/shipping.html +++ pear/HTML_OOH_Form/examples/wizard/order/templates/shipping.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>OOH Form Rewrite: order process wizard</title> <link rel="stylesheet" href="templates/order.css" type="text/css"> <!-- Netscape cross-browser Vodoo: http://developer.netscape.com/evangelism/docs/articles/updating-dhtml-web-pages/ --> <script type="text/javascript" src="templates/ua.js"></script> <script type="text/javascript" src="templates/help.js"></script> </head> <body> {START_FORM} <table border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td height="12" colspan="5" align="left" valign="top" bgcolor="#6C000E"><img src="templates/1x1.gif" width="1" height="12" border="0" alt=""></td> </tr> <tr> <td width="49%" rowspan="10" align="right" valign="top"> &nbsp; </td> <td width="480" colspan="2" align="left" valign="top" bgcolor="#EE9C00" style="padding-top: 4px; padding-left: 2px;"> __MENU__ </td> <td width="120" align="right" valign="bottom" bgcolor="#6C000E"><img src="templates/ooh.gif" width="120" height="20" border="0" alt="OOH!"></td> <td width="49%" rowspan="10" align="left" valign="top"> &nbsp; </td> </tr> <tr> <td height="6" colspan="3" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td> </tr> <tr> <td width="475" align="left" valign="top" style="padding-left: 2"> <h1>Shipping and gift wrapping</h1> Please choose if you want express shipping and/or gift wrapping. <img src="templates/spacer470x1.gif" width="470" height="1" border="0" alt="" vspace="4"> <b>{EXPRESS} I want express shipping.</b><br> Shipping takes usually 3-5 days. You can optionally select express shipping (extra fees: $5) to get your goods within 2 days. <img src="templates/spacer470x1_light.gif" width="470" height="1" border="0" alt="" vspace="4"> <b>{WRAPPED} Use the following gift paper to wrap my goods.</b><br> This is a free service for you. Select the paper you like. <table cellspacing="4" cellpadding="4"> <tr> <td align="left" valign="top">{PAPER1} <img src="templates/paper1.gif" width="30" height="30" border="0" alt="blue paper" align="top"></td> <td align="left" valign="top">{PAPER2} <img src="templates/paper2.gif" width="30" height="30" border="0" alt="green paper" align="top"></td> <td align="left" valign="top">{PAPER3} <img src="templates/paper3.gif" width="30" height="30" border="0" alt="orange paper" align="top"></td> </tr> </table> <img src="templates/spacer470x1_light.gif" width="470" height="1" border="0" alt="" vspace="4"> <b>{CARD} Add a gift card to my present.</b><br> Fill out the textbox to send some greetings with your present.<br> {MESSAGE} <!-- BEGIN error_message --> <br><font color="#6C000E" style="font-size: 8pt;">{ERROR_CITY}</font> <!-- END error_message --> </td> <td width="5" rowspan="5" align="left" valign="top"><img src="templates/1x1.gif" width="5" height="1" border="0" alt=""></td> <td width="120" rowspan="5" align="left" valign="top"> <div style="color:#F5B757";"> <div style="color: #6C000E; font-weight: bold; font-size: 10pt;">Help</div> <br> <div id="help_phone" style="position:relative; padding: 2px; font-size:8pt" onMouseOver="showHelp('phone', true);" onMouseOut="showHelp('phone', false);"> <b>Phonenumber</b><br> Hint: Enter a phone number this makes service faster. </div> <img src="templates/spacer120x1.gif" width="120" height="1" border="0" alt="----" hspace="2"> <br> <div style="color: #FF8000; font-weight: bold; font-size: 8pt; padding-bottom: 2px;">You are here:</div> __MENU_TREE__ </div> </td> </tr> <tr> <td height="12" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="12"></td> </tr> <tr> <td height="1" align="left" valign="top" bgcolor="#F5B757"><img src="templates/1x1.gif" width="1" height="1" border="0" alt=""></td> </tr> <tr> <td height="2" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td> </tr> <tr> <td width="475" align="left" valign="top"> <table cellspacing="0" cellpadding="2"> <tr> <td align="left" valign="top">{BUTTON_BACK}</td> <td width="49%">&nbsp;</td> <td align="left" valign="top">{BUTTON_CANCEL}</td> <td width="49%" align="left" valign="top">&nbsp;</td> <td align="left" valign="top">{BUTTON_FINISH}</td> </tr> </table> </td> </tr> <tr><td height="6" colspan="3" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td></tr> <tr> <td height="3" colspan="3" align="left" valign="top" bgcolor="#F5B757"><img src="templates/1x1.gif" width="1" height="3" border="0" alt=""></td> </tr> <tr> <td height="2" colspan="3" align="left" valign="top" bgcolor="#6C000E"><img src="templates/1x1.gif" width="1" height="2" border="0" alt=""></td> </tr> </table> {END_FORM} </body> </html> Index: pear/HTML_OOH_Form/examples/wizard/order/templates/ua.js +++ pear/HTML_OOH_Form/examples/wizard/order/templates/ua.js // ua.js - Detect Browser // Requires JavaScript 1.1 /* The contents of this file are subject to the Netscape Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/NPL/ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. The Initial Developer of the Original Code is Bob Clary. Contributor(s): Bob Clary, Original Work, Copyright 149%9-2000 Bob Clary, Netscape Communications, Copyright 2001 Alternatively, the contents of this file may be used under the terms of the GNU Public License (the "GPL"), in which case the provisions of the GPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the GPL and not to allow others to use your version of this file under the NPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the GPL. If you do not delete the provisions above, a recipient may use your version of this file under either the NPL or the GPL. */ // work around bug in xpcdom Mozilla 0.9.1 window.saveNavigator = window.navigator; // Handy functions function noop() {} function noerror() { return true; } function defaultOnError(msg, url, line) { // customize this for your site if (top.location.href.indexOf('_files/errors/') == -1) top.location = '/evangelism/xbProjects/_files/errors/index.html?msg=' + escape(msg) + '&url=' + escape(url) + '&line=' + escape(line); } // Display Error page... // XXX: more work to be done here // function reportError(message) { // customize this for your site if (top.location.href.indexOf('_files/errors/') == -1) top.location = '/evangelism/xbProjects/_files/errors/index.html?msg=' + escape(message); } function pageRequires(cond, msg, redirectTo) { if (!cond) { msg = 'This page requires ' + msg; top.location = redirectTo + '?msg=' + escape(msg); } // return cond so can use in <A> onclick handlers to exclude browsers // from pages they do not support. return cond; } function detectBrowser() { var oldOnError = window.onerror; var element = null; window.onerror = defaultOnError; navigator.OS = ''; navigator.version = 0; navigator.org = ''; navigator.family = ''; var platform; if (typeof(window.navigator.platform) != 'undefined') { platform = window.navigator.platform.toLowerCase(); if (platform.indexOf('win') != -1) navigator.OS = 'win'; else if (platform.indexOf('mac') != -1) navigator.OS = 'mac'; else if (platform.indexOf('unix') != -1 || platform.indexOf('linux') != -1 || platform.indexOf('sun') != -1) navigator.OS = 'nix'; } var i = 0; var ua = window.navigator.userAgent.toLowerCase(); if (ua.indexOf('opera') != -1) { i = ua.indexOf('opera'); navigator.family = 'opera'; navigator.org = 'opera'; navigator.version = parseFloat('0' + ua.substr(i+6), 10); } else if ((i = ua.indexOf('msie')) != -1) { navigator.org = 'microsoft'; navigator.version = parseFloat('0' + ua.substr(i+5), 10); if (navigator.version < 4) navigator.family = 'ie3'; else navigator.family = 'ie4' } else if (typeof(window.controllers) != 'undefined' && typeof(window.locationbar) != 'undefined') { i = ua.lastIndexOf('/') navigator.version = parseFloat('0' + ua.substr(i+1), 10); navigator.family = 'gecko'; if (ua.indexOf('netscape') != -1) navigator.org = 'netscape'; else if (ua.indexOf('compuserve') != -1) navigator.org = 'compuserve'; else navigator.org = 'mozilla'; } else if ((ua.indexOf('mozilla') !=-1) && (ua.indexOf('spoofer')==-1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera')==-1)&& (ua.indexOf('webtv')==-1) && (ua.indexOf('hotjava')==-1)) { var is_major = parseFloat(navigator.appVersion); if (is_major < 4) navigator.version = is_major; else { i = ua.lastIndexOf('/') navigator.version = parseFloat('0' + ua.substr(i+1), 10); } navigator.org = 'netscape'; navigator.family = 'nn' + parseInt(navigator.appVersion); } else if ((i = ua.indexOf('aol')) != -1 ) { // aol navigator.family = 'aol'; navigator.org = 'aol'; navigator.version = parseFloat('0' + ua.substr(i+4), 10); } navigator.DOMCORE1 = (typeof(document.getElementsByTagName) != 'undefined' && typeof(document.createElement) != 'undefined'); navigator.DOMCORE2 = (navigator.DOMCORE1 && typeof(document.getElementById) != 'undefined' && typeof(document.createElementNS) != 'undefined'); navigator.DOMHTML = (navigator.DOMCORE1 && typeof(document.getElementById) != 'undefined'); navigator.DOMCSS1 = ( (navigator.family == 'gecko') || (navigator.family == 'ie4') ); navigator.DOMCSS2 = false; if (navigator.DOMCORE1) { element = document.createElement('p'); navigator.DOMCSS2 = (typeof(element.style) == 'object'); } navigator.DOMEVENTS = (typeof(document.createEvent) != 'undefined'); window.onerror = oldOnError; } detectBrowser(); Index: pear/HTML_OOH_Form/examples/wizard/order/templates/update_adress.html +++ pear/HTML_OOH_Form/examples/wizard/order/templates/update_adress.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>OOH Form Rewrite: order process wizard</title> <link rel="stylesheet" href="templates/order.css" type="text/css"> <!-- Netscape cross-browser Vodoo: http://developer.netscape.com/evangelism/docs/articles/updating-dhtml-web-pages/ --> <script type="text/javascript" src="templates/ua.js"></script> <script type="text/javascript" src="templates/help.js"></script> </head> <body> {START_FORM} <table border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td height="12" colspan="5" align="left" valign="top" bgcolor="#6C000E"><img src="templates/1x1.gif" width="1" height="12" border="0" alt=""></td> </tr> <tr> <td width="49%" rowspan="10">&nbsp;</td> <td width="480" colspan="2" align="left" valign="top" bgcolor="#EE9C00" style="padding-top: 4px; padding-left: 2px;"> __MENU__ </td> <td width="120" align="right" valign="bottom" bgcolor="#6C000E"><img src="templates/ooh.gif" width="120" height="20" border="0" alt="OOH!"></td> <td width="49%" rowspan="10">&nbsp;</td> </tr> <tr> <td height="6" colspan="3" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td> </tr> <tr> <td width="475" align="left" valign="top" style="padding-left: 2"> <h1>Adress Update</h1> Please update the address. Press "save" to save your changes. Use "cancel" to get back to the previous page without saving any changes. <img src="templates/spacer470x1.gif" width="470" height="1" border="0" alt="" vspace="4"> <table border="0" cellspacing="0" cellpadding="1"> <tr> <td align="left" valign="top">First name</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {FIRST_NAME} </td> </tr> <tr> <td align="left" valign="top">Last name</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {LAST_NAME} <!-- BEGIN error_last_name --> <br><font color="#6C000E" style="font-size: 8pt;">{ERROR_LAST_NAME}</font> <!-- END error_last_name --> </td> </tr> <tr> <td align="left" valign="top">Street</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top"> {STREET} </td> <td width="99%" align="left" valign="top"> {STREET_NUMBER} </td> </tr> <tr> <td colspan="2" align="left" valign="top"> <!-- BEGIN error_street --> <font color="#6C000E" style="font-size: 8pt;">{ERROR_STREET}</font> <!-- END error_street --> <!-- BEGIN error_street_number --> <font color="#6C000E" style="font-size: 8pt;">{ERROR_STREET_NUMBER}</font> <!-- END error_street_number --> </td> </tr> </table> </td> </tr> <tr> <td align="left" valign="top" nowrap>Zip Code, City</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top"> {ZIP_CODE} </td> <td width="99%" align="left" valign="top"> {CITY} </td> </tr> <tr> <td colspan="2" align="left" valign="top"> <!-- BEGIN error_city --> <font color="#6C000E" style="font-size: 8pt;">{ERROR_CITY}</font> <!-- END error_city --> <!-- BEGIN error_zip_code --> <font color="#6C000E" style="font-size: 8pt;">{ERROR_ZIP_CODE}</font> <!-- END error_zip_code --> </td> </tr> </table> </td> </tr> <tr> <td align="left" valign="top">Country</td> <td align="left" valign="top"><img src="1x1.gif" width="2" height="1" border="0" alt=""></td> <td align="left" valign="top"> {COUNTRY} <!-- BEGIN error_country --> <br><font color="#6C000E" style="font-size: 8pt;">{ERROR_COUNTRY}</font> <!-- END error_country --> </td> </tr> </table> <img src="templates/spacer_475x1.gif" width="475" height="1" border="0" alt=""> </td> <td width="5" rowspan="5" align="left" valign="top"><img src="templates/1x1.gif" width="5" height="1" border="0" alt=""></td> <td width="120" rowspan="5" align="left" valign="top"> <div style="color:#F5B757";"> <div style="color: #6C000E; font-weight: bold; font-size: 10pt;">Help</div> <br> <div id="help_phone" style="position:relative; padding: 2px; font-size:8pt" onMouseOver="showHelp('phone', true);" onMouseOut="showHelp('phone', false);"> <b>Phonenumber</b><br> Hint: Enter a phone number this makes service faster. </div> <img src="templates/spacer120x1.gif" width="120" height="1" border="0" alt="----" hspace="2"> <br> <div style="color: #FF8000; font-weight: bold; font-size: 8pt; padding-bottom: 2px;">You are here:</div> __MENU_TREE__ </div> </td> </tr> <tr> <td height="12" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="12"></td> </tr> <tr> <td height="1" align="left" valign="top" bgcolor="#F5B757"><img src="templates/1x1.gif" width="1" height="1" border="0" alt=""></td> </tr> <tr> <td height="2" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td> </tr> <tr> <td width="475" align="left" valign="top"> <table cellspacing="0" cellpadding="2"> <tr> <td align="left" valign="top">&nbsp;</td> <td width="49%">&nbsp;</td> <td align="left" valign="top"> {DELETE}&nbsp;{CANCEL}&nbsp;{SAVE}</td> <td width="49%" align="left" valign="top">&nbsp;</td> <td align="left" valign="top">&nbsp;</td> </tr> </table> </td> </tr> <tr><td height="6" colspan="3" align="left" valign="top"><img src="templates/1x1.gif" width="1" border="0" alt="" height="6"></td></tr> <tr> <td height="3" colspan="3" align="left" valign="top" bgcolor="#F5B757"><img src="templates/1x1.gif" width="1" height="3" border="0" alt=""></td> </tr> <tr> <td height="2" colspan="3" align="left" valign="top" bgcolor="#6C000E"><img src="templates/1x1.gif" width="1" height="2" border="0" alt=""></td> </tr> </table> {END_FORM} </body> </html> Index: pear/HTML_OOH_Form/examples/wizard/order/xml/delivery_adress.xml +++ pear/HTML_OOH_Form/examples/wizard/order/xml/delivery_adress.xml <?xml version="1.0" encoding="UTF-8"?> <form> <defaults> <text size="20" /> <image border="0"/> </defaults> <elements nameprefix="delivery_"> <text name="first_name" /> <text name="last_name"> <validation> <length min="2" max="127">Please enter a last name.</length> </validation> </text> <text name="street" size="14"> <validation> <length min="3" max="127">Please enter the street name.</length> </validation> </text> <text name="street_number" size="5"/> <text name="zip_code" size="6"> <validation> <length min="1" max="127">Please enter the Zip Code</length> </validation> </text> <text name="city" size="13"> <validation> <length min="2" max="127">Please enter a city.</length> </validation> </text> <text name="country"> Germany <validation> <length min="2" max="127">Please enter a country.</length> </validation> </text> <checkbox name="invoice_adr" checked="true">equal_delivery</checkbox> </elements> </form> Index: pear/HTML_OOH_Form/examples/wizard/order/xml/invoice_adress.xml +++ pear/HTML_OOH_Form/examples/wizard/order/xml/invoice_adress.xml <?xml version="1.0" encoding="UTF-8"?> <form> <defaults> <text size="20" /> <image border="0"/> </defaults> <elements nameprefix="invoice_"> <text name="first_name" /> <text name="last_name"> <validation> <length min="2" max="127">Please enter a last name.</length> </validation> </text> <text name="street" size="14"> <validation> <length min="3" max="127">Please enter the street name.</length> </validation> </text> <text name="street_number" size="5"/> <text name="zip_code" size="6"> <validation> <length min="1" max="127">Please enter the Zip Code</length> </validation> </text> <text name="city" size="13"> <validation> <length min="2" max="127">Please enter a city.</length> </validation> </text> <text name="country"> Germany <validation> <length min="2" max="127">Please enter a country.</length> </validation> </text> </elements> </form> Index: pear/HTML_OOH_Form/examples/wizard/order/xml/login.xml +++ pear/HTML_OOH_Form/examples/wizard/order/xml/login.xml <?xml version="1.0" encoding="UTF-8"?> <form> <defaults> <text size="20" /> <image border="0"/> </defaults> <elements> <radio name="status" elname="registered"> registered <html>onFocus="showHelp('registration', true)"</html> </radio> <radio name="status" elname="unregistered" checked="true"> unregistered <html>onFocus="showHelp('registration', true)"</html> <validation> <phpfunction callback="true">login</phpfunction> </validation> </radio> <text name="username" /> <password name="password"> <html>onFocus="showHelp('password', true)"</html> </password> <text name="first_name"> <validation> <length min="2" max="127">Please enter your first name.</length> </validation> </text> <text name="last_name"> <validation> <length min="2" max="127">Please enter your last name.</length> </validation> </text> <text name="email"> <html>onFocus="showHelp('email', true)"</html> <validation> <phpfunction callback="true">callback</phpfunction> <regexp reg="[\.a-z0-9-_]+@[a-z0-9-_]+\.[a-z]{2,3}" icase="true">The email is unrecognizable.</regexp> </validation> </text> </elements> </form> Index: pear/HTML_OOH_Form/examples/wizard/order/xml/payment.xml +++ pear/HTML_OOH_Form/examples/wizard/order/xml/payment.xml <?xml version="1.0" encoding="UTF-8"?> <form> <defaults> <text size="20" /> <image border="0"/> </defaults> <elements> <radio name="method" elname="credit_card">credit card</radio> <radio name="method" elname="purchase" checked="true"> purchase order <validation> <phpfunction callback="true">payment</phpfunction> </validation> </radio> <select name="card_type"> <options> <option value="Visa">Visa</option> <option value="Master">Master Card</option> <option value="Amex">American Express</option> </options> </select> <text name="holder_name"> <validation> <length min="4" max="127">Please enter the card holder name.</length> </validation> </text> <text name="card_number"> <validation> <regexp reg="[0-9]{15}">Enter your 15 numbers long credit card. Do not insert spaces.</regexp> </validation> </text> <date name="expiration_date" preload="true" format="mY"> <limits> <yearlong min="2001" max="2009" /> </limits> </date> </elements> </form> Index: pear/HTML_OOH_Form/examples/wizard/order/xml/personal_data.xml +++ pear/HTML_OOH_Form/examples/wizard/order/xml/personal_data.xml <?xml version="1.0" encoding="UTF-8"?> <form> <defaults> <text size="20" /> <image border="0"/> </defaults> <elements> <text name="first_name" frozen="true"> <validation> <length min="2" max="127">Please enter your first name.</length> </validation> </text> <text name="last_name" frozen="true"> <validation> <length min="2" max="127">Please enter your last name.</length> </validation> </text> <text name="email" frozen="true"> <validation> <regexp reg="[a-z0-9-_]*\.[a-z0-9-_]+@[a-z0-9-_]+\.[a-z]{2,3}" icase="true">The email is unrecognizable.</regexp> </validation> </text> <text name="street" size="14"> <validation> <length min="3" max="127">Please enter the street name.</length> </validation> </text> <text name="street_number" size="5"/> <text name="zip_code" size="6"> <validation> <length min="1" max="127">Please enter the Zip Code</length> </validation> </text> <text name="city" size="13"> <validation> <length min="2" max="127">Please enter the city you life in.</length> </validation> </text> <text name="country"> Germany <validation> <length min="2" max="127">Please enter the country.</length> </validation> </text> <text name="daytime_phone"> <html>onFocus="showHelp('phone', true)"</html> </text> <text name="evening_phone"> <html>onFocus="showHelp('phone', true)"</html> </text> </elements> </form> Index: pear/HTML_OOH_Form/examples/wizard/order/xml/shipping.xml +++ pear/HTML_OOH_Form/examples/wizard/order/xml/shipping.xml <?xml version="1.0" encoding="UTF-8"?> <form> <defaults> <text size="20" /> </defaults> <elements> <checkbox name="express" checked="false" /> <checkbox name="wrapped" checked="false"> wrapped <validation> <phpfunction callback="true">paper</phpfunction> </validation> </checkbox> <radio name="paper" elname="paper1">1</radio> <radio name="paper" elname="paper2">2</radio> <radio name="paper" elname="paper3">3</radio> <checkbox name="card" checked="false"> card <validation> <phpfunction callback="true">card</phpfunction> </validation> </checkbox> <textarea name="message" cols="40" rows="3" /> </elements> </form> Index: pear/HTML_OOH_Form/examples/wizard/order/xml/update_adress.xml +++ pear/HTML_OOH_Form/examples/wizard/order/xml/update_adress.xml <?xml version="1.0" encoding="UTF-8"?> <form> <defaults> <text size="20" /> <image border="0"/> </defaults> <elements nameprefix="adress_update_"> <text name="first_name" /> <text name="last_name"> <validation> <length min="2" max="127">Please enter a last name.</length> </validation> </text> <text name="street" size="14"> <validation> <length min="3" max="127">Please enter the street name.</length> </validation> </text> <text name="street_number" size="5"/> <text name="zip_code" size="6"> <validation> <length min="1" max="127">Please enter the Zip Code</length> </validation> </text> <text name="city" size="13"> <validation> <length min="2" max="127">Please enter a city.</length> </validation> </text> <text name="country"> Germany <validation> <length min="2" max="127">Please enter a country.</length> </validation> </text> <image name="save">templates/save.gif</image> <image name="delete">templates/delete.gif</image> <image name="cancel">templates/cancel.gif</image> </elements> </form>
« previous php.pear.cvs (#1223) next »