本文整理匯總了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;
}