本文整理汇总了PHP中ilRadioOption::addSubitem方法的典型用法代码示例。如果您正苦于以下问题:PHP ilRadioOption::addSubitem方法的具体用法?PHP ilRadioOption::addSubitem怎么用?PHP ilRadioOption::addSubitem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilRadioOption
的用法示例。
在下文中一共展示了ilRadioOption::addSubitem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initCategoryMappingForm
/**
* Init category mapping form
* @return
*/
protected function initCategoryMappingForm($a_mode = 'add')
{
global $ilDB;
if (is_object($this->form)) {
return true;
}
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
$this->form = new ilPropertyFormGUI();
if ($a_mode == 'add') {
$this->form->setTitle($this->lng->txt('ecs_new_category_mapping'));
$this->form->setFormAction($this->ctrl->getFormAction($this, 'categoryMapping'));
$this->form->addCommandButton('addCategoryMapping', $this->lng->txt('save'));
$this->form->addCommandButton('categoryMapping', $this->lng->txt('cancel'));
} else {
$this->form->setTitle($this->lng->txt('ecs_edit_category_mapping'));
$this->form->setFormAction($this->ctrl->getFormAction($this, 'editCategoryMapping'));
$this->form->addCommandButton('updateCategoryMapping', $this->lng->txt('save'));
$this->form->addCommandButton('categoryMapping', $this->lng->txt('cancel'));
}
$imp = new ilCustomInputGUI($this->lng->txt('ecs_import_id'), 'import_id');
$imp->setRequired(true);
$tpl = new ilTemplate('tpl.ecs_import_id_form.html', true, true, 'Services/WebServices/ECS');
$tpl->setVariable('SIZE', 5);
$tpl->setVariable('MAXLENGTH', 11);
$tpl->setVariable('POST_VAR', 'import_id');
$tpl->setVariable('PROPERTY_VALUE', $this->rule->getContainerId());
if ($this->settings->getImportId()) {
$tpl->setVariable('COMPLETE_PATH', $this->buildPath($this->rule->getContainerId()));
}
$imp->setHTML($tpl->get());
$imp->setInfo($this->lng->txt('ecs_import_id_info'));
$this->form->addItem($imp);
include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php';
$select = new ilSelectInputGUI($this->lng->txt('ecs_attribute_name'), 'field');
$select->setValue($this->rule->getFieldName());
$select->setRequired(true);
$select->setOptions(ilECSCategoryMapping::getPossibleFields());
$this->form->addItem($select);
// Value
$value = new ilRadioGroupInputGUI($this->lng->txt('ecs_cat_mapping_type'), 'type');
$value->setValue($this->rule->getMappingType());
$value->setRequired(true);
$fixed = new ilRadioOption($this->lng->txt('ecs_cat_mapping_fixed'), ilECSCategoryMappingRule::TYPE_FIXED);
$fixed->setInfo($this->lng->txt('ecs_cat_mapping_fixed_info'));
$fixed_val = new ilTextInputGUI($this->lng->txt('ecs_cat_mapping_values'), 'mapping_value');
$fixed_val->setValue($this->rule->getMappingValue());
$fixed_val->setMaxLength(255);
$fixed_val->setSize(40);
$fixed_val->setRequired(true);
$fixed->addSubItem($fixed_val);
$value->addOption($fixed);
$duration = new ilRadioOption($this->lng->txt('ecs_cat_mapping_duration'), ilECSCategoryMappingRule::TYPE_DURATION);
$duration->setInfo($this->lng->txt('ecs_cat_mapping_duration_info'));
$dur_start = new ilDateTimeInputGUI($this->lng->txt('from'), 'dur_begin');
$dur_start->setDate($this->rule->getDateRangeStart());
$duration->addSubItem($dur_start);
$dur_end = new ilDateTimeInputGUI($this->lng->txt('to'), 'dur_end');
$dur_end->setDate($this->rule->getDateRangeEnd());
$duration->addSubItem($dur_end);
$value->addOption($duration);
$type = new ilRadioOption($this->lng->txt('ecs_cat_mapping_by_type'), ilECSCategoryMappingRule::TYPE_BY_TYPE);
$type->setInfo($this->lng->txt('ecs_cat_mapping_by_type_info'));
$options = ilECSUtils::getPossibleRemoteTypes(true);
$types = new ilSelectInputGUI($this->lng->txt('type'), 'by_type');
$types->setOptions($options);
$types->setValue($this->rule->getByType());
$types->setRequired(true);
$type->addSubitem($types);
$value->addOption($type);
$this->form->addItem($value);
}
示例2: certificateEditor
/**
* Shows the certificate editor for ILIAS tests
*/
public function certificateEditor()
{
global $ilAccess;
$form_fields = array();
if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) {
$form_fields = $this->getFormFieldsFromPOST();
} else {
$form_fields = $this->getFormFieldsFromFO();
}
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setPreventDoubleSubmission(false);
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt("certificate_edit"));
$form->setMultipart(TRUE);
$form->setTableWidth("100%");
$form->setId("certificate");
$active = new ilCheckboxInputGUI($this->lng->txt("active"), "active");
$active->setChecked($form_fields["active"]);
$form->addItem($active);
$import = new ilFileInputGUI($this->lng->txt("import"), "certificate_import");
$import->setRequired(FALSE);
$import->setSuffixes(array("zip"));
// handle the certificate import
if (strlen($_FILES["certificate_import"]["tmp_name"])) {
if ($import->checkInput()) {
$result = $this->object->importCertificate($_FILES["certificate_import"]["tmp_name"], $_FILES["certificate_import"]["name"]);
if ($result == FALSE) {
$import->setAlert($this->lng->txt("certificate_error_import"));
} else {
$this->ctrl->redirect($this, "certificateEditor");
}
}
}
$form->addItem($import);
$pageformat = new ilRadioGroupInputGUI($this->lng->txt("certificate_page_format"), "pageformat");
$pageformats = $this->object->getPageFormats();
$pageformat->setValue($form_fields["pageformat"]);
foreach ($pageformats as $format) {
$option = new ilRadioOption($format["name"], $format["value"]);
if (strcmp($format["value"], "custom") == 0) {
$pageheight = new ilTextInputGUI($this->lng->txt("certificate_pageheight"), "pageheight");
$pageheight->setValue($form_fields["pageheight"]);
$pageheight->setSize(6);
$pageheight->setValidationRegexp("/[0123456789\\.](cm|mm|in|pt|pc|px|em)/is");
$pageheight->setInfo($this->lng->txt("certificate_unit_description"));
$pageheight->setRequired(true);
$option->addSubitem($pageheight);
$pagewidth = new ilTextInputGUI($this->lng->txt("certificate_pagewidth"), "pagewidth");
$pagewidth->setValue($form_fields["pagewidth"]);
$pagewidth->setSize(6);
$pagewidth->setValidationRegexp("/[0123456789\\.](cm|mm|in|pt|pc|px|em)/is");
$pagewidth->setInfo($this->lng->txt("certificate_unit_description"));
$pagewidth->setRequired(true);
$option->addSubitem($pagewidth);
}
$pageformat->addOption($option);
}
$pageformat->setRequired(true);
if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) {
$pageformat->checkInput();
}
$form->addItem($pageformat);
$bgimage = new ilImageFileInputGUI($this->lng->txt("certificate_background_image"), "background");
$bgimage->setRequired(FALSE);
$bgimage->setUseCache(false);
if (count($_POST)) {
// handle the background upload
if (strlen($_FILES["background"]["tmp_name"])) {
if ($bgimage->checkInput()) {
$result = $this->object->uploadBackgroundImage($_FILES["background"]["tmp_name"]);
if ($result == FALSE) {
$bgimage->setAlert($this->lng->txt("certificate_error_upload_bgimage"));
}
}
}
}
if (!$this->object->hasBackgroundImage()) {
include_once "./Services/Certificate/classes/class.ilObjCertificateSettingsAccess.php";
if (ilObjCertificateSettingsAccess::hasBackgroundImage()) {
$bgimage->setImage(ilObjCertificateSettingsAccess::getBackgroundImageThumbPathWeb());
}
} else {
$bgimage->setImage($this->object->getBackgroundImageThumbPathWeb());
}
$form->addItem($bgimage);
$padding_top = new ilTextInputGUI($this->lng->txt("certificate_padding_top"), "padding_top");
$padding_top->setRequired(TRUE);
$padding_top->setValue($form_fields["padding_top"]);
$padding_top->setSize(6);
$padding_top->setValidationRegexp("/[0123456789\\.](cm|mm|in|pt|pc|px|em)/is");
$padding_top->setInfo($this->lng->txt("certificate_unit_description"));
if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) {
$padding_top->checkInput();
}
$form->addItem($padding_top);
$rect = new ilCSSRectInputGUI($this->lng->txt("certificate_margin_body"), "margin_body");
//.........这里部分代码省略.........