本文整理汇总了PHP中Am_Form_Admin::getElementsByName方法的典型用法代码示例。如果您正苦于以下问题:PHP Am_Form_Admin::getElementsByName方法的具体用法?PHP Am_Form_Admin::getElementsByName怎么用?PHP Am_Form_Admin::getElementsByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Am_Form_Admin
的用法示例。
在下文中一共展示了Am_Form_Admin::getElementsByName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createAssignForm
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;
}