本文整理汇总了PHP中ilCheckboxInputGUI::setDisabled方法的典型用法代码示例。如果您正苦于以下问题:PHP ilCheckboxInputGUI::setDisabled方法的具体用法?PHP ilCheckboxInputGUI::setDisabled怎么用?PHP ilCheckboxInputGUI::setDisabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilCheckboxInputGUI
的用法示例。
在下文中一共展示了ilCheckboxInputGUI::setDisabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dInitFormTreeSettings
/**
* Init form settings
*/
protected function dInitFormTreeSettings(ilPropertyFormGUI $form = null)
{
include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
if ($form instanceof ilPropertyFormGUI) {
return $form;
}
include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
$assignment = new ilECSNodeMappingAssignment($this->getServer()->getServerId(), $this->getMid(), (int) $_REQUEST['tid'], 0);
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, 'dEditTree'));
$form->setTitle($this->lng->txt('general_settings'));
$form->addCommandButton('dUpdateTreeSettings', $this->lng->txt('save'));
$form->addCommandButton('dTrees', $this->lng->txt('cancel'));
$form->setTableWidth('30%');
// CMS id (readonly)
include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
$cmsid = new ilNumberInputGUI($this->lng->txt('ecs_cms_id'), 'cmsid');
$cmsid->setValue(ilECSCmsData::lookupCmsId(ilECSCmsTree::lookupRootId((int) $_REQUEST['tid'])));
$cmsid->setDisabled(true);
$cmsid->setSize(7);
$cmsid->setMaxLength(12);
$form->addItem($cmsid);
$mapping_status = ilECSMappingUtils::lookupMappingStatus($this->getServer()->getServerId(), $this->getMid(), (int) $_REQUEST['tid']);
$mapping_advanced = $mapping_status != ilECSMappingUtils::MAPPED_MANUAL ? true : false;
// Status (readonly)
$status = new ilNonEditableValueGUI($this->lng->txt('status'), '');
$status->setValue(ilECSMappingUtils::mappingStatusToString($mapping_status));
$form->addItem($status);
// title update
$title = new ilCheckboxInputGUI($this->lng->txt('ecs_title_updates'), 'title');
$title->setValue(1);
$title->setChecked($assignment->isTitleUpdateEnabled());
#$title->setInfo($this->lng->txt('ecs_title_update_info'));
$form->addItem($title);
$position = new ilCheckboxInputGUI($this->lng->txt('ecs_position_updates'), 'position');
$position->setDisabled(!$mapping_advanced);
$position->setChecked($mapping_advanced && $assignment->isPositionUpdateEnabled());
$position->setValue(1);
#$position->setInfo($this->lng->txt('ecs_position_update_info'));
$form->addItem($position);
$tree = new ilCheckboxInputGUI($this->lng->txt('ecs_tree_updates'), 'tree');
$tree->setDisabled(!$mapping_advanced);
$tree->setChecked($mapping_advanced && $assignment->isTreeUpdateEnabled());
$tree->setValue(1);
#$tree->setInfo($this->lng->txt('ecs_tree_update_info'));
$form->addItem($tree);
return $form;
}
示例2: initPropertiesForm
//.........这里部分代码省略.........
// scorm options
//
$sh = new ilFormSectionHeaderGUI();
$sh->setTitle($this->lng->txt("cont_scorm_options"));
$this->form->addItem($sh);
// max attempts
$ni = new ilNumberInputGUI($this->lng->txt("cont_sc_max_attempt"), "max_attempt");
$ni->setMaxLength(3);
$ni->setSize(3);
$ni->setValue($this->object->getMaxAttempt());
$this->form->addItem($ni);
// lesson mode
$options = array("normal" => $this->lng->txt("cont_sc_less_mode_normal"), "browse" => $this->lng->txt("cont_sc_less_mode_browse"));
$si = new ilSelectInputGUI($this->lng->txt("cont_def_lesson_mode"), "lesson_mode");
$si->setOptions($options);
$si->setValue($this->object->getDefaultLessonMode());
$this->form->addItem($si);
// credit mode
$options = array("credit" => $this->lng->txt("cont_credit_on"), "no_credit" => $this->lng->txt("cont_credit_off"));
$si = new ilSelectInputGUI($this->lng->txt("cont_credit_mode"), "credit_mode");
$si->setOptions($options);
$si->setValue($this->object->getCreditMode());
$si->setInfo($this->lng->txt("cont_credit_mode_info"));
$this->form->addItem($si);
// set lesson mode review when completed
$options = array("n" => $this->lng->txt("cont_sc_auto_review_no"), "r" => $this->lng->txt("cont_sc_auto_review_completed_not_failed_or_passed"), "p" => $this->lng->txt("cont_sc_auto_review_passed"), "q" => $this->lng->txt("cont_sc_auto_review_passed_or_failed"), "c" => $this->lng->txt("cont_sc_auto_review_completed"), "d" => $this->lng->txt("cont_sc_auto_review_completed_and_passed"), "y" => $this->lng->txt("cont_sc_auto_review_completed_or_passed"));
$si = new ilSelectInputGUI($this->lng->txt("cont_sc_auto_review_2004"), "auto_review");
$si->setOptions($options);
$si->setValue($this->object->getAutoReviewChar());
$si->setInfo($this->lng->txt("cont_sc_auto_review_info_2004"));
$this->form->addItem($si);
//
// rte settings
//
$sh = new ilFormSectionHeaderGUI();
$sh->setTitle($this->lng->txt("cont_rte_settings"));
$this->form->addItem($sh);
// unlimited session timeout
$cb = new ilCheckboxInputGUI($this->lng->txt("cont_sc_usession"), "cobj_session");
$cb->setValue("y");
$cb->setChecked($this->object->getSession());
$cb->setInfo($this->lng->txt("cont_sc_usession_info"));
$this->form->addItem($cb);
// sequencing
$cb = new ilCheckboxInputGUI($this->lng->txt("cont_sequencing"), "cobj_sequencing");
$cb->setValue("y");
$cb->setChecked($this->object->getSequencing());
$cb->setInfo($this->lng->txt("cont_sequencing_info"));
$this->form->addItem($cb);
// storage of interactions
$cb = new ilCheckboxInputGUI($this->lng->txt("cont_interactions"), "cobj_interactions");
$cb->setValue("y");
$cb->setChecked($this->object->getInteractions());
$this->form->addItem($cb);
// objectives
$cb = new ilCheckboxInputGUI($this->lng->txt("cont_objectives"), "cobj_objectives");
$cb->setValue("y");
$cb->setChecked($this->object->getObjectives());
$this->form->addItem($cb);
// comments
$cb = new ilCheckboxInputGUI($this->lng->txt("cont_comments"), "cobj_comments");
$cb->setValue("y");
$cb->setChecked($this->object->getComments());
$this->form->addItem($cb);
// time from lms
$cb = new ilCheckboxInputGUI($this->lng->txt("cont_time_from_lms"), "cobj_time_from_lms");
$cb->setValue("y");
$cb->setChecked($this->object->getTime_from_lms());
$cb->setInfo($this->lng->txt("cont_time_from_lms_info"));
$this->form->addItem($cb);
// check values
$cb = new ilCheckboxInputGUI($this->lng->txt("cont_check_values"), "cobj_check_values");
$cb->setValue("y");
$cb->setChecked($this->object->getCheck_values());
$this->form->addItem($cb);
// auto cmi.exit to suspend
$cb = new ilCheckboxInputGUI($this->lng->txt("cont_auto_suspend"), "cobj_auto_suspend");
$cb->setValue("y");
$cb->setChecked($this->object->getAutoSuspend());
$cb->setInfo($this->lng->txt("cont_auto_suspend_info"));
$this->form->addItem($cb);
//
// debugging
//
$sh = new ilFormSectionHeaderGUI();
$sh->setTitle($this->lng->txt("cont_debugging"));
$this->form->addItem($sh);
// test tool
$cb = new ilCheckboxInputGUI($this->lng->txt("cont_debug"), "cobj_debug");
$cb->setValue("y");
$cb->setChecked($this->object->getDebug());
if ($this->object->getDebugActivated() == false) {
$cb->setDisabled(true);
$cb->setInfo($this->lng->txt("cont_debug_deactivated"));
} else {
$cb->setInfo($this->lng->txt("cont_debug_deactivate"));
}
$this->form->addItem($cb);
$this->form->addCommandButton("saveProperties", $lng->txt("save"));
}
示例3: createUserAgreementCheckBox
/**
* Generate and always set the user agreement checkbox.
*
* @return \ilCheckboxInputGUI
*/
private function createUserAgreementCheckBox()
{
$agreement_id = $this->book->getRoomAgreementFileId();
$link = $this->getFileLinkForUserAgreementId($agreement_id);
$title = $this->lng->txt("rep_robj_xrs_rooms_user_agreement_accept");
$checkbox_agreement = new ilCheckboxInputGUI($title, "accept_room_rules");
$checkbox_agreement->setRequired(true);
$checkbox_agreement->setOptionTitle($link);
$checkbox_agreement->setChecked(true);
$checkbox_agreement->setValue(1);
$checkbox_agreement->setDisabled(true);
return $checkbox_agreement;
}
示例4: showSecurity
/**
* Show Privacy settings
*
* @access public
*/
public function showSecurity()
{
global $ilSetting, $ilUser, $rbacreview;
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$security = ilSecuritySettings::_getInstance();
$this->tabs_gui->setTabActive('show_security');
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt('ps_security_protection'));
// Form checkbox
$check = new ilCheckboxInputGUI($this->lng->txt('ps_auto_https'), 'auto_https_detect_enabled');
$check->setOptionTitle($this->lng->txt('ps_auto_https_description'));
$check->setChecked($security->isAutomaticHTTPSEnabled() ? 1 : 0);
$check->setValue(1);
$text = new ilTextInputGUI($this->lng->txt('ps_auto_https_header_name'), 'auto_https_detect_header_name');
$text->setValue($security->getAutomaticHTTPSHeaderName());
$text->setSize(24);
$text->setMaxLength(64);
$check->addSubItem($text);
$text = new ilTextInputGUI($this->lng->txt('ps_auto_https_header_value'), 'auto_https_detect_header_value');
$text->setValue($security->getAutomaticHTTPSHeaderValue());
$text->setSize(24);
$text->setMaxLength(64);
$check->addSubItem($text);
$form->addItem($check);
$check2 = new ilCheckboxInputGUI($this->lng->txt('activate_https'), 'https_enabled');
$check2->setChecked($security->isHTTPSEnabled() ? 1 : 0);
$check2->setValue(1);
$form->addItem($check2);
$radio_group = new ilRadioGroupInputGUI($this->lng->txt('ps_account_security_mode'), 'account_security_mode');
$radio_group->setValue($security->getAccountSecurityMode());
$radio_opt = new ilRadioOption($this->lng->txt('ps_account_security_mode_default'), ilSecuritySettings::ACCOUNT_SECURITY_MODE_DEFAULT);
$radio_group->addOption($radio_opt);
$radio_opt = new ilRadioOption($this->lng->txt('ps_account_security_mode_customized'), ilSecuritySettings::ACCOUNT_SECURITY_MODE_CUSTOMIZED);
$check = new ilCheckboxInputGUI($this->lng->txt('ps_password_chars_and_numbers_enabled'), 'password_chars_and_numbers_enabled');
$check->setChecked($security->isPasswordCharsAndNumbersEnabled() ? 1 : 0);
//$check->setOptionTitle($this->lng->txt('ps_password_chars_and_numbers_enabled'));
$check->setInfo($this->lng->txt('ps_password_chars_and_numbers_enabled_info'));
$radio_opt->addSubItem($check);
$check = new ilCheckboxInputGUI($this->lng->txt('ps_password_special_chars_enabled'), 'password_special_chars_enabled');
$check->setChecked($security->isPasswordSpecialCharsEnabled() ? 1 : 0);
//$check->setOptionTitle($this->lng->txt('ps_password_special_chars_enabled'));
$check->setInfo($this->lng->txt('ps_password_special_chars_enabled_info'));
$radio_opt->addSubItem($check);
$text = new ilTextInputGUI($this->lng->txt('ps_password_min_length'), 'password_min_length');
$text->setInfo($this->lng->txt('ps_password_min_length_info'));
$text->setValue($security->getPasswordMinLength());
$text->setSize(1);
$text->setMaxLength(2);
$radio_opt->addSubItem($text);
$text = new ilTextInputGUI($this->lng->txt('ps_password_max_length'), 'password_max_length');
$text->setInfo($this->lng->txt('ps_password_max_length_info'));
$text->setValue($security->getPasswordMaxLength());
$text->setSize(2);
$text->setMaxLength(3);
$radio_opt->addSubItem($text);
$text = new ilTextInputGUI($this->lng->txt('ps_password_max_age'), 'password_max_age');
$text->setInfo($this->lng->txt('ps_password_max_age_info'));
$text->setValue($security->getPasswordMaxAge());
$text->setSize(2);
$text->setMaxLength(3);
$radio_opt->addSubItem($text);
$text = new ilTextInputGUI($this->lng->txt('ps_login_max_attempts'), 'login_max_attempts');
$text->setInfo($this->lng->txt('ps_login_max_attempts_info'));
$text->setValue($security->getLoginMaxAttempts());
$text->setSize(1);
$text->setMaxLength(2);
$radio_opt->addSubItem($text);
$radio_group->addOption($radio_opt);
$form->addItem($radio_group);
$check = new ilCheckboxInputGUI($this->lng->txt('ps_password_change_on_first_login_enabled'), 'password_change_on_first_login_enabled');
$check->setInfo($this->lng->txt('ps_password_change_on_first_login_enabled_info'));
$check->setChecked($security->isPasswordChangeOnFirstLoginEnabled() ? 1 : 0);
$form->addItem($check);
// file suffix replacement
$ti = new ilTextInputGUI($this->lng->txt("file_suffix_repl"), "suffix_repl_additional");
$ti->setMaxLength(200);
$ti->setSize(40);
$ti->setInfo($this->lng->txt("file_suffix_repl_info") . " " . SUFFIX_REPL_DEFAULT);
$ti->setValue($ilSetting->get("suffix_repl_additional"));
$form->addItem($ti);
// prevent login from multiple pcs at the same time
$objCb = new ilCheckboxInputGUI($this->lng->txt('ps_prevent_simultaneous_logins'), 'ps_prevent_simultaneous_logins');
$objCb->setChecked((int) $security->isPreventionOfSimultaneousLoginsEnabled());
$objCb->setValue(1);
$objCb->setOptionTitle($this->lng->txt('ps_prevent_simultaneous_logins_info'));
$form->addItem($objCb);
// protected admin
$admin = new ilCheckboxInputGUI($GLOBALS['lng']->txt('adm_adm_role_protect'), 'admin_role');
$admin->setDisabled(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID));
$admin->setInfo($GLOBALS['lng']->txt('adm_adm_role_protect_info'));
$admin->setChecked((int) $security->isAdminRoleProtected());
$admin->setValue(1);
$form->addItem($admin);
$form->addCommandButton('save_security', $this->lng->txt('save'));
//.........这里部分代码省略.........
示例5: initForm
//.........这里部分代码省略.........
if (!$a_as_milestone) {
include_once './Services/Form/classes/class.ilDateDurationInputGUI.php';
$tpl->addJavaScript('./Services/Form/js/date_duration.js');
$dur = new ilDateDurationInputGUI($this->lng->txt('cal_fullday'), 'event');
$dur->setStartText($this->lng->txt('cal_start'));
$dur->setEndText($this->lng->txt('cal_end'));
$dur->enableToggleFullTime($this->lng->txt('cal_fullday_title'), $this->app->isFullday() ? true : false);
$dur->setShowTime(true);
$dur->setStart($this->app->getStart());
$dur->setEnd($this->app->getEnd());
$this->form->addItem($dur);
// recurrence
include_once './Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php';
$rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence');
$rec->setRecurrence($this->rec);
$this->form->addItem($rec);
// location
$where = new ilTextInputGUI($this->lng->txt('cal_where'), 'location');
$where->setValue($this->app->getLocation());
$where->setMaxLength(128);
$where->setSize(32);
$this->form->addItem($where);
} else {
$deadline = new ilDateTimeInputGUI($this->lng->txt('cal_deadline'), 'event[start]');
$deadline->setDate($this->app->getStart());
$deadline->setShowTime(false);
$deadline->setMinuteStepSize(5);
$this->form->addItem($deadline);
// completion
$completion_vals = array();
for ($i = 0; $i <= 100; $i += 5) {
$completion_vals[$i] = $i . " %";
}
$compl = new ilSelectInputGUI($this->lng->txt('cal_task_completion'), 'completion');
$compl->setOptions($completion_vals);
$compl->setValue($this->app->getCompletion());
$this->form->addItem($compl);
}
$desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
$desc->setValue($this->app->getDescription());
$desc->setRows(5);
$this->form->addItem($desc);
if ($a_as_milestone && $a_mode == "edit" && $resp_info) {
// users responsible
$users = $this->app->readResponsibleUsers();
$resp = new ilNonEditableValueGUI($this->lng->txt('cal_responsible'), $users);
$delim = "";
foreach ($users as $r) {
$value .= $delim . $r["lastname"] . ", " . $r["firstname"] . " [" . $r["login"] . "]";
$delim = "<br />";
}
if (count($users) > 0) {
$resp->setValue($value);
} else {
$resp->setValue("-");
}
$this->form->addItem($resp);
}
if (ilCalendarSettings::_getInstance()->isUserNotificationEnabled()) {
$notu = new ilTextWizardInputGUI($this->lng->txt('cal_user_notification'), 'notu');
$notu->setInfo($this->lng->txt('cal_user_notification_info'));
$notu->setSize(20);
$notu->setMaxLength(64);
$values = array();
foreach ($this->notification->getRecipients() as $rcp) {
switch ($rcp['type']) {
case ilCalendarUserNotification::TYPE_USER:
$values[] = ilObjUser::_lookupLogin($rcp['usr_id']);
break;
case ilCalendarUserNotification::TYPE_EMAIL:
$values[] = $rcp['email'];
break;
}
}
if (count($values)) {
$notu->setValues($values);
} else {
$notu->setValues(array(''));
}
$this->form->addItem($notu);
}
// Notifications
include_once './Services/Calendar/classes/class.ilCalendarSettings.php';
if (ilCalendarSettings::_getInstance()->isNotificationEnabled() and count($cats->getNotificationCalendars())) {
$selected_cal = new ilCalendarCategory($selected_calendar);
$disabled = true;
if ($selected_cal->getType() == ilCalendarCategory::TYPE_OBJ) {
if (ilObject::_lookupType($selected_cal->getObjId()) == 'crs' or ilObject::_lookupType($selected_cal->getObjId()) == 'grp') {
$disabled = false;
}
}
$tpl->addJavaScript('./Services/Calendar/js/toggle_notification.js');
$not = new ilCheckboxInputGUI($this->lng->txt('cal_cg_notification'), 'not');
$not->setInfo($this->lng->txt('cal_notification_info'));
$not->setValue(1);
$not->setChecked($this->app->isNotificationEnabled());
$not->setDisabled($disabled);
$this->form->addItem($not);
}
}
示例6: editQuestion
//.........这里部分代码省略.........
foreach ($unit_options as $unit_id => $txt) {
if ($this->hasResultUnit($result, $unit_id, $result_units)) {
$selectedvalues[] = $unit_id;
}
}
$mc_result_units->setValue($selectedvalues);
$result_type = new ilRadioGroupInputGUI($this->lng->txt('result_type_selection'), 'result_type_' . $result->getResult());
$result_type->setRequired(true);
$no_type = new ilRadioOption($this->lng->txt('no_result_type'), 0);
$no_type->setInfo($this->lng->txt('fq_no_restriction_info'));
$result_dec = new ilRadioOption($this->lng->txt('result_dec'), 1);
$result_dec->setInfo($this->lng->txt('result_dec_info'));
$result_frac = new ilRadioOption($this->lng->txt('result_frac'), 2);
$result_frac->setInfo($this->lng->txt('result_frac_info'));
$result_co_frac = new ilRadioOption($this->lng->txt('result_co_frac'), 3);
$result_co_frac->setInfo($this->lng->txt('result_co_frac_info'));
$result_type->addOption($no_type);
$result_type->addOption($result_dec);
$result_type->addOption($result_frac);
$result_type->addOption($result_co_frac);
$result_type->setValue(strlen($result->getResultType()) ? $result->getResultType() : 0);
$points = new ilNumberInputGUI($this->lng->txt('points'), 'points_' . $result->getResult());
$points->allowDecimals(true);
$points->setRequired(true);
$points->setSize(3);
$points->setMinValue(0);
$points->setValue(strlen($result->getPoints()) ? $result->getPoints() : 1);
$rating_type = new ilCheckboxInputGUI($this->lng->txt('advanced_rating'), 'rating_advanced_' . $result->getResult());
$rating_type->setValue(1);
$rating_type->setInfo($this->lng->txt('advanced_rating_info'));
if (!$save) {
$advanced_rating = $this->canUseAdvancedRating($result);
if (!$advanced_rating) {
$rating_type->setDisabled(true);
$rating_type->setChecked(false);
} else {
$rating_type->setChecked(strlen($result->getRatingSimple()) && $result->getRatingSimple() ? false : true);
}
}
$sign = new ilNumberInputGUI($this->lng->txt('rating_sign'), 'rating_sign_' . $result->getResult());
$sign->setRequired(true);
$sign->setSize(3);
$sign->setMinValue(0);
$sign->setValue($result->getRatingSign());
$rating_type->addSubItem($sign);
$value = new ilNumberInputGUI($this->lng->txt('rating_value'), 'rating_value_' . $result->getResult());
$value->setRequired(true);
$value->setSize(3);
$value->setMinValue(0);
$value->setValue($result->getRatingValue());
$rating_type->addSubItem($value);
$unit = new ilNumberInputGUI($this->lng->txt('rating_unit'), 'rating_unit_' . $result->getResult());
$unit->setRequired(true);
$unit->setSize(3);
$unit->setMinValue(0);
$unit->setValue($result->getRatingUnit());
$rating_type->addSubItem($unit);
$info_text = new ilNonEditableValueGUI($this->lng->txt('additional_rating_info'));
$rating_type->addSubItem($info_text);
$form->addItem($result_header);
$form->addItem($formula);
$form->addItem($range_min);
$form->addItem($range_max);
$form->addItem($suggest_range_button);
$form->addItem($precision);
$form->addItem($tolerance);
示例7: initGeneralSettingsForm
/**
* Init general settings form.
*
*/
public function initGeneralSettingsForm()
{
global $lng, $ilUser, $styleDefinition, $ilSetting;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form = new ilPropertyFormGUI();
// language
if ($this->userSettingVisible("language")) {
$languages = $this->lng->getInstalledLanguages();
$options = array();
foreach ($languages as $lang_key) {
$options[$lang_key] = ilLanguage::_lookupEntry($lang_key, "meta", "meta_l_" . $lang_key);
}
$si = new ilSelectInputGUI($this->lng->txt("language"), "language");
$si->setOptions($options);
$si->setValue($ilUser->getLanguage());
$si->setDisabled($ilSetting->get("usr_settings_disable_language"));
$this->form->addItem($si);
}
// skin/style
include_once "./Services/Style/classes/class.ilObjStyleSettings.php";
if ($this->userSettingVisible("skin_style")) {
$templates = $styleDefinition->getAllTemplates();
if (is_array($templates)) {
$si = new ilSelectInputGUI($this->lng->txt("skin_style"), "skin_style");
$options = array();
foreach ($templates as $template) {
// get styles information of template
$styleDef = new ilStyleDefinition($template["id"]);
$styleDef->startParsing();
$styles = $styleDef->getStyles();
foreach ($styles as $style) {
if (!ilObjStyleSettings::_lookupActivatedStyle($template["id"], $style["id"])) {
continue;
}
$options[$template["id"] . ":" . $style["id"]] = $styleDef->getTemplateName() . " / " . $style["name"];
}
}
$si->setOptions($options);
$si->setValue($ilUser->skin . ":" . $ilUser->prefs["style"]);
$si->setDisabled($ilSetting->get("usr_settings_disable_skin_style"));
$this->form->addItem($si);
}
}
// screen reader optimization
if ($this->userSettingVisible("screen_reader_optimization")) {
$cb = new ilCheckboxInputGUI($this->lng->txt("user_screen_reader_optimization"), "screen_reader_optimization");
$cb->setChecked($ilUser->prefs["screen_reader_optimization"]);
$cb->setDisabled($ilSetting->get("usr_settings_disable_screen_reader_optimization"));
$cb->setInfo($this->lng->txt("user_screen_reader_optimization_info"));
$this->form->addItem($cb);
}
// hits per page
if ($this->userSettingVisible("hits_per_page")) {
$si = new ilSelectInputGUI($this->lng->txt("hits_per_page"), "hits_per_page");
$hits_options = array(10, 15, 20, 30, 40, 50, 100, 9999);
$options = array();
foreach ($hits_options as $hits_option) {
$hstr = $hits_option == 9999 ? $this->lng->txt("no_limit") : $hits_option;
$options[$hits_option] = $hstr;
}
$si->setOptions($options);
$si->setValue($ilUser->prefs["hits_per_page"]);
$si->setDisabled($ilSetting->get("usr_settings_disable_hits_per_page"));
$this->form->addItem($si);
}
// Users Online
if ($this->userSettingVisible("show_users_online")) {
$si = new ilSelectInputGUI($this->lng->txt("show_users_online"), "show_users_online");
$options = array("y" => $this->lng->txt("users_online_show_y"), "associated" => $this->lng->txt("users_online_show_associated"), "n" => $this->lng->txt("users_online_show_n"));
$si->setOptions($options);
$si->setValue($ilUser->prefs["show_users_online"]);
$si->setDisabled($ilSetting->get("usr_settings_disable_show_users_online"));
$this->form->addItem($si);
}
// Store last visited
$lv = new ilSelectInputGUI($this->lng->txt("user_store_last_visited"), "store_last_visited");
$options = array(0 => $this->lng->txt("user_lv_keep_entries"), 1 => $this->lng->txt("user_lv_keep_only_for_session"), 2 => $this->lng->txt("user_lv_do_not_store"));
$lv->setOptions($options);
$lv->setValue((int) $ilUser->prefs["store_last_visited"]);
$this->form->addItem($lv);
// hide_own_online_status
if ($this->userSettingVisible("hide_own_online_status")) {
$cb = new ilCheckboxInputGUI($this->lng->txt("hide_own_online_status"), "hide_own_online_status");
$cb->setChecked($ilUser->prefs["hide_own_online_status"] == "y");
$cb->setDisabled($ilSetting->get("usr_settings_disable_hide_own_online_status"));
$this->form->addItem($cb);
}
include_once 'Services/Authentication/classes/class.ilSessionReminder.php';
if (ilSessionReminder::isGloballyActivated()) {
$cb = new ilCheckboxInputGUI($this->lng->txt('session_reminder'), 'session_reminder_enabled');
$cb->setInfo($this->lng->txt('session_reminder_info'));
$cb->setValue(1);
$cb->setChecked((int) $ilUser->getPref('session_reminder_enabled'));
$expires = ilSession::getSessionExpireValue();
$lead_time_gui = new ilNumberInputGUI($this->lng->txt('session_reminder_lead_time'), 'session_reminder_lead_time');
$lead_time_gui->setInfo(sprintf($this->lng->txt('session_reminder_lead_time_info'), ilFormat::_secondsToString($expires, true)));
//.........这里部分代码省略.........
示例8: initFormSubstitutions
/**
* init form table 'substitutions'
*
* @access protected
*/
protected function initFormSubstitutions()
{
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
if (!($visible_records = ilAdvancedMDRecord::_getAllRecordsByObjectType())) {
return;
}
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this));
#$this->form->setTableWidth('100%');
// substitution
foreach ($visible_records as $obj_type => $records) {
$perm = null;
// :TODO: hardwird ?
if (in_array($obj_type, array("crs", "cat"))) {
$perm = $this->getPermissions()->hasPermissions(ilAdvancedMDPermissionHelper::CONTEXT_SUBSTITUTION, $obj_type, array(ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_SHOW_DESCRIPTION, ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_SHOW_FIELDNAMES, ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_FIELD_POSITIONS));
}
include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDSubstitution.php';
$sub = ilAdvancedMDSubstitution::_getInstanceByObjectType($obj_type);
// Show section
$section = new ilFormSectionHeaderGUI();
$section->setTitle($this->lng->txt('objs_' . $obj_type));
$this->form->addItem($section);
$check = new ilCheckboxInputGUI($this->lng->txt('description'), 'enabled_desc_' . $obj_type);
$check->setValue(1);
$check->setOptionTitle($this->lng->txt('md_adv_desc_show'));
$check->setChecked($sub->isDescriptionEnabled() ? true : false);
$this->form->addItem($check);
if ($perm && !$perm[ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_SHOW_DESCRIPTION]) {
$check->setDisabled(true);
}
$check = new ilCheckboxInputGUI($this->lng->txt('md_adv_field_names'), 'enabled_field_names_' . $obj_type);
$check->setValue(1);
$check->setOptionTitle($this->lng->txt('md_adv_fields_show'));
$check->setChecked($sub->enabledFieldNames() ? true : false);
$this->form->addItem($check);
if ($perm && !$perm[ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_SHOW_FIELDNAMES]) {
$check->setDisabled(true);
}
#$area = new ilTextAreaInputGUI($this->lng->txt('md_adv_substitution'),'substitution_'.$obj_type);
#$area->setUseRte(true);
#$area->setRteTagSet('standard');
#$area->setValue(ilUtil::prepareFormOutput($sub->getSubstitutionString()));
#$area->setRows(5);
#$area->setCols(80);
#$this->form->addItem($area);
if ($perm) {
$perm_pos = $perm[ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_FIELD_POSITIONS];
}
$definitions = ilAdvancedMDFieldDefinition::getInstancesByObjType($obj_type);
$definitions = $sub->sortDefinitions($definitions);
$counter = 1;
foreach ($definitions as $def) {
$definition_id = $def->getFieldId();
$perm = $this->getSubstitutionFieldPermissions($obj_type, $definition_id);
$title = ilAdvancedMDRecord::_lookupTitle($def->getRecordId());
$title = $def->getTitle() . ' (' . $title . ')';
$check = new ilCheckboxInputGUI($title, 'show[' . $obj_type . '][' . $definition_id . ']');
$check->setValue(1);
$check->setOptionTitle($this->lng->txt('md_adv_show'));
$check->setChecked($sub->isSubstituted($definition_id));
if ($perm && !$perm["show"]) {
$check->setDisabled(true);
}
$pos = new ilNumberInputGUI($this->lng->txt('position'), 'position[' . $obj_type . '][' . $definition_id . ']');
$pos->setSize(3);
$pos->setMaxLength(4);
$pos->allowDecimals(true);
$pos->setValue(sprintf('%.1f', $counter++));
$check->addSubItem($pos);
if ($perm && !$perm_pos) {
$pos->setDisabled(true);
}
$bold = new ilCheckboxInputGUI($this->lng->txt('bold'), 'bold[' . $obj_type . '][' . $definition_id . ']');
$bold->setValue(1);
$bold->setChecked($sub->isBold($definition_id));
$check->addSubItem($bold);
if ($perm && !$perm["bold"]) {
$bold->setDisabled(true);
}
$bold = new ilCheckboxInputGUI($this->lng->txt('newline'), 'newline[' . $obj_type . '][' . $definition_id . ']');
$bold->setValue(1);
$bold->setChecked($sub->hasNewline($definition_id));
$check->addSubItem($bold);
if ($perm && !$perm["newline"]) {
$bold->setDisabled(true);
}
$this->form->addItem($check);
}
// placeholder
/*
$custom = new ilCustomInputGUI($this->lng->txt('md_adv_placeholders'));
$tpl = new ilTemplate('tpl.placeholder_info.html',true,true,'Services/AdvancedMetaData');
foreach($records as $record)
{
foreach(ilAdvancedMDFieldDefinition::_getDefinitionsByRecordId($record->getRecordId()) as $definition)
//.........这里部分代码省略.........
示例9: addResultDetailsSettingsFormSection
//.........这里部分代码省略.........
// show solution feedback ==> solution feedback in test results
$showSolutionFeedbackOption = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_feedback'), 'solution_feedback');
$showSolutionFeedbackOption->setInfo($this->lng->txt('tst_show_solution_feedback_desc'));
$showSolutionFeedbackOption->setChecked($this->testOBJ->getShowSolutionFeedback());
$form->addItem($showSolutionFeedbackOption);
// show suggested solution
$showSuggestedSolutionOption = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_suggested'), 'solution_suggested');
$showSuggestedSolutionOption->setInfo($this->lng->txt('tst_show_solution_suggested_desc'));
$showSuggestedSolutionOption->setChecked($this->testOBJ->getShowSolutionSuggested());
$form->addItem($showSuggestedSolutionOption);
// show solution printview ==> list of answers
$showSolutionPrintview = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_printview'), 'solution_printview');
$showSolutionPrintview->setInfo($this->lng->txt('tst_show_solution_printview_desc'));
$showSolutionPrintview->setChecked($this->testOBJ->getShowSolutionPrintview());
$form->addItem($showSolutionPrintview);
// show best solution in list of answers
$solutionCompareInput = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_compare'), 'solution_compare');
$solutionCompareInput->setChecked($this->testOBJ->getShowSolutionListComparison());
$showSolutionPrintview->addSubItem($solutionCompareInput);
// solution answers only ==> printview of results (answers only)
$solutionAnswersOnly = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_answers_only'), 'solution_answers_only');
$solutionAnswersOnly->setInfo($this->lng->txt('tst_show_solution_answers_only_desc'));
$solutionAnswersOnly->setChecked($this->testOBJ->getShowSolutionAnswersOnly());
$showSolutionPrintview->addSubItem($solutionAnswersOnly);
// high score
$highscore = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_enabled"), "highscore_enabled");
$highscore->setValue(1);
$highscore->setChecked($this->testOBJ->getHighscoreEnabled());
$highscore->setInfo($this->lng->txt("tst_highscore_description"));
$form->addItem($highscore);
$highscore_tables = new ilRadioGroupInputGUI($this->lng->txt('tst_highscore_mode'), 'highscore_mode');
$highscore_tables->setRequired(true);
$highscore_tables->setValue($this->testOBJ->getHighscoreMode());
$highscore_table_own = new ilRadioOption($this->lng->txt('tst_highscore_own_table'), ilObjTest::HIGHSCORE_SHOW_OWN_TABLE);
$highscore_table_own->setInfo($this->lng->txt('tst_highscore_own_table_description'));
$highscore_tables->addOption($highscore_table_own);
$highscore_table_other = new ilRadioOption($this->lng->txt('tst_highscore_top_table'), ilObjTest::HIGHSCORE_SHOW_TOP_TABLE);
$highscore_table_other->setInfo($this->lng->txt('tst_highscore_top_table_description'));
$highscore_tables->addOption($highscore_table_other);
$highscore_table_other = new ilRadioOption($this->lng->txt('tst_highscore_all_tables'), ilObjTest::HIGHSCORE_SHOW_ALL_TABLES);
$highscore_table_other->setInfo($this->lng->txt('tst_highscore_all_tables_description'));
$highscore_tables->addOption($highscore_table_other);
$highscore->addSubItem($highscore_tables);
$highscore_top_num = new ilNumberInputGUI($this->lng->txt("tst_highscore_top_num"), "highscore_top_num");
$highscore_top_num->setSize(4);
$highscore_top_num->setRequired(true);
$highscore_top_num->setMinValue(1);
$highscore_top_num->setSuffix($this->lng->txt("tst_highscore_top_num_unit"));
$highscore_top_num->setValue($this->testOBJ->getHighscoreTopNum(null));
$highscore_top_num->setInfo($this->lng->txt("tst_highscore_top_num_description"));
$highscore->addSubItem($highscore_top_num);
$highscore_anon = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_anon"), "highscore_anon");
$highscore_anon->setValue(1);
$highscore_anon->setChecked($this->testOBJ->getHighscoreAnon());
$highscore_anon->setInfo($this->lng->txt("tst_highscore_anon_description"));
$highscore->addSubItem($highscore_anon);
$highscore_achieved_ts = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_achieved_ts"), "highscore_achieved_ts");
$highscore_achieved_ts->setValue(1);
$highscore_achieved_ts->setChecked($this->testOBJ->getHighscoreAchievedTS());
$highscore_achieved_ts->setInfo($this->lng->txt("tst_highscore_achieved_ts_description"));
$highscore->addSubItem($highscore_achieved_ts);
$highscore_score = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_score"), "highscore_score");
$highscore_score->setValue(1);
$highscore_score->setChecked($this->testOBJ->getHighscoreScore());
$highscore_score->setInfo($this->lng->txt("tst_highscore_score_description"));
$highscore->addSubItem($highscore_score);
$highscore_percentage = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_percentage"), "highscore_percentage");
$highscore_percentage->setValue(1);
$highscore_percentage->setChecked($this->testOBJ->getHighscorePercentage());
$highscore_percentage->setInfo($this->lng->txt("tst_highscore_percentage_description"));
$highscore->addSubItem($highscore_percentage);
$highscore_hints = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_hints"), "highscore_hints");
$highscore_hints->setValue(1);
$highscore_hints->setChecked($this->testOBJ->getHighscoreHints());
$highscore_hints->setInfo($this->lng->txt("tst_highscore_hints_description"));
$highscore->addSubItem($highscore_hints);
$highscore_wtime = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_wtime"), "highscore_wtime");
$highscore_wtime->setValue(1);
$highscore_wtime->setChecked($this->testOBJ->getHighscoreWTime());
$highscore_wtime->setInfo($this->lng->txt("tst_highscore_wtime_description"));
$highscore->addSubItem($highscore_wtime);
// show signature placeholder
$showSignaturePlaceholder = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_signature'), 'solution_signature');
$showSignaturePlaceholder->setInfo($this->lng->txt('tst_show_solution_signature_desc'));
$showSignaturePlaceholder->setChecked($this->testOBJ->getShowSolutionSignature());
if ($this->testOBJ->getAnonymity()) {
$showSignaturePlaceholder->setDisabled(true);
}
$form->addItem($showSignaturePlaceholder);
// show signature placeholder
$showExamId = new ilCheckboxInputGUI($this->lng->txt('examid_in_test_res'), 'examid_in_test_res');
$showExamId->setInfo($this->lng->txt('examid_in_test_res_desc'));
$showExamId->setChecked($this->testOBJ->isShowExamIdInTestResultsEnabled());
$form->addItem($showExamId);
// export settings
$export_settings = new ilCheckboxInputGUI($this->lng->txt('tst_exp_sc_short'), 'exp_sc_short');
$export_settings->setInfo($this->lng->txt('tst_exp_sc_short_desc'));
$export_settings->setChecked($this->testOBJ->getExportSettingsSingleChoiceShort());
$form->addItem($export_settings);
}
示例10: addQuestionBehaviourProperties
/**
* @param ilPropertyFormGUI $form
*/
private function addQuestionBehaviourProperties(ilPropertyFormGUI $form)
{
$fields = array('title_output', 'autosave', 'chb_shuffle_questions', 'chb_shuffle_questions', 'offer_hints', 'instant_feedback', 'obligations_enabled');
if ($this->isSectionHeaderRequired($fields) || $this->isCharSelectorPropertyRequired()) {
// sequence properties
$seqheader = new ilFormSectionHeaderGUI();
$seqheader->setTitle($this->lng->txt("tst_presentation_properties"));
$form->addItem($seqheader);
}
// question title output
$title_output = new ilRadioGroupInputGUI($this->lng->txt("tst_title_output"), "title_output");
$title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_full"), 0, ''));
$title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_hide_points"), 1, ''));
$title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_no_title"), 2, ''));
$title_output->setValue($this->testOBJ->getTitleOutput());
$form->addItem($title_output);
// Autosave
$autosave_output = new ilCheckboxInputGUI($this->lng->txt('autosave'), 'autosave');
$autosave_output->setValue(1);
$autosave_output->setChecked($this->testOBJ->getAutosave());
$autosave_output->setInfo($this->lng->txt('autosave_info'));
$autosave_interval = new ilTextInputGUI($this->lng->txt('autosave_ival'), 'autosave_ival');
$autosave_interval->setSize(10);
$autosave_interval->setValue($this->testOBJ->getAutosaveIval() / 1000);
$autosave_interval->setSuffix($this->lng->txt('seconds'));
$autosave_output->addSubItem($autosave_interval);
$form->addItem($autosave_output);
// shuffle questions
$shuffle = new ilCheckboxInputGUI($this->lng->txt("tst_shuffle_questions"), "chb_shuffle_questions");
$shuffle->setValue(1);
$shuffle->setChecked($this->testOBJ->getShuffleQuestions());
$shuffle->setInfo($this->lng->txt("tst_shuffle_questions_description"));
$form->addItem($shuffle);
// offer hints
$checkBoxOfferHints = new ilCheckboxInputGUI($this->lng->txt('tst_setting_offer_hints_label'), 'offer_hints');
$checkBoxOfferHints->setChecked($this->testOBJ->isOfferingQuestionHintsEnabled());
$checkBoxOfferHints->setInfo($this->lng->txt('tst_setting_offer_hints_info'));
if ($this->testOBJ->participantDataExist()) {
$checkBoxOfferHints->setDisabled(true);
}
$form->addItem($checkBoxOfferHints);
// instant feedback
$instant_feedback = new ilCheckboxGroupInputGUI($this->lng->txt('tst_instant_feedback'), 'instant_feedback');
$instant_feedback->addOption(new ilCheckboxOption($this->lng->txt('tst_instant_feedback_results'), 'instant_feedback_points', $this->lng->txt('tst_instant_feedback_results_desc')));
$instant_feedback->addOption(new ilCheckboxOption($this->lng->txt('tst_instant_feedback_answer_generic'), 'instant_feedback_generic', $this->lng->txt('tst_instant_feedback_answer_generic_desc')));
$instant_feedback->addOption(new ilCheckboxOption($this->lng->txt('tst_instant_feedback_answer_specific'), 'instant_feedback_specific', $this->lng->txt('tst_instant_feedback_answer_specific_desc')));
$instant_feedback->addOption(new ilCheckboxOption($this->lng->txt('tst_instant_feedback_solution'), 'instant_feedback_solution', $this->lng->txt('tst_instant_feedback_solution_desc')));
$instant_feedback->addOption(new ilCheckboxOption($this->lng->txt('tst_instant_feedback_fix_usr_answer'), 'instant_feedback_answer_fixation', $this->lng->txt('tst_instant_feedback_fix_usr_answer_desc')));
$values = array();
if ($this->testOBJ->getSpecificAnswerFeedback()) {
array_push($values, 'instant_feedback_specific');
}
if ($this->testOBJ->getGenericAnswerFeedback()) {
array_push($values, 'instant_feedback_generic');
}
if ($this->testOBJ->getAnswerFeedbackPoints()) {
array_push($values, 'instant_feedback_points');
}
if ($this->testOBJ->getInstantFeedbackSolution()) {
array_push($values, 'instant_feedback_solution');
}
if ($this->testOBJ->isInstantFeedbackAnswerFixationEnabled()) {
array_push($values, 'instant_feedback_answer_fixation');
}
$instant_feedback->setValue($values);
$form->addItem($instant_feedback);
// enable obligations
$checkBoxEnableObligations = new ilCheckboxInputGUI($this->lng->txt('tst_setting_enable_obligations_label'), 'obligations_enabled');
$checkBoxEnableObligations->setChecked($this->testOBJ->areObligationsEnabled());
$checkBoxEnableObligations->setInfo($this->lng->txt('tst_setting_enable_obligations_info'));
if ($this->testOBJ->participantDataExist()) {
$checkBoxEnableObligations->setDisabled(true);
}
$form->addItem($checkBoxEnableObligations);
// selector for unicode characters
if ($this->isCharSelectorPropertyRequired()) {
require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
$char_selector = new ilCharSelectorGUI(ilCharSelectorConfig::CONTEXT_TEST);
$char_selector->getConfig()->setAvailability($this->testOBJ->getCharSelectorAvailability());
$char_selector->getConfig()->setDefinition($this->testOBJ->getCharSelectorDefinition());
$char_selector->addFormProperties($form);
$char_selector->setFormValues($form);
}
}
示例11: initForumCreateForm
/**
* @param string $object_type
*/
private function initForumCreateForm($object_type)
{
$this->create_form_gui = new ilPropertyFormGUI();
$this->create_form_gui->setTableWidth('600px');
$this->create_form_gui->setTitle($this->lng->txt('frm_new'));
$this->create_form_gui->setTitleIcon(ilUtil::getImagePath('icon_frm.svg'));
// form action
$this->ctrl->setParameter($this, 'new_type', $object_type);
$this->create_form_gui->setFormAction($this->ctrl->getFormAction($this, 'save'));
// title
$title_gui = new ilTextInputGUI($this->lng->txt('title'), 'title');
$title_gui->setSize(min(40, ilObject::TITLE_LENGTH));
$title_gui->setMaxLength(ilObject::TITLE_LENGTH);
$this->create_form_gui->addItem($title_gui);
// description
$description_gui = new ilTextAreaInputGUI($this->lng->txt('desc'), 'desc');
$description_gui->setCols(40);
$description_gui->setRows(2);
$this->create_form_gui->addItem($description_gui);
// view sorting threads
$sorting_threads_gui = new ilRadioGroupInputGUI($this->lng->txt('frm_sorting_threads'), 'thread_sorting');
$sort_dat = new ilRadioOption($this->lng->txt('order_by') . ' ' . $this->lng->txt('date'), 0);
$sorting_threads_gui->addOption($sort_dat);
$sort_man = new ilRadioOption($this->lng->txt('sorting_manual_sticky'), 1);
$sorting_threads_gui->addOption($sort_man);
$sorting_threads_gui->setInfo($this->lng->txt('sticky_threads_always_on_top'));
$this->create_form_gui->addItem($sorting_threads_gui);
// view
$view_group_gui = new ilRadioGroupInputGUI($this->lng->txt('frm_default_view'), 'sort');
$view_hir = new ilRadioOption($this->lng->txt('order_by') . ' ' . $this->lng->txt('answers'), ilForumProperties::VIEW_TREE);
$view_group_gui->addOption($view_hir);
$view_dat = new ilRadioOption($this->lng->txt('order_by') . ' ' . $this->lng->txt('date'), ilForumProperties::VIEW_DATE);
$view_group_gui->addOption($view_dat);
$this->create_form_gui->addItem($view_group_gui);
$view_direction_group_gui = new ilRadioGroupInputGUI('', 'default_view_sort_dir');
$view_desc = new ilRadioOption($this->lng->txt('frm_post_sort_desc'), ilForumProperties::VIEW_DATE_DESC);
$view_direction_group_gui->addOption($view_desc);
$view_asc = new ilRadioOption($this->lng->txt('frm_post_sort_asc'), ilForumProperties::VIEW_DATE_ASC);
$view_direction_group_gui->addOption($view_asc);
$view_dat->addSubItem($view_direction_group_gui);
// anonymized or not
$anonymize_gui = new ilCheckboxInputGUI($this->lng->txt('frm_anonymous_posting'), 'anonymized');
$anonymize_gui->setInfo($this->lng->txt('frm_anonymous_posting_desc'));
$anonymize_gui->setValue(1);
if ($this->ilias->getSetting('enable_anonymous_fora', false)) {
$anonymize_gui->setDisabled(true);
}
$this->create_form_gui->addItem($anonymize_gui);
// statistics enabled or not
$statistics_gui = new ilCheckboxInputGUI($this->lng->txt('frm_statistics_enabled'), 'statistics_enabled');
$statistics_gui->setInfo($this->lng->txt('frm_statistics_enabled_desc'));
$statistics_gui->setValue(1);
if (!$this->ilias->getSetting('enable_fora_statistics', false)) {
$statistics_gui->setDisabled(true);
}
$this->create_form_gui->addItem($statistics_gui);
$cb_prop = new ilCheckboxInputGUI($this->lng->txt('activate_new_posts'), 'post_activation');
$cb_prop->setValue('1');
$cb_prop->setInfo($this->lng->txt('post_activation_desc'));
$this->create_form_gui->addItem($cb_prop);
$this->create_form_gui->addCommandButton('save', $this->lng->txt('save'));
$this->create_form_gui->addCommandButton('cancel', $this->lng->txt('cancel'));
}
示例12: propertiesObject
/**
* Display and fill the properties form of the test
*
* @access public
*/
function propertiesObject($checkonly = FALSE)
{
global $ilAccess;
if (!$ilAccess->checkAccess("write", "", $this->ref_id)) {
// allow only write access
ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
$this->ctrl->redirect($this, "infoScreen");
}
// using template?
$template_settings = null;
$template = $this->object->getTemplate();
if ($template) {
include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
$template = new ilSettingsTemplate($template, ilObjAssessmentFolderGUI::getSettingsTemplateConfig());
$template_settings = $template->getSettings();
$hide_rte_switch = $template_settings["rte_switch"]["hide"];
}
$save = strcmp($this->ctrl->getCmd(), "saveProperties") == 0 ? TRUE : FALSE;
$total = $this->object->evalTotalPersons();
$this->tpl->addJavascript("./Services/JavaScript/js/Basic.js");
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTableWidth("100%");
$form->setId("test_properties");
if (!$template || $template && $this->formShowGeneralSection($template_settings)) {
// general properties
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("tst_general_properties"));
$form->addItem($header);
}
// title & description (meta data)
include_once 'Services/MetaData/classes/class.ilMD.php';
$md_obj = new ilMD($this->object->getId(), 0, "tst");
$md_section = $md_obj->getGeneral();
$title = new ilTextInputGUI($this->lng->txt("title"), "title");
$title->setRequired(true);
$title->setValue($md_section->getTitle());
$form->addItem($title);
$ids = $md_section->getDescriptionIds();
if ($ids) {
$desc_obj = $md_section->getDescription(array_pop($ids));
$desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description");
$desc->setCols(50);
$desc->setRows(4);
$desc->setValue($desc_obj->getDescription());
$form->addItem($desc);
}
// anonymity
$anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity');
if ($total) {
$anonymity->setDisabled(true);
}
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0);
$anonymity->addOption($rb);
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1);
$anonymity->addOption($rb);
$anonymity->setValue((int) $this->object->getAnonymity());
$form->addItem($anonymity);
// random selection of questions
$random = new ilCheckboxInputGUI($this->lng->txt("tst_random_selection"), "random_test");
$random->setValue(1);
if ($total) {
$random->setDisabled(true);
}
$random->setChecked($this->object->isRandomTest());
$info = $this->lng->txt("tst_random_test_description");
if ($this->object->hasQuestionsWithoutQuestionpool()) {
$info .= $this->lng->txt("tst_random_test_description_warning");
}
$random->setInfo($info);
$form->addItem($random);
// pool usage
$pool_usage = new ilCheckboxInputGUI($this->lng->txt("test_question_pool_usage"), "use_pool");
$pool_usage->setValue(1);
$pool_usage->setChecked($this->object->getPoolUsage());
$form->addItem($pool_usage);
// activation/availability (no template support yet)
include_once "Services/Object/classes/class.ilObjectActivation.php";
$this->lng->loadLanguageModule('rep');
$section = new ilFormSectionHeaderGUI();
$section->setTitle($this->lng->txt('rep_activation_availability'));
$form->addItem($section);
// additional info only with multiple references
$act_obj_info = $act_ref_info = "";
if (sizeof(ilObject::_getAllReferences($this->object->getId())) > 1) {
$act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
$act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
}
$online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
$online->setChecked($this->object->isOnline());
$online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info);
$form->addItem($online);
$act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type');
$act_type->setInfo($act_ref_info);
//.........这里部分代码省略.........
示例13: scoringObject
/**
* Display and fill the scoring settings form of the test
*
* @access public
*/
function scoringObject($checkonly = FALSE)
{
global $ilAccess;
if (!$ilAccess->checkAccess("write", "", $this->ref_id)) {
// allow only write access
ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
$this->ctrl->redirect($this, "infoScreen");
}
// using template?
$template_settings = null;
$template = $this->object->getTemplate();
if ($template) {
include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
include_once "Modules/Test/classes/class.ilObjAssessmentFolderGUI.php";
$template = new ilSettingsTemplate($template, ilObjAssessmentFolderGUI::getSettingsTemplateConfig());
$template_settings = $template->getSettings();
}
$save = strcmp($this->ctrl->getCmd(), "saveScoring") == 0 ? TRUE : FALSE;
$total = $this->object->evalTotalPersons();
$this->tpl->addJavascript("./Services/JavaScript/js/Basic.js");
// Determine settings availability
$setting_available = true;
// In general, the scoring settings are available.
if ($total != 0) {
$setting_available = false;
// Unless there are results from users.
}
if ($this->object->getScoreReporting() == 4) {
$setting_available = true;
// But if the results are not public since they will never be
}
if ($this->object->getScoreReporting() == 3 && $this->object->getReportingDate() > time()) {
$setting_available = true;
// or the presentation date is not reached, then we can still edit them.
}
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTableWidth("100%");
$form->setId("test_properties_scoring");
// scoring properties
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("test_scoring"));
$form->addItem($header);
// scoring system
$count_system = new ilRadioGroupInputGUI($this->lng->txt("tst_text_count_system"), "count_system");
$count_system->addOption(new ilRadioOption($this->lng->txt("tst_count_partial_solutions"), 0, ''));
$count_system->addOption(new ilRadioOption($this->lng->txt("tst_count_correct_solutions"), 1, ''));
$count_system->setValue($this->object->getCountSystem());
$count_system->setInfo($this->lng->txt("tst_count_system_description"));
$count_system->setDisabled(!$setting_available);
$form->addItem($count_system);
// mc questions
$mc_scoring = new ilRadioGroupInputGUI($this->lng->txt("tst_score_mcmr_questions"), "mc_scoring");
$mc_scoring->addOption(new ilRadioOption($this->lng->txt("tst_score_mcmr_zero_points_when_unanswered"), 0, ''));
$mc_scoring->addOption(new ilRadioOption($this->lng->txt("tst_score_mcmr_use_scoring_system"), 1, ''));
$mc_scoring->setValue($this->object->getMCScoring());
$mc_scoring->setInfo($this->lng->txt("tst_score_mcmr_questions_description"));
$mc_scoring->setDisabled(!$setting_available);
$form->addItem($mc_scoring);
// score cutting
$score_cutting = new ilRadioGroupInputGUI($this->lng->txt("tst_score_cutting"), "score_cutting");
$score_cutting->addOption(new ilRadioOption($this->lng->txt("tst_score_cut_question"), 0, ''));
$score_cutting->addOption(new ilRadioOption($this->lng->txt("tst_score_cut_test"), 1, ''));
$score_cutting->setValue($this->object->getScoreCutting());
$score_cutting->setInfo($this->lng->txt("tst_score_cutting_description"));
$score_cutting->setDisabled(!$setting_available);
$form->addItem($score_cutting);
// pass scoring
$pass_scoring = new ilRadioGroupInputGUI($this->lng->txt("tst_pass_scoring"), "pass_scoring");
$pass_scoring->addOption(new ilRadioOption($this->lng->txt("tst_pass_last_pass"), 0, ''));
$pass_scoring->addOption(new ilRadioOption($this->lng->txt("tst_pass_best_pass"), 1, ''));
$pass_scoring->setValue($this->object->getPassScoring());
$pass_scoring->setInfo($this->lng->txt("tst_pass_scoring_description"));
$pass_scoring->setDisabled(!$setting_available);
$form->addItem($pass_scoring);
// test presentation
$header_tp = new ilFormSectionHeaderGUI();
$header_tp->setTitle($this->lng->txt("test_presentation"));
$form->addItem($header_tp);
// enable obligations
$checkBoxEnableObligations = new ilCheckboxInputGUI($this->lng->txt("tst_setting_enable_obligations_label"), "obligations_enabled");
$checkBoxEnableObligations->setChecked($this->object->areObligationsEnabled());
$checkBoxEnableObligations->setInfo($this->lng->txt("tst_setting_enable_obligations_info"));
if ($total) {
$checkBoxEnableObligations->setDisabled(true);
}
$form->addItem($checkBoxEnableObligations);
// offer hints
$checkBoxOfferHints = new ilCheckboxInputGUI($this->lng->txt("tst_setting_offer_hints_label"), "offer_hints");
$checkBoxOfferHints->setChecked($this->object->isOfferingQuestionHintsEnabled());
$checkBoxOfferHints->setInfo($this->lng->txt("tst_setting_offer_hints_info"));
if ($total) {
$checkBoxOfferHints->setDisabled(true);
}
//.........这里部分代码省略.........
示例14: initIliasSettingsForm
public function initIliasSettingsForm()
{
/**
* @var $ilCtrl ilCtrl
*/
global $lng, $ilCtrl;
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($ilCtrl->getFormAction($this, 'saveIliasSettings'));
$this->form->setTitle($this->getPluginObject()->txt('general_settings'));
$this->form->addCommandButton('saveIliasSettings', $lng->txt('save'));
$this->form->addCommandButton('cancelIliasSettings', $lng->txt('cancel'));
$cb_group = new ilCheckboxGroupInputGUI($this->pluginObj->txt('object_creation_settings'), 'obj_creation_settings');
include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
$templates = ilSettingsTemplate::getAllSettingsTemplates("xavc");
if ($templates) {
foreach ($templates as $item) {
$cb_simple = new ilCheckboxOption($this->pluginObj->txt($item["title"]), $item["id"]);
$cb_group->addOption($cb_simple);
}
}
$cb_group->setInfo($this->pluginObj->txt('template_info'));
$this->form->addItem($cb_group);
$obj_title_suffix = new ilCheckboxInputGUI($this->pluginObj->txt('obj_title_suffix'), 'obj_title_suffix');
$obj_title_suffix->setInfo($this->pluginObj->txt('obj_title_suffix_info'));
$this->form->addItem($obj_title_suffix);
$crs_grp_trigger = new ilCheckboxInputGUI($this->pluginObj->txt('allow_crs_grp_trigger'), 'allow_crs_grp_trigger');
$crs_grp_trigger->setInfo($this->pluginObj->txt('allow_crs_grp_trigger_info'));
$this->form->addItem($crs_grp_trigger);
$show_free_slots = new ilCheckboxInputGUI($this->pluginObj->txt('show_free_slots'), 'show_free_slots');
$show_free_slots->setInfo($this->pluginObj->txt('show_free_slots_info'));
$this->form->addItem($show_free_slots);
$enable_perm_room = new ilCheckboxInputGUI($this->pluginObj->txt('enable_perm_room'), 'enable_perm_room');
$enable_perm_room->setInfo($this->pluginObj->txt('enable_perm_room_info'));
$default_perm_room = new ilCheckboxInputGUI($this->pluginObj->txt('default_perm_room'), 'default_perm_room');
$default_perm_room->setInfo($this->pluginObj->txt('default_perm_room_info'));
$enable_perm_room->addSubItem($default_perm_room);
$this->form->addItem($enable_perm_room);
$add_to_desktop = new ilCheckboxInputGUI($this->pluginObj->txt('add_to_desktop'), 'add_to_desktop');
$add_to_desktop->setInfo($this->pluginObj->txt('add_to_desktop_info'));
$this->form->addItem($add_to_desktop);
$content_file_types = new ilTextInputGUI($this->pluginObj->txt('content_file_types'), 'content_file_types');
$content_file_types->setRequired(true);
$content_file_types->setInfo($this->pluginObj->txt('content_file_types_info'));
$this->form->addItem($content_file_types);
$user_folders = new ilCheckboxInputGUI($this->pluginObj->txt('use_user_folders'), 'use_user_folders');
$user_folders->setInfo($this->pluginObj->txt('use_user_folders_info'));
if (ilAdobeConnectServer::getSetting('user_assignment_mode') == ilAdobeConnectServer::ASSIGN_USER_DFN_EMAIL) {
$user_folders->setDisabled(true);
}
$this->form->addItem($user_folders);
$xavc_options = array("host" => $this->pluginObj->txt("presenter"), "mini-host" => $this->pluginObj->txt("moderator"), "view" => $this->pluginObj->txt("participant"), "denied" => $this->pluginObj->txt('denied'));
$mapping_crs = new ilNonEditableValueGUI($this->pluginObj->txt('default_crs_mapping'), 'default_crs_mapping');
// $crs_owner = new ilSelectInputGUI($lng->txt('owner'), 'crs_owner');
// $crs_owner->setOptions($xavc_options);
// $mapping_crs->addSubItem($crs_owner);
$crs_admin = new ilSelectInputGUI($lng->txt('il_crs_admin'), 'crs_admin');
$crs_admin->setOptions($xavc_options);
$mapping_crs->addSubItem($crs_admin);
$crs_tutor = new ilSelectInputGUI($lng->txt('il_crs_tutor'), 'crs_tutor');
$crs_tutor->setOptions($xavc_options);
$mapping_crs->addSubItem($crs_tutor);
$crs_member = new ilSelectInputGUI($lng->txt('il_crs_member'), 'crs_member');
$crs_member->setOptions($xavc_options);
$mapping_crs->addSubItem($crs_member);
$this->form->addItem($mapping_crs);
$mapping_grp = new ilNonEditableValueGUI($this->pluginObj->txt('default_grp_mapping'), 'default_grp_mapping');
// $grp_owner = new ilSelectInputGUI($lng->txt('owner'), 'grp_owner');
// $grp_owner->setOptions($xavc_options);
// $mapping_grp->addSubItem($grp_owner);
$grp_admin = new ilSelectInputGUI($lng->txt('il_grp_admin'), 'grp_admin');
$grp_admin->setOptions($xavc_options);
$mapping_grp->addSubItem($grp_admin);
$grp_member = new ilSelectInputGUI($lng->txt('il_grp_member'), 'grp_member');
$grp_member->setOptions($xavc_options);
$mapping_grp->addSubItem($grp_member);
$this->form->addItem($mapping_grp);
$ac_permissions = ilXAVCPermissions::getPermissionsArray();
//@todo nahmad: in Template auslagern!
$tbl = "<table width='100%' >\n\t\t<tr>\n\t\t<td> </td> \n\t\t<td>" . $this->pluginObj->txt('presenter') . "</td>\n\t\t<td>" . $this->pluginObj->txt('moderator') . "</td>\n\t\t<td>" . $this->pluginObj->txt('participant') . "</td>\n\t\t<td>" . $this->pluginObj->txt('denied') . "</td>\n\t\t\n\t\t</tr>";
foreach ($ac_permissions as $ac_permission => $ac_roles) {
$tbl .= "<tr> <td>" . $this->pluginObj->txt($ac_permission) . "</td>";
foreach ($ac_roles as $ac_role => $ac_access) {
$tbl .= "<td>";
$tbl .= ilUtil::formCheckbox((bool) $ac_access, 'permissions[' . $ac_permission . '][' . $ac_role . ']', $ac_role, false);
$tbl .= "</td>";
}
$tbl .= "</tr>";
}
$tbl .= "</table>";
$matrix = new ilCustomInputGUI($this->pluginObj->txt('ac_permissions'), '');
$matrix->setHtml($tbl);
$this->form->addItem($matrix);
}
示例15: buildForm
private function buildForm()
{
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt("save"));
$form->setTableWidth("100%");
$form->setId("test_properties");
if (!$this->settingsTemplate || $this->formShowGeneralSection($this->settingsTemplate->getSettings())) {
// general properties
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("tst_general_properties"));
$form->addItem($header);
}
// title & description (meta data)
include_once 'Services/MetaData/classes/class.ilMD.php';
$md_obj = new ilMD($this->testOBJ->getId(), 0, "tst");
$md_section = $md_obj->getGeneral();
$title = new ilTextInputGUI($this->lng->txt("title"), "title");
$title->setRequired(true);
$title->setValue($md_section->getTitle());
$form->addItem($title);
$ids = $md_section->getDescriptionIds();
if ($ids) {
$desc_obj = $md_section->getDescription(array_pop($ids));
$desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description");
$desc->setCols(50);
$desc->setRows(4);
$desc->setValue($desc_obj->getDescription());
$form->addItem($desc);
}
// anonymity
$anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity');
if ($this->testOBJ->participantDataExist()) {
$anonymity->setDisabled(true);
}
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0);
$anonymity->addOption($rb);
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1);
$anonymity->addOption($rb);
$anonymity->setValue((int) $this->testOBJ->getAnonymity());
$form->addItem($anonymity);
// test mode (question set type)
$questSetType = new ilRadioGroupInputGUI($this->lng->txt("tst_question_set_type"), 'question_set_type');
$questSetTypeFixed = new ilRadioOption($this->lng->txt("tst_question_set_type_fixed"), ilObjTest::QUESTION_SET_TYPE_FIXED, $this->lng->txt("tst_question_set_type_fixed_desc"));
$questSetType->addOption($questSetTypeFixed);
$questSetTypeRandom = new ilRadioOption($this->lng->txt("tst_question_set_type_random"), ilObjTest::QUESTION_SET_TYPE_RANDOM, $this->lng->txt("tst_question_set_type_random_desc"));
$questSetType->addOption($questSetTypeRandom);
$questSetTypeContinues = new ilRadioOption($this->lng->txt("tst_question_set_type_dynamic"), ilObjTest::QUESTION_SET_TYPE_DYNAMIC, $this->lng->txt("tst_question_set_type_dynamic_desc"));
$questSetType->addOption($questSetTypeContinues);
$questSetType->setValue($this->testOBJ->getQuestionSetType());
if ($this->testOBJ->participantDataExist()) {
$questSetType->setDisabled(true);
}
$form->addItem($questSetType);
// pool usage
$pool_usage = new ilCheckboxInputGUI($this->lng->txt("test_question_pool_usage"), "use_pool");
$pool_usage->setValue(1);
$pool_usage->setChecked($this->testOBJ->getPoolUsage());
$form->addItem($pool_usage);
// enable_archiving
$enable_archiving = new ilCheckboxInputGUI($this->lng->txt('test_enable_archiving'), 'enable_archiving');
$enable_archiving->setValue(1);
$enable_archiving->setChecked($this->testOBJ->getEnableArchiving());
$form->addItem($enable_archiving);
// activation/availability (no template support yet)
include_once "Services/Object/classes/class.ilObjectActivation.php";
$this->lng->loadLanguageModule('rep');
$section = new ilFormSectionHeaderGUI();
$section->setTitle($this->lng->txt('rep_activation_availability'));
$form->addItem($section);
// additional info only with multiple references
$act_obj_info = $act_ref_info = "";
if (sizeof(ilObject::_getAllReferences($this->testOBJ->getId())) > 1) {
$act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
$act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
}
$online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
$online->setChecked($this->testOBJ->isOnline());
$online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info);
$form->addItem($online);
$act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type');
$act_type->setInfo($act_ref_info);
$act_type->setValue($this->testOBJ->isActivationLimited() ? ilObjectActivation::TIMINGS_ACTIVATION : ilObjectActivation::TIMINGS_DEACTIVATED);
$opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED);
$opt->setInfo($this->lng->txt('tst_availability_limitless_info'));
$act_type->addOption($opt);
$opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION);
$opt->setInfo($this->lng->txt('tst_availability_until_info'));
$this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
$dur = new ilDateDurationInputGUI("", "access_period");
$dur->setShowTime(true);
$date = $this->testOBJ->getActivationStartingTime();
$dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$dur->setStartText($this->lng->txt('rep_activation_limited_start'));
$date = $this->testOBJ->getActivationEndingTime();
$dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$dur->setEndText($this->lng->txt('rep_activation_limited_end'));
$opt->addSubItem($dur);
//.........这里部分代码省略.........