setSubmitted(true); $form->setNamespace($namespace); $renderer = patForms::createRenderer("Array"); $form->setRenderer($renderer); return $form; } protected function stripElementId($element) { return preg_replace('!id="pfo[a-zA-Z0-9]*" ?!', '', $element); } protected function assertSameVerbose($expected, $result) { try { $this->assertTrue($expected == $result); } catch(Exception $e) { $lf = php_sapi_name() == 'cli' ? "\n" : '
'; echo $lf . $lf; echo 'expected was: ' . htmlentities($expected) . $lf; echo 'result was: ' . htmlentities($result) . $lf . $lf; throw($e); } } static private $definitions = array( 'default' => array( 'name' => array('type' => 'String'), ), 'combobox' => array( 'area' => array( 'type' => 'Combobox', 'attributes' => array( 'values' => array( array( 'label' => 'Very pretty area', 'value' => 'a01', ), ), ), ), ), 'date' => array( 'date' => array( 'type' => 'Date', 'attributes' => array( 'display' => 'yes', 'edit' => 'yes', 'label' => 'date', 'presets' => 'no', 'dateformat' => 'Y-m-d' ), ), ), 'enum' => array( 'area' => array( 'type' => 'Enum', 'attributes' => array( 'values' => array( array( 'label' => 'Very pretty area', 'value' => 'a01', ), ), ), ), ), 'group' => array( 'loginOptions' => array( 'type' => 'Group', 'attributes' => array( 'display' => 'yes', ), ), ), 'hidden' => array( 'area' => array( 'type' => 'Hidden', 'attributes' => array( 'default' => 'a01', ), ), ), 'pool' => array( 'mammalians' => array( 'type' => 'Pool', 'attributes' => array( 'candidates' => array( array( 'label' => 'Ant', 'value' => 'and', ), array( 'label' => 'Bee', 'value' => 'bee', ), ), ), ), ), 'radio' => array( 'username' => array( 'type' => 'Radio', 'attributes' => array( 'clicklabel' => 'yes', 'value' => '51', 'label' => 'Area 51', ), ), ), 'radiogroup' => array( 'username' => array( 'type' => 'RadioGroup', 'attributes' => array( 'clicklabel' => 'yes', 'default' => 'a03', 'values' => array( array( 'label' => 'Very pretty area', 'value' => 'a01', ), array( 'label' => 'No-nonsense area', 'value' => 'a02', ), ), ), ), ), 'set' => array( 'wishlist' => array( 'type' => 'Set', 'attributes' => array( 'values' => array( array( 'label' => 'More patForms elements', 'value' => 'w1', ), array( 'label' => 'A tank', 'value' => 'w7' ), ), ), ), ), 'switch' => array( 'enable' => array( 'type' => 'Switch', 'attributes' => array( 'value' => 'yes', ), ), ), ); } ?>