function init($name, $method = null, $action = null) { parent::init($name, $method, $action); if (!($fields = $this->readFields())) { trigger_error(sprintf(AMP_TEXT_ERROR_XML_READ_FAILED, get_class($this))); return; } $this->addFields($this->adjustFields($fields)); $this->setDynamicValues(); }
function &buildForm() { require_once 'AMP/System/Form.inc.php'; $form = new AMPSystem_Form('newScaffold'); $fields = array('new_scaffold' => array('label' => 'Object Name', 'type' => 'text', 'required' => true), 'new_namefield' => array('label' => 'Name Field', 'type' => 'text'), 'sourcetable' => array('label' => 'Source Table ( if not plural of object )', 'type' => 'text'), 'new_itype' => array('label' => 'Type of Object', 'type' => 'select', 'values' => array('module' => 'New Module', 'system' => 'Core System', 'content' => 'Content Item'))); $form->addFields($fields); $form->setDefaultValue('new_itype', 'module'); $form->enforceRequiredFields(); $form->removeSubmit('copy'); $form->removeSubmit('delete'); $form->defineSubmit('save', 'Build'); $form->Build(); return $form; }