| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
include_once 'patExampleGen/prepend.php'; |
|---|
| 19 |
$exampleGen->displayHead( 'Example' ); |
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
require_once $neededFiles['patForms']; |
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
require_once $neededFiles['patErrorManager']; |
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
$elementsDefinition = array( |
|---|
| 37 |
'mammalians' => array( |
|---|
| 38 |
'type' => 'Pool', |
|---|
| 39 |
'attributes' => array( |
|---|
| 40 |
'label' => 'Mammalians', |
|---|
| 41 |
'title' => 'Mammalians', |
|---|
| 42 |
'description' => 'List of mammals', |
|---|
| 43 |
'size' => '10', |
|---|
| 44 |
'style' => 'width:150px;', |
|---|
| 45 |
'class' => 'pool', |
|---|
| 46 |
'candidates' => array( |
|---|
| 47 |
|
|---|
| 48 |
'label' => 'Ant', |
|---|
| 49 |
'value' => 'ant', |
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
'label' => 'Bee', |
|---|
| 53 |
'value' => 'bee', |
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 |
'label' => 'Dog', |
|---|
| 57 |
'value' => 'deg', |
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 |
'label' => 'Cat', |
|---|
| 61 |
'value' => 'cat', |
|---|
| 62 |
|
|---|
| 63 |
|
|---|
| 64 |
'label' => 'Shark', |
|---|
| 65 |
'value' => 'shark', |
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
'label' => 'Whale', |
|---|
| 69 |
'value' => 'whale', |
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
'candidatetitle' => 'Animals', |
|---|
| 73 |
'membertitle' => 'Mammalians', |
|---|
| 74 |
'titleclass' => 'pooltitle', |
|---|
| 75 |
'tooladd' => 'add mammalian', |
|---|
| 76 |
'toolremove' => 'remove animal', |
|---|
| 77 |
'toolclass' => 'pooltool', |
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
'freaks' => array( |
|---|
| 81 |
'type' => 'Pool', |
|---|
| 82 |
'attributes' => array( |
|---|
| 83 |
'label' => 'Freaks', |
|---|
| 84 |
'title' => 'Freaks', |
|---|
| 85 |
'description' => 'List of freaks', |
|---|
| 86 |
'class' => 'pool', |
|---|
| 87 |
'style' => 'width:150px;', |
|---|
| 88 |
'candidates' => array( |
|---|
| 89 |
|
|---|
| 90 |
'label' => 'Sebastian Bergmann', |
|---|
| 91 |
'value' => 1001, |
|---|
| 92 |
|
|---|
| 93 |
|
|---|
| 94 |
'label' => 'Alexander Wirtz', |
|---|
| 95 |
'value' => 1002, |
|---|
| 96 |
|
|---|
| 97 |
|
|---|
| 98 |
'label' => 'Paul Hammant', |
|---|
| 99 |
'value' => 1003, |
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 |
'label' => 'Björn Schotte', |
|---|
| 103 |
'value' => 1004, |
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 |
'label' => 'Tobias Schlitt ', |
|---|
| 107 |
'value' => 2004, |
|---|
| 108 |
|
|---|
| 109 |
|
|---|
| 110 |
'label' => 'George Schlossnagl', |
|---|
| 111 |
'value' => 3001, |
|---|
| 112 |
|
|---|
| 113 |
|
|---|
| 114 |
'label' => 'Christian Wenz', |
|---|
| 115 |
'value' => 4001, |
|---|
| 116 |
|
|---|
| 117 |
|
|---|
| 118 |
'label' => 'Marc Pohl', |
|---|
| 119 |
'value' => 5001, |
|---|
| 120 |
|
|---|
| 121 |
|
|---|
| 122 |
'label' => 'Mark Britton', |
|---|
| 123 |
'value' => 5002, |
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 |
'label' => 'Peter Petermann', |
|---|
| 127 |
'value' => 5003, |
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| 130 |
'label' => 'Wilko Miletic', |
|---|
| 131 |
'value' => 5004, |
|---|
| 132 |
|
|---|
| 133 |
|
|---|
| 134 |
'label' => 'Tobias Hauser', |
|---|
| 135 |
'value' => 5005, |
|---|
| 136 |
|
|---|
| 137 |
|
|---|
| 138 |
'label' => 'Geir Torstein Kristiansen', |
|---|
| 139 |
'value' => 5006, |
|---|
| 140 |
|
|---|
| 141 |
|
|---|
| 142 |
'label' => 'Jan Kneschke', |
|---|
| 143 |
'value' => 5007, |
|---|
| 144 |
|
|---|
| 145 |
|
|---|
| 146 |
'candidatetitle' => 'people', |
|---|
| 147 |
'membertitle' => 'freaks', |
|---|
| 148 |
'titleclass' => 'pooltitle', |
|---|
| 149 |
|
|---|
| 150 |
|
|---|
| 151 |
|
|---|
| 152 |
|
|---|
| 153 |
|
|---|
| 154 |
$form =& patForms::createForm( $elementsDefinition, array( 'name' => 'myForm' ) ); |
|---|
| 155 |
|
|---|
| 156 |
|
|---|
| 157 |
$renderer =& patForms::createRenderer( "Array" ); |
|---|
| 158 |
|
|---|
| 159 |
|
|---|
| 160 |
$form->setRenderer( $renderer ); |
|---|
| 161 |
|
|---|
| 162 |
|
|---|
| 163 |
$form->setAutoValidate( 'save' ); |
|---|
| 164 |
|
|---|
| 165 |
|
|---|
| 166 |
$elements = $form->renderForm(); |
|---|
| 167 |
|
|---|
| 168 |
|
|---|
| 169 |
|
|---|
| 170 |
|
|---|
| 171 |
|
|---|
| 172 |
|
|---|
| 173 |
|
|---|
| 174 |
if( $form->isSubmitted() ) |
|---|
| 175 |
|
|---|
| 176 |
displayErrors( $form ); |
|---|
| 177 |
} |
|---|
| 178 |
|
|---|
| 179 |
|
|---|
| 180 |
displayForm( $form, $elements ); |
|---|
| 181 |
|
|---|
| 182 |
|
|---|
| 183 |
|
|---|
| 184 |
|
|---|
| 185 |
|
|---|
| 186 |
$exampleGen->displayFooter(); |
|---|
| 187 |
?> |
|---|