require_once('Pearified/DB/DataObject/FormBuilder/Frontend.php'); $frontend = new DB_DataObject_FormBuilder_Frontend(); $frontend->display();
Query parameters are set manually in each controller and each sub-controller has its parent controller's parameters merged into it. This allows sub-controllers to
First and foremost, any FormBuilder options set up the the DataObjects will be automatically used when creating editing forms for the records.
To set the names of the tables in the table list to something other than the bare table name, set the fb_formHeaderText property in the DataObject classes or the formHeaderText option in the formbuilder options below.
You can override the FormBuilder options in any table overall for the entire package.
$options =& PEAR::getStaticProperty('db_dataobject_formbuilder_frontend', 'options'); $options = array( 'tableOptions' => array( 'movie' => array( 'fbOptions' => array( 'fieldsToRender' => array('title', 'genre_id', 'enumTest'), 'userEditableFields' => array('title'), 'fieldsRequired' => array('enumTest'), 'selectAddEmpty' => array('enumTest'), 'excludeFromAutoRules' => array('genre_id'), ), ), ), );
You can also set these options per-controller:
$options =& PEAR::getStaticProperty('db_dataobject_formbuilder_frontend_editrecord', 'options'); $options = array( 'tableOptions' => array( 'movie' => array( 'fbOptions' => array( 'fieldsToRender' => array('title', 'genre_id', 'notes'), 'userEditableFields' => array('title', 'genre_id'), ), ), ), );
Any Controller option can be set either globally in the controller options or in the table options for a specific table. These options can also be set in either the Controller's specific options or in the main controller's options. Options set in the current controller's options array take precedence over options set in the main controller. Options set in tableOptions take precedence over global controller options.
These options are for the main Frontend controller.
'regenerate' allows you to turn off the schema regeneration feature.
$options =& PEAR::getStaticProperty('db_dataobject_formbuilder_frontend', 'options'); $options = array('regenerate' => false);
'linkToTables' allows you to turn off the display of tables the current table links to (affects ShowTable and EditRecord). 'linkFromTables' allows you to turn off the display of tables the current table is linked from (affects ShowTable and EditRecord).
$options =& PEAR::getStaticProperty('db_dataobject_formbuilder_frontend', 'options'); $options = array('linkFromTables' => false, 'linkToTables' => false);
You can also set 'linkFromTables' and 'linkToTables' to arrays to list the tables that are allowed to show up.
$options =& PEAR::getStaticProperty('db_dataobject_formbuilder_frontend', 'options'); $options = array('linkFromTables' => array('movie', 'music'), 'linkToTables' => array('genre'));
'tablesToList' is an array of tables which will be listed.
The ShowTable also has four extra options which can be set per-table. 'fields' can be set to set the fields to be displayed as columns in the DataGrid. 'edit' can be set to false to remove record editing. 'delete' can be set to false to remove record deletion. 'add' can be set to false to remove record addition.
$options =& PEAR::getStaticProperty('db_dataobject_formbuilder_frontend_showtable', 'options'); $options = array( 'tableOptions' => array( 'movie' => array( 'edit' => false, 'fields' => array('title', 'genre_id', 'notes'), ), 'genre' => array( 'delete' => false, 'add' => false, ), ), );
'linkToTables' and 'linkFromTables' can also be set here (see the Frontend configuration options). If set for this controller, it will override any setting set for Frontend.
You can set 'deleteRecursive' to false to disallow recursive deletion.
$options =& PEAR::getStaticProperty('db_dataobject_formbuilder_frontend_deleterecords', 'options'); $options = array( //disables for all tables 'deleteRecursive' => false, 'tableOptions' => array( 'movie' => array( //enables for only movie table 'deleteRecursive' => true, ), ), );
'linkToTables' and 'linkFromTables' can also be set here (see the Frontend configuration options). If set for this controller, it will override any setting set for Frontend.
Setting 'createAnother' to false will turn off the ability to create multiple records in a row.