$html = ''; $vars = Horde_Variables::getDefaultVariables(); $formname = $vars->get('formname'); $form_id = $vars->get('form_id'); $type = $vars->get('type'); $old_type = $vars->get('old_type'); /* Check if type has been changed. */ if ($type != $old_type && $formname) { $changed_type = true; $notification->push(_("Changed embed type."), 'horde.message'); } /* Fetch the form details and set a nice title. */ $form_details = $injector->getInstance('Ulaform_Factory_Driver')->create()->getForm($form_id); $title = sprintf(_("HTML Generation for \"%s\""), $form_details['form_name']); $form = new Horde_Form($vars, $title); $form->useToken(false); /* Set up the form. */ $form->setButtons(_("Generate HTML")); $form->addHidden('', 'form_id', 'int', false); $form->addHidden('', 'old_type', 'text', false); $embed_types = array('php_pear' => _("PHP using PEAR classes"), 'iframe' => _("iframe")); $v =& $form->addVariable(_("Select how you wish to embed the form"), 'type', 'enum', true, false, null, array($embed_types, true)); $v->setAction(Horde_Form_Action::factory('submit')); switch ($type) { case 'php_pear': break; case 'iframe': $form->addVariable(_("Name"), 'params[name]', 'text', true, false); $form->addVariable(_("Height"), 'params[height]', 'int', false, false); $form->addVariable(_("Width"), 'params[width]', 'int', false, false); break;