本文整理汇总了PHP中ilRadioGroupInputGUI类的典型用法代码示例。如果您正苦于以下问题:PHP ilRadioGroupInputGUI类的具体用法?PHP ilRadioGroupInputGUI怎么用?PHP ilRadioGroupInputGUI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ilRadioGroupInputGUI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addToForm
public function addToForm()
{
global $lng;
$def = $this->getADT()->getCopyOfDefinition();
$selection = $this->getADT()->getSelection();
$options = $def->getOptions();
asort($options);
// ?
if (!$this->isRequired()) {
$options = array("" => "-") + $options;
} else {
if ($this->getADT()->isNull()) {
$options = array("" => $lng->txt("please_select")) + $options;
}
}
if (!(bool) $this->force_radio) {
$select = new ilSelectInputGUI($this->getTitle(), $this->getElementId());
$select->setOptions($options);
} else {
$select = new ilRadioGroupInputGUI($this->getTitle(), $this->getElementId());
foreach ($options as $value => $caption) {
$option = new ilRadioOption($caption, $value);
if (is_array($this->option_infos) && array_key_exists($value, $this->option_infos)) {
$option->setInfo($this->option_infos[$value]);
}
$select->addOption($option);
}
}
$this->addBasicFieldProperties($select, $def);
$select->setValue($selection);
$this->addToParentElement($select);
}
示例2: initAddCodesForm
function initAddCodesForm()
{
global $ilCtrl, $lng;
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form_gui = new ilPropertyFormGUI();
$this->form_gui->setFormAction($ilCtrl->getFormAction($this, 'createCodes'));
$this->form_gui->setTitle($lng->txt('user_account_codes_edit_header'));
$count = new ilNumberInputGUI($lng->txt('user_account_codes_number'), 'acc_codes_number');
$count->setSize(4);
$count->setMaxLength(4);
$count->setMinValue(1);
$count->setMaxValue(1000);
$count->setRequired(true);
$this->form_gui->addItem($count);
$valid = new ilRadioGroupInputGUI($lng->txt('user_account_code_valid_until'), 'valid_type');
$valid->setRequired(true);
$unl = new ilRadioOption($lng->txt('user_account_code_valid_until_unlimited'), 'valid_unlimited');
$valid->addOption($unl);
$st = new ilRadioOption($lng->txt('user_account_code_valid_until_static'), 'valid_static');
$valid->addOption($st);
$dt = new ilDateTimeInputGUI($lng->txt('date'), 'valid_date');
$dt->setRequired(true);
$st->addSubItem($dt);
$dyn = new ilRadioOption($lng->txt('user_account_code_valid_until_dynamic'), 'valid_dynamic');
$valid->addOption($dyn);
$ds = new ilNumberInputGUI($lng->txt('days'), 'valid_days');
$ds->setSize(5);
$ds->setRequired(true);
$dyn->addSubItem($ds);
$this->form_gui->addItem($valid);
$this->form_gui->addCommandButton('createCodes', $lng->txt('create'));
$this->form_gui->addCommandButton('listCodes', $lng->txt('cancel'));
}
示例3: initFormSettings
/**
* Init property form
*
* @return ilPropertyFormGUI $form
*/
protected function initFormSettings()
{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setTitle($this->lng->txt('tracking_settings'));
$form->setFormAction($this->ctrl->getFormAction($this));
// Mode
$mod = new ilRadioGroupInputGUI($this->lng->txt('trac_mode'), 'modus');
$mod->setRequired(true);
$mod->setValue($this->obj_lp->getCurrentMode());
$form->addItem($mod);
foreach ($this->obj_lp->getValidModes() as $mode_key) {
$opt = new ilRadioOption($this->obj_lp->getModeText($mode_key), $mode_key, $this->obj_lp->getModeInfoText($mode_key));
$opt->setValue($mode_key);
$mod->addOption($opt);
// :TODO: Subitem for visits ?!
if ($mode_key == ilLPObjSettings::LP_MODE_VISITS) {
$vis = new ilNumberInputGUI($this->lng->txt('trac_visits'), 'visits');
$vis->setSize(3);
$vis->setMaxLength(4);
$vis->setInfo(sprintf($this->lng->txt('trac_visits_info'), ilObjUserTracking::_getValidTimeSpan()));
$vis->setRequired(true);
$vis->setValue($this->obj_settings->getVisits());
$opt->addSubItem($vis);
}
}
$form->addCommandButton('saveSettings', $this->lng->txt('save'));
return $form;
}
示例4: build
public function build(ilTestRandomQuestionSetSourcePoolDefinition $sourcePool, $availableTaxonomyIds)
{
$this->setFormAction($this->ctrl->getFormAction($this->questionSetConfigGUI));
$this->setTitle($this->lng->txt('tst_rnd_quest_set_cfg_pool_form'));
$this->setId('tstRndQuestSetCfgPoolForm');
$this->addCommandButton($this->getSaveCommand(), $this->lng->txt('save'));
$this->addCommandButton(ilTestRandomQuestionSetConfigGUI::CMD_SHOW_SRC_POOL_DEF_LIST, $this->lng->txt('cancel'));
$hiddenDefId = new ilHiddenInputGUI('src_pool_def_id');
$hiddenDefId->setValue($sourcePool->getId());
$this->addItem($hiddenDefId);
$hiddenPoolId = new ilHiddenInputGUI('quest_pool_id');
$hiddenPoolId->setValue($sourcePool->getPoolId());
$this->addItem($hiddenPoolId);
$nonEditablePoolLabel = new ilNonEditableValueGUI($this->lng->txt('tst_inp_source_pool_label'), 'quest_pool_label');
$nonEditablePoolLabel->setValue($sourcePool->getPoolInfoLabel($this->lng));
$this->addItem($nonEditablePoolLabel);
if (count($availableTaxonomyIds)) {
$taxRadio = new ilRadioGroupInputGUI($this->lng->txt('tst_inp_source_pool_filter_tax'), 'filter_tax');
$taxRadio->setRequired(true);
$taxRadio->addOption(new ilRadioOption($this->lng->txt('tst_inp_source_pool_no_tax_filter'), 0));
$taxRadio->setValue(0);
require_once 'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
foreach ($availableTaxonomyIds as $taxId) {
$taxonomy = new ilObjTaxonomy($taxId);
$label = sprintf($this->lng->txt('tst_inp_source_pool_filter_tax_x'), $taxonomy->getTitle());
$taxRadioOption = new ilRadioOption($label, $taxId);
$taxRadio->addOption($taxRadioOption);
$taxSelect = new ilTaxSelectInputGUI($taxId, "filter_tax_{$taxId}", false);
$taxSelect->setRequired(true);
$taxRadioOption->addSubItem($taxSelect);
if ($taxId == $sourcePool->getOriginalFilterTaxId()) {
$taxRadio->setValue($sourcePool->getOriginalFilterTaxId());
$taxSelect->setValue($sourcePool->getOriginalFilterTaxNodeId());
}
}
$this->addItem($taxRadio);
} else {
$hiddenNoTax = new ilHiddenInputGUI('filter_tax');
$hiddenNoTax->setValue(0);
$this->addItem($hiddenNoTax);
$nonEditableNoTax = new ilNonEditableValueGUI($this->lng->txt('tst_inp_source_pool_filter_tax'), 'no_tax_label');
$nonEditableNoTax->setValue($this->lng->txt('tst_inp_no_available_tax_hint'));
$this->addItem($nonEditableNoTax);
}
if ($this->questionSetConfig->isQuestionAmountConfigurationModePerPool()) {
$questionAmountPerSourcePool = new ilNumberInputGUI($this->lng->txt('tst_inp_quest_amount_per_source_pool'), 'question_amount_per_pool');
$questionAmountPerSourcePool->setRequired(true);
$questionAmountPerSourcePool->allowDecimals(false);
$questionAmountPerSourcePool->setMinValue(0);
$questionAmountPerSourcePool->setMinvalueShouldBeGreater(true);
$questionAmountPerSourcePool->setSize(4);
if ($sourcePool->getQuestionAmount()) {
$questionAmountPerSourcePool->setValue($sourcePool->getQuestionAmount());
}
$this->addItem($questionAmountPerSourcePool);
}
}
示例5: initEditForm
function initEditForm($a_job_id)
{
global $ilCtrl, $lng;
$job = ilCronManager::getJobInstanceById($a_job_id);
if (!$job) {
$ilCtrl->redirect($this, "render");
}
$ilCtrl->setParameter($this, "jid", $a_job_id);
$data = array_pop(ilCronManager::getCronJobData($job->getId()));
include_once "Services/Cron/classes/class.ilCronJob.php";
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this, "update"));
$form->setTitle($lng->txt("cron_action_edit") . ': "' . $job->getTitle() . '"');
if ($job->hasFlexibleSchedule()) {
$type = new ilRadioGroupInputGUI($lng->txt("cron_schedule_type"), "type");
$type->setRequired(true);
$type->setValue($data["schedule_type"]);
$type->addOption(new ilRadioOption($lng->txt("cron_schedule_daily"), ilCronJob::SCHEDULE_TYPE_DAILY));
$type->addOption(new ilRadioOption($lng->txt("cron_schedule_weekly"), ilCronJob::SCHEDULE_TYPE_WEEKLY));
$type->addOption(new ilRadioOption($lng->txt("cron_schedule_monthly"), ilCronJob::SCHEDULE_TYPE_MONTHLY));
$type->addOption(new ilRadioOption($lng->txt("cron_schedule_quarterly"), ilCronJob::SCHEDULE_TYPE_QUARTERLY));
$type->addOption(new ilRadioOption($lng->txt("cron_schedule_yearly"), ilCronJob::SCHEDULE_TYPE_YEARLY));
$min = new ilRadioOption(sprintf($lng->txt("cron_schedule_in_minutes"), "x"), ilCronJob::SCHEDULE_TYPE_IN_MINUTES);
$mini = new ilNumberInputGUI($lng->txt("cron_schedule_value"), "smini");
$mini->setRequired(true);
$mini->setSize(5);
if ($data["schedule_type"] == ilCronJob::SCHEDULE_TYPE_IN_MINUTES) {
$mini->setValue($data["schedule_value"]);
}
$min->addSubItem($mini);
$type->addOption($min);
$hr = new ilRadioOption(sprintf($lng->txt("cron_schedule_in_hours"), "x"), ilCronJob::SCHEDULE_TYPE_IN_HOURS);
$hri = new ilNumberInputGUI($lng->txt("cron_schedule_value"), "shri");
$hri->setRequired(true);
$hri->setSize(5);
if ($data["schedule_type"] == ilCronJob::SCHEDULE_TYPE_IN_HOURS) {
$hri->setValue($data["schedule_value"]);
}
$hr->addSubItem($hri);
$type->addOption($hr);
$dy = new ilRadioOption(sprintf($lng->txt("cron_schedule_in_days"), "x"), ilCronJob::SCHEDULE_TYPE_IN_DAYS);
$dyi = new ilNumberInputGUI($lng->txt("cron_schedule_value"), "sdyi");
$dyi->setRequired(true);
$dyi->setSize(5);
if ($data["schedule_type"] == ilCronJob::SCHEDULE_TYPE_IN_DAYS) {
$dyi->setValue($data["schedule_value"]);
}
$dy->addSubItem($dyi);
$type->addOption($dy);
$form->addItem($type);
}
if ($job->hasCustomSettings()) {
$job->addCustomSettingsToForm($form);
}
$form->addCommandButton("update", $lng->txt("save"));
$form->addCommandButton("render", $lng->txt("cancel"));
return $form;
}
示例6: addMembershipFormElements
/**
* Add membership form elements
* @param ilPropertyFormGUI $form
*/
public final function addMembershipFormElements(ilPropertyFormGUI $form, $a_parent_post = '')
{
// Registration type
$reg_type = new ilRadioGroupInputGUI($this->txt('reg_type'), 'registration_type');
//$reg_type->setValue($this->object->getRegistrationType());
if (in_array(ilMembershipRegistrationSettings::TYPE_DIRECT, $this->getOptions())) {
$opt_dir = new ilRadioOption($this->txt('reg_direct'), ilMembershipRegistrationSettings::TYPE_DIRECT);
#$this->lng->txt('grp_reg_direct_info'));
$reg_type->addOption($opt_dir);
}
if (in_array(ilMembershipRegistrationSettings::TYPE_PASSWORD, $this->getOptions())) {
$opt_pass = new ilRadioOption($this->txt('reg_pass'), ilMembershipRegistrationSettings::TYPE_PASSWORD);
$pass = new ilTextInputGUI($GLOBALS['lng']->txt("password"), 'password');
$pass->setInfo($this->txt('reg_password_info'));
#$pass->setValue($this->object->getPassword());
$pass->setSize(10);
$pass->setMaxLength(32);
$opt_pass->addSubItem($pass);
$reg_type->addOption($opt_pass);
}
if (in_array(ilMembershipRegistrationSettings::TYPE_REQUEST, $this->getOptions())) {
$opt_req = new ilRadioOption($this->txt('reg_request'), ilMembershipRegistrationSettings::TYPE_REQUEST, $this->txt('reg_request_info'));
$reg_type->addOption($opt_req);
}
if (in_array(ilMembershipRegistrationSettings::TYPE_NONE, $this->getOptions())) {
$opt_deact = new ilRadioOption($this->txt('reg_disabled'), ilMembershipRegistrationSettings::TYPE_NONE, $this->txt('reg_disabled_info'));
$reg_type->addOption($opt_deact);
}
// Add to form
$form->addItem($reg_type);
if (in_array(ilMembershipRegistrationSettings::REGISTRATION_LIMITED_USERS, $this->getOptions())) {
// max member
$lim = new ilCheckboxInputGUI($this->txt('reg_max_members_short'), 'registration_membership_limited');
$lim->setValue(1);
#$lim->setOptionTitle($this->lng->txt('reg_grp_max_members'));
#$lim->setChecked($this->object->isMembershipLimited());
$max = new ilTextInputGUI($this->txt('reg_max_members'), 'registration_max_members');
#$max->setValue($this->object->getMaxMembers() ? $this->object->getMaxMembers() : '');
//$max->setTitle($this->lng->txt('members'));
$max->setSize(3);
$max->setMaxLength(4);
$max->setInfo($this->txt('reg_max_members_info'));
$lim->addSubItem($max);
$wait = new ilCheckboxInputGUI($this->txt('reg_waiting_list'), 'waiting_list');
$wait->setValue(1);
//$wait->setOptionTitle($this->lng->txt('grp_waiting_list'));
$wait->setInfo($this->txt('reg_waiting_list_info'));
#$wait->setChecked($this->object->isWaitingListEnabled() ? true : false);
$lim->addSubItem($wait);
$form->addItem($lim);
}
$this->setFormValues($form);
}
示例7: initFormSettings
/**
* Init property form
*
* @return ilPropertyFormGUI $form
*/
protected function initFormSettings()
{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setTitle($this->lng->txt('tracking_settings'));
$form->setFormAction($this->ctrl->getFormAction($this));
// Mode
$mod = new ilRadioGroupInputGUI($this->lng->txt('trac_mode'), 'modus');
$mod->setRequired(true);
$mod->setValue($this->obj_settings->getMode());
$form->addItem($mod);
foreach ($this->obj_settings->getValidModes() as $mode_key => $mode_name) {
$opt = new ilRadioOption($mode_name, $mode_key, ilLPObjSettings::_mode2InfoText($mode_key));
$opt->setValue($mode_key);
$mod->addOption($opt);
// Subitem for vistits
if ($mode_key == LP_MODE_VISITS) {
$vis = new ilNumberInputGUI($this->lng->txt('trac_visits'), 'visits');
$vis->setSize(3);
$vis->setMaxLength(4);
$vis->setInfo(sprintf($this->lng->txt('trac_visits_info'), ilObjUserTracking::_getValidTimeSpan()));
$vis->setRequired(true);
$vis->setValue($this->obj_settings->getVisits());
$opt->addSubItem($vis);
}
}
/*
// Info Active
$act = new ilCustomInputGUI($this->lng->txt('trac_activated'), '');
$img = new ilTemplate('tpl.obj_settings_img_row.html',true,true,'Services/Tracking');
$img->setVariable("IMG_SRC",
$activated = ilObjUserTracking::_enabledLearningProgress()
? ilUtil::getImagePath('icon_ok.png')
: ilUtil::getImagePath('icon_not_ok.png')
);
$act->setHTML($img->get());
$form->addItem($act);
// Info Anonymized
$ano = new ilCustomInputGUI($this->lng->txt('trac_anonymized'), '');
$img = new ilTemplate('tpl.obj_settings_img_row.html',true,true,'Services/Tracking');
$img->setVariable("IMG_SRC",
$anonymized = !ilObjUserTracking::_enabledUserRelatedData()
? ilUtil::getImagePath('icon_ok.png')
: ilUtil::getImagePath('icon_not_ok.png')
);
$ano->setHTML($img->get());
$form->addItem($ano);
*/
$form->addCommandButton('saveSettings', $this->lng->txt('save'));
return $form;
}
示例8: addFieldsToEditForm
protected function addFieldsToEditForm(ilPropertyFormGUI $a_form)
{
// orientation
$orientation = new ilRadioGroupInputGUI($this->lng->txt("orientation"), "orientation");
$orientation->setRequired(false);
$orientation->addOption(new ilRadioOption($this->lng->txt('vertical'), 0));
$orientation->addOption(new ilRadioOption($this->lng->txt('horizontal'), 1));
$a_form->addItem($orientation);
// minimum answers
$minanswers = new ilCheckboxInputGUI($this->lng->txt("use_min_answers"), "use_min_answers");
$minanswers->setValue(1);
$minanswers->setOptionTitle($this->lng->txt("use_min_answers_option"));
$minanswers->setRequired(FALSE);
$nranswers = new ilNumberInputGUI($this->lng->txt("nr_min_answers"), "nr_min_answers");
$nranswers->setSize(5);
$nranswers->setDecimals(0);
$nranswers->setRequired(false);
$nranswers->setMinValue(1);
$minanswers->addSubItem($nranswers);
$nrmaxanswers = new ilNumberInputGUI($this->lng->txt("nr_max_answers"), "nr_max_answers");
$nrmaxanswers->setSize(5);
$nrmaxanswers->setDecimals(0);
$nrmaxanswers->setRequired(false);
$nrmaxanswers->setMinValue(1);
$minanswers->addSubItem($nrmaxanswers);
$a_form->addItem($minanswers);
// Answers
include_once "./Modules/SurveyQuestionPool/classes/class.ilCategoryWizardInputGUI.php";
$answers = new ilCategoryWizardInputGUI($this->lng->txt("answers"), "answers");
$answers->setRequired(false);
$answers->setAllowMove(true);
$answers->setShowWizard(false);
$answers->setShowSavePhrase(false);
$answers->setUseOtherAnswer(true);
$answers->setShowNeutralCategory(true);
$answers->setNeutralCategoryTitle($this->lng->txt('svy_neutral_answer'));
$answers->setDisabledScale(false);
$a_form->addItem($answers);
// values
$orientation->setValue($this->object->getOrientation());
$minanswers->setChecked($this->object->use_min_answers);
$nranswers->setValue($this->object->nr_min_answers);
$nrmaxanswers->setValue($this->object->nr_max_answers);
if (!$this->object->getCategories()->getCategoryCount()) {
$this->object->getCategories()->addCategory("");
}
$answers->setValues($this->object->getCategories());
}
示例9: edit
/**
* Edit resources form.
*/
public function edit($a_insert = false)
{
global $ilCtrl, $tpl, $lng, $objDefinition;
$this->displayValidationError();
// edit form
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this));
if ($a_insert) {
$form->setTitle($this->lng->txt("cont_insert_login_page"));
} else {
$form->setTitle($this->lng->txt("cont_update_login_page"));
}
// type selection
$type_prop = new ilRadioGroupInputGUI($this->lng->txt("cont_type"), "type");
foreach (ilPCLoginPageElement::getAllTypes() as $index => $lang_key) {
$types[$index] = $this->lng->txt('cont_lpe_' . $lang_key);
$option = new ilRadioOption($this->lng->txt('cont_lpe_' . $lang_key), $index);
$type_prop->addOption($option);
}
$selected = $a_insert ? "" : $this->content_obj->getLoginPageElementType();
$type_prop->setValue($selected);
$form->addItem($type_prop);
// horizonal align
$align_prop = new ilSelectInputGUI($this->lng->txt("cont_align"), "horizontal_align");
$options = array("Left" => $lng->txt("cont_left"), "Center" => $lng->txt("cont_center"), "Right" => $lng->txt("cont_right"));
# "LeftFloat" => $lng->txt("cont_left_float"),
# "RightFloat" => $lng->txt("cont_right_float"));
$align_prop->setOptions($options);
$align_prop->setValue($this->content_obj->getAlignment());
$form->addItem($align_prop);
// save/cancel buttons
if ($a_insert) {
$form->addCommandButton("create_login_page_element", $lng->txt("save"));
$form->addCommandButton("cancelCreate", $lng->txt("cancel"));
} else {
$form->addCommandButton("update_login_page_element", $lng->txt("save"));
$form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
}
$html = $form->getHTML();
$tpl->setContent($html);
return $ret;
}
示例10: completeSpecificFormProperties
/**
* completes a given form object with the specific form properties
* required by this question type
*
* (overwrites the method from ilAssMultiOptionQuestionFeedback, because of individual setting)
*
* @access public
* @param ilPropertyFormGUI $form
*/
public function completeSpecificFormProperties(ilPropertyFormGUI $form)
{
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt('feedback_answers'));
$form->addItem($header);
if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
require_once './Services/Form/classes/class.ilRadioGroupInputGUI.php';
require_once './Services/Form/classes/class.ilRadioOption.php';
$feedback = new ilRadioGroupInputGUI($this->lng->txt('feedback_setting'), 'feedback_setting');
$feedback->addOption(new ilRadioOption($this->lng->txt('feedback_all'), 1), true);
$feedback->addOption(new ilRadioOption($this->lng->txt('feedback_checked'), 2));
$feedback->addOption(new ilRadioOption($this->lng->txt('feedback_correct'), 3));
$form->addItem($feedback);
foreach ($this->getAnswerOptionsByAnswerIndex() as $index => $answer) {
$propertyLabel = $this->questionOBJ->prepareTextareaOutput($this->buildAnswerOptionLabel($index, $answer), true);
$propertyPostVar = "feedback_answer_{$index}";
$form->addItem($this->buildFeedbackContentFormProperty($propertyLabel, $propertyPostVar, $this->questionOBJ->isAdditionalContentEditingModePageObject()));
}
}
}
示例11: initForm
/**
* Init creation from
*/
function initForm()
{
global $ilCtrl, $lng;
// edit form
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this));
$form->setTitle($this->lng->txt("cont_ed_insert_templ"));
$radg = new ilRadioGroupInputGUI($lng->txt("cont_template"), "page_templ");
$radg->setRequired(true);
$ts = $this->getPage()->getContentTemplates();
foreach ($ts as $t) {
$op = new ilRadioOption($t["title"], $t["id"] . ":" . $t["parent_type"]);
$radg->addOption($op);
}
$form->addItem($radg);
$form->addCommandButton("create_templ", $lng->txt("insert"));
$form->addCommandButton("cancelCreate", $lng->txt("cancel"));
return $form;
}
示例12: addFieldsToEditForm
protected function addFieldsToEditForm(ilPropertyFormGUI $a_form)
{
// orientation
$orientation = new ilRadioGroupInputGUI($this->lng->txt("orientation"), "orientation");
$orientation->setRequired(false);
$orientation->addOption(new ilRadioOption($this->lng->txt('vertical'), 0));
$orientation->addOption(new ilRadioOption($this->lng->txt('horizontal'), 1));
$orientation->addOption(new ilRadioOption($this->lng->txt('combobox'), 2));
$a_form->addItem($orientation);
// Answers
include_once "./Modules/SurveyQuestionPool/classes/class.ilCategoryWizardInputGUI.php";
$answers = new ilCategoryWizardInputGUI($this->lng->txt("answers"), "answers");
$answers->setRequired(false);
$answers->setAllowMove(true);
$answers->setShowWizard(true);
$answers->setShowSavePhrase(true);
$answers->setUseOtherAnswer(true);
$answers->setShowNeutralCategory(true);
$answers->setNeutralCategoryTitle($this->lng->txt('svy_neutral_answer'));
$answers->setDisabledScale(false);
$a_form->addItem($answers);
// values
$orientation->setValue($this->object->getOrientation());
if (!$this->object->getCategories()->getCategoryCount()) {
$this->object->getCategories()->addCategory("");
}
$answers->setValues($this->object->getCategories());
}
示例13: build
public function build()
{
$this->setFormAction($this->ctrl->getFormAction($this->questionSetConfigGUI));
$this->setTitle($this->lng->txt('tst_rnd_quest_set_cfg_general_form'));
$this->setId('tstRndQuestSetCfgGeneralForm');
$this->addCommandButton(ilTestRandomQuestionSetConfigGUI::CMD_SAVE_GENERAL_CONFIG_FORM, $this->lng->txt('save'));
// Require Pools with Homogeneous Scored Questions
$requirePoolsQuestionsHomoScored = new ilCheckboxInputGUI($this->lng->txt('tst_inp_all_quest_points_equal_per_pool'), 'quest_points_equal_per_pool');
$requirePoolsQuestionsHomoScored->setInfo($this->lng->txt('tst_inp_all_quest_points_equal_per_pool_desc'));
$requirePoolsQuestionsHomoScored->setChecked($this->questionSetConfig->arePoolsWithHomogeneousScoredQuestionsRequired());
$this->addItem($requirePoolsQuestionsHomoScored);
// question amount config mode (per test / per pool)
$questionAmountConfigMode = new ilRadioGroupInputGUI($this->lng->txt('tst_inp_quest_amount_cfg_mode'), 'quest_amount_cfg_mode');
$questionAmountConfigMode->setValue($this->fetchValidQuestionAmountConfigModeWithFallbackModePerTest($this->questionSetConfig));
$questionAmountConfigModePerTest = new ilRadioOption($this->lng->txt('tst_inp_quest_amount_cfg_mode_test'), ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_TEST);
$questionAmountConfigMode->addOption($questionAmountConfigModePerTest);
$questionAmountConfigModePerPool = new ilRadioOption($this->lng->txt('tst_inp_quest_amount_cfg_mode_pool'), ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_POOL);
$questionAmountConfigMode->addOption($questionAmountConfigModePerPool);
$questionAmountConfigMode->setRequired(true);
$this->addItem($questionAmountConfigMode);
// question amount per test
$questionAmountPerTest = new ilNumberInputGUI($this->lng->txt('tst_inp_quest_amount_per_test'), 'quest_amount_per_test');
$questionAmountPerTest->setRequired(true);
$questionAmountPerTest->setMinValue(0);
$questionAmountPerTest->allowDecimals(false);
$questionAmountPerTest->setMinvalueShouldBeGreater(true);
$questionAmountPerTest->setSize(4);
$questionAmountPerTest->setValue($this->questionSetConfig->getQuestionAmountPerTest());
$questionAmountConfigModePerTest->addSubItem($questionAmountPerTest);
if ($this->testOBJ->participantDataExist()) {
$requirePoolsQuestionsHomoScored->setDisabled(true);
$questionAmountConfigMode->setDisabled(true);
$questionAmountPerTest->setDisabled(true);
}
}
示例14: addFormProperties
/**
* add the configuration elements to a property form
* @param object property form
*/
public function addFormProperties(ilPropertyFormGUI $a_form)
{
global $lng;
$lng->loadLanguageModule('adve');
$availability = new ilRadioGroupInputGUI($lng->txt('char_selector'), 'char_selector_availability');
$inactive = new ilRadioOption($lng->txt('char_selector_inactive'), ilCharSelectorConfig::INACTIVE);
$inactive->setInfo($lng->txt('char_selector_inactive_info_' . $this->config->getContext()));
$inherit = new ilRadioOption($lng->txt('char_selector_inherit'), ilCharSelectorConfig::INHERIT);
$inherit->setInfo($lng->txt('char_selector_inherit_info_' . $this->config->getContext()));
$enabled = new ilRadioOption($lng->txt('char_selector_enabled'), ilCharSelectorConfig::ENABLED);
$enabled->setInfo($lng->txt('char_selector_enabled_info_' . $this->config->getContext()));
$disabled = new ilRadioOption($lng->txt('char_selector_disabled'), ilCharSelectorConfig::DISABLED);
$disabled->setInfo($lng->txt('char_selector_disabled_info_' . $this->config->getContext()));
$blocks = new ilSelectInputGUI($lng->txt('char_selector_blocks'), 'char_selector_blocks');
$blocks->setInfo($lng->txt('char_selector_blocks_info'));
$blocks->setOptions($this->config->getBlockOptions());
$blocks->setMulti(true);
$enabled->addSubItem($blocks);
$custom_items = new ilTextAreaInputGUI($lng->txt('char_selector_custom_items'), 'char_selector_custom_items');
$tpl = new ilTemplate("tpl.char_selector_custom_info.html", true, true, "Services/UIComponent/CharSelector");
$tpl->setVariable('1', $lng->txt('char_selector_custom_items_info1'));
$tpl->setVariable('2a', $lng->txt('char_selector_custom_items_info2a'));
$tpl->setVariable('2b', $lng->txt('char_selector_custom_items_info2b'));
$tpl->setVariable('3a', $lng->txt('char_selector_custom_items_info3a'));
$tpl->setVariable('3b', $lng->txt('char_selector_custom_items_info3b'));
$tpl->setVariable('4a', $lng->txt('char_selector_custom_items_info4a'));
$tpl->setVariable('4b', $lng->txt('char_selector_custom_items_info4b'));
$tpl->setVariable('5a', $lng->txt('char_selector_custom_items_info5a'));
$tpl->setVariable('5b', $lng->txt('char_selector_custom_items_info5b'));
$tpl->setVariable('6a', $lng->txt('char_selector_custom_items_info6a'));
$tpl->setVariable('6b', $lng->txt('char_selector_custom_items_info6b'));
$custom_items->setInfo($tpl->get());
$enabled->addSubItem($custom_items);
switch ($this->config->getContext()) {
case ilCharSelectorConfig::CONTEXT_ADMIN:
$availability->addOption($inactive);
$availability->addOption($enabled);
$availability->addOption($disabled);
$a_form->addItem($availability);
break;
case ilCharSelectorConfig::CONTEXT_USER:
case ilCharSelectorConfig::CONTEXT_TEST:
$availability->addOption($inherit);
$availability->addOption($enabled);
$availability->addOption($disabled);
$a_form->addItem($availability);
break;
}
}
示例15: addCustomEditForm
protected function addCustomEditForm(ilPropertyFormGUI $a_form)
{
$radio_grp = new ilRadioGroupInputGUI($this->lng->txt('ecs_availability'), 'activation_type');
$radio_grp->setValue($this->object->getAvailabilityType());
$radio_grp->setDisabled(true);
$radio_opt = new ilRadioOption($this->lng->txt('offline'), ilObjRemoteLearningModule::ACTIVATION_OFFLINE);
$radio_grp->addOption($radio_opt);
$radio_opt = new ilRadioOption($this->lng->txt('online'), ilObjRemoteLearningModule::ACTIVATION_ONLINE);
$radio_grp->addOption($radio_opt);
$a_form->addItem($radio_grp);
}