| 1 | <?php | 
| 2 |  | 
| 3 | /** | 
| 4 | * This example illustrates the basics of the | 
| 5 | * FormProcessing engine for phphtmllib. | 
| 6 | * | 
| 7 | * | 
| 8 | * $Id: wizard1.php,v 1.2 2003/07/02 22:11:38 hemna Exp $ | 
| 9 | * | 
| 10 | * @author Walter A. Boring IV <waboring@buildabetterweb.com> | 
| 11 | * @package phpHtmlLib | 
| 12 | * @subpackage form-examples | 
| 13 | * @version 2.2.0 | 
| 14 | * | 
| 15 | */ | 
| 16 |  | 
| 17 | /** | 
| 18 | * Include the phphtmllib libraries | 
| 19 | * | 
| 20 | */ | 
| 21 | include("includes.inc"); | 
| 22 |  | 
| 23 | /** | 
| 24 | * Include the Form Processing objects | 
| 25 | * | 
| 26 | */ | 
| 27 | include_once($phphtmllib."/form/includes.inc"); | 
| 28 | include_once($phphtmllib."/form/FormWizard.inc"); | 
| 29 |  | 
| 30 | include_once("_steps.inc"); | 
| 31 |  | 
| 32 | function ddd( $var ) { | 
| 33 | echo "<xmp>\n"; | 
| 34 | var_dump( $var ); | 
| 35 | echo "</xmp>\n"; | 
| 36 | } | 
| 37 |  | 
| 38 |  | 
| 39 | //use the class we defined from | 
| 40 | //Example 3. | 
| 41 | include_once("MyLayoutPage.inc"); | 
| 42 |  | 
| 43 | //session_start(); | 
| 44 |  | 
| 45 | /** | 
| 46 | * A simple Page Layout object child. | 
| 47 | * this came from Example 3. | 
| 48 | * | 
| 49 | * @author Walter A. Boring IV <waboring@buildabetterweb.com> | 
| 50 | * @package phpHtmlLib | 
| 51 | * @subpackage form-examples | 
| 52 | */ | 
| 53 | class Form1Page extends MyLayoutPage { | 
| 54 |  | 
| 55 | function content_block() { | 
| 56 | //build the FormProcessor, and add the | 
| 57 | //Form content object that the FormProcessor | 
| 58 | //will use.  Make the width of the form 600 | 
| 59 | return new MyWizard(); | 
| 60 | } | 
| 61 | } | 
| 62 |  | 
| 63 | class MyWizard extends FormWizard { | 
| 64 | function user_setup() { | 
| 65 | $this->add_step( "Hemna", "This is a long description of ". | 
| 66 | "what the user should do.  Like do this step ". | 
| 67 | "you loser!  Just fill out the form asswhipe!", | 
| 68 | "", new Step1("Hemna", "", 600) ); | 
| 69 | $this->add_step( "Dude", "This is some dude step", "", | 
| 70 | new Step2("Dude", "", 600) ); | 
| 71 | $this->add_step( "Settings", "Use this step to configure your settings.", "", | 
| 72 | new Step3("My Settings", "", 600) ); | 
| 73 | } | 
| 74 | } | 
| 75 |  | 
| 76 |  | 
| 77 |  | 
| 78 | $page = new Form1Page("Form Example 1"); | 
| 79 | print $page->render(); | 
| 80 |  | 
| 81 |  | 
| 82 | ?> |