* @license LGPL, see license.txt for details * @link http://www.php-tools.net */ /** * Main examples prepend file, needed *only* for the examples framework! */ include_once 'patExampleGen/prepend.php'; $exampleGen->displayHead( 'Example' ); // EXAMPLE START ------------------------------------------------------ /** * main patForms class */ require_once $neededFiles['patForms']; /** * patForms parser class */ require_once $neededFiles['patForms_Parser']; /** * patErrorManager class */ require_once $neededFiles['patErrorManager']; /** * localisation stuff */ require_once $neededFiles['patI18n_configure']; // needed options patForms_Parser::setNamespace( "patForms" ); patForms_Parser::setCacheDir( "cache" ); // create the form $form =& patForms_Parser::createFormFromTemplate( 'SimpleRenderer', 'templates/example_parser_datasource.fhtml', 'templates/example_parser_datasource.html' ); // use auto-validation $form->setAutoValidate( 'save' ); // render the content $content = $form->renderForm(); // check the form and display error messages if any if( $form->isSubmitted() ) { displayErrors( $form ); // see the patExampleGen/customFunctions.php file } // now display the form echo $content; /** * Example datasource class for the areas drop-down selector * * @access public * @package patForms * @subpackage Examples * @author Stephan Schmidt */ class areasDatasource { /** * Method used to retrieve the list of areas for the areas drop-down list * * @access public * @param string $elementName The name of the patForms element * @return array $values The values list for the element */ function getAreasList( $elementName ) { return array( array( 'value' => '', 'label' => 'Please select an area...', ), array( 'value' => '1', 'label' => 'Secluded area', ), array( 'value' => '2', 'label' => 'Hidden area', ), array( 'value' => '3', 'label' => 'Secret area', ), array( 'value' => '4', 'label' => 'Immaterial area', ), ); } } // EXAMPLE END ------------------------------------------------------ $exampleGen->displayFooter(); ?>