protected function createAssignForm($force_submited = false) { $form = new Am_Form_Admin('assign'); $form->setAction($this->getUrl(null, 'assign')); $form->addElement('checkbox', 'skip')->setLabel(___('Skip First Line'))->setId('skip'); $form->addElement('checkbox', 'add_subscription')->setLabel('<strong>' . ___('Add Subscription') . '</strong>')->setId('add_subscription'); $form->addElement('checkbox', 'add_encrypted_pass')->setLabel('<strong>' . ___('Import Encrypted Password') . '</strong>')->setId('add_encrypted_pass'); $form->addElement('select', 'encrypted_pass_format')->loadOptions($this->getEncryptedPassFormatOptions())->setId('encrypted_pass_format'); $form->addElement('select', 'delim')->setLabel(___('Delimiter'))->loadOptions(Import_DataSource::getDelimOptions())->setId('delim'); $form->addElement('submit', '_submit_', array('value' => ___('Next')))->setId('_submit_'); for ($i = 0; $i < $this->dataSource->getColNum(); $i++) { $fSelect = $form->addElement('select', 'FIELD' . $i)->setId('FIELD' . $i); } if ($force_submited || $form->isSubmitted()) { $form->setDataSources(array($this->getRequest())); } else { $form->setDataSources(array(new HTML_QuickForm2_DataSource_Array(array('delim' => $this->dataSource->getDelim(Import_DataSource::DELIM_CODE)) + $this->getRequestVarsFromFieldsMap() + $this->getRequestVarsFromImportOptions()))); } $formValues = $form->getValue(); $add_subscription = @$formValues['add_subscription']; $add_encrypted_pass = @$formValues['add_encrypted_pass']; for ($i = 0; $i < $this->dataSource->getColNum(); $i++) { $fSelect = $form->getElementsByName('FIELD' . $i); $this->loadFieldsOptions($fSelect[0], $add_subscription, $add_encrypted_pass); } return $form; }