$ctl->id = $control->id; $control_type = get_class($ctl); $f->id = $control->form_id; } } if ($control_type == "") { $control_type = $_POST['control_type']; } $form = call_user_func(array($control_type, "form"), $ctl); $form->location($loc); if ($ctl) { $form->controls['identifier']->disabled = true; $form->meta("id", $ctl->id); $form->meta("identifier", $ctl->identifier); } $form->meta("action", "save_control"); $form->meta('control_type', $control_type); $form->meta('form_id', $f->id); $types = expTemplate::listControlTypes(); $template = new template('formbuilder', '_edit_control'); $template->assign('form_html', $form->toHTML($f->id)); $template->assign('type', $types[$control_type]); $template->assign('is_edit', $ctl == null ? 0 : 1); $template->output(); } } else { echo SITE_403_HTML; } } else { echo SITE_404_HTML; }