本文整理汇总了PHP中ilCheckboxInputGUI::setValue方法的典型用法代码示例。如果您正苦于以下问题:PHP ilCheckboxInputGUI::setValue方法的具体用法?PHP ilCheckboxInputGUI::setValue怎么用?PHP ilCheckboxInputGUI::setValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilCheckboxInputGUI
的用法示例。
在下文中一共展示了ilCheckboxInputGUI::setValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initServiceSettingsForm
/**
* Init service settings form
* @param ilPropertyFormGUI $form
* @param type $services
*/
public static function initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
{
global $ilSetting;
if (in_array(self::CALENDAR_VISIBILITY, $services)) {
include_once './Services/Calendar/classes/class.ilObjCalendarSettings.php';
if (ilCalendarSettings::_getInstance()->isEnabled()) {
// Container tools (calendar, news, ... activation)
$cal = new ilCheckboxInputGUI('', self::CALENDAR_VISIBILITY);
$cal->setValue(1);
include_once './Services/Calendar/classes/class.ilObjCalendarSettings.php';
$cal->setChecked(ilCalendarSettings::lookupCalendarActivated($a_obj_id));
$cal->setOptionTitle($GLOBALS['lng']->txt('obj_tool_setting_calendar'));
$form->addItem($cal);
}
}
if (in_array(self::NEWS_VISIBILITY, $services)) {
if ($ilSetting->get('block_activated_news')) {
// Container tools (calendar, news, ... activation)
$news = new ilCheckboxInputGUI('', self::NEWS_VISIBILITY);
$news->setValue(1);
$news->setChecked(ilContainer::_lookupContainerSetting($a_obj_id, self::NEWS_VISIBILITY, $ilSetting->get('block_activated_news', true)));
$news->setOptionTitle($GLOBALS['lng']->txt('obj_tool_setting_news'));
$form->addItem($news);
}
}
return $form;
}
示例2: initForm
/**
* Init settings property form
*
* @access private
*/
private function initForm()
{
$this->setFormAction($this->ctrl->getFormAction($this->parent_gui));
$name = new ilTextInputGUI($this->lng->txt("bibl_library_name"), 'name');
$name->setRequired(true);
$name->setValue('');
$this->addItem($name);
$url = new ilTextInputGUI($this->lng->txt("bibl_library_url"), 'url');
$url->setRequired(true);
$url->setValue('');
$this->addItem($url);
$img = new ilTextInputGUI($this->lng->txt("bibl_library_img"), 'img');
$img->setValue('');
$this->addItem($img);
$show_in_list = new ilCheckboxInputGUI($this->lng->txt("bibl_library_show_in_list"), 'show_in_list');
$show_in_list->setValue(1);
$this->addItem($show_in_list);
switch ($this->action) {
case 'create':
$this->setTitle($this->lng->txt("bibl_settings_new"));
$this->addCommandButton('create', $this->lng->txt('save'));
break;
case 'update':
$this->addCommandButton('update', $this->lng->txt('save'));
$this->fillForm();
$this->setTitle($this->lng->txt("bibl_settings_edit"));
break;
}
$this->addCommandButton('cancel', $this->lng->txt("cancel"));
}
示例3: addToForm
public function addToForm()
{
$bool = new ilCheckboxInputGUI($this->getTitle(), $this->getElementId());
$bool->setValue(1);
$this->addBasicFieldProperties($bool, $this->getADT()->getCopyOfDefinition());
// :TODO: required checkboxes do not make sense
$bool->setRequired(false);
$bool->setChecked($this->getADT()->getStatus());
$this->addToParentElement($bool);
}
示例4: addToForm
public function addToForm()
{
global $lng;
if ($this->getForm() instanceof ilPropertyFormGUI) {
// :TODO: use DateDurationInputGUI ?!
if (!(bool) $this->text_input) {
$check = new ilCheckboxInputGUI($this->getTitle(), $this->addToElementId("tgl"));
$check->setValue(1);
$checked = false;
} else {
$check = new ilCustomInputGUI($this->getTitle());
}
$date_from = new ilDateTimeInputGUI($lng->txt('from'), $this->addToElementId("lower"));
$date_from->setShowTime(true);
$check->addSubItem($date_from);
if ($this->getLowerADT()->getDate() && !$this->getLowerADT()->isNull()) {
$date_from->setDate($this->getLowerADT()->getDate());
$checked = true;
}
$date_until = new ilDateTimeInputGUI($lng->txt('until'), $this->addToElementId("upper"));
$date_until->setShowTime(true);
$check->addSubItem($date_until);
if ($this->getUpperADT()->getDate() && !$this->getUpperADT()->isNull()) {
$date_until->setDate($this->getUpperADT()->getDate());
$checked = true;
}
if (!(bool) $this->text_input) {
$check->setChecked($checked);
} else {
$date_from->setMode(ilDateTimeInputGUI::MODE_INPUT);
$date_until->setMode(ilDateTimeInputGUI::MODE_INPUT);
}
$this->addToParentElement($check);
} else {
// see ilTable2GUI::addFilterItemByMetaType()
include_once "./Services/Form/classes/class.ilCombinationInputGUI.php";
include_once "./Services/Form/classes/class.ilDateTimeInputGUI.php";
$item = new ilCombinationInputGUI($this->getTitle(), $this->getElementId());
$lower = new ilDateTimeInputGUI("", $this->addToElementId("lower"));
$lower->setShowTime(true);
$item->addCombinationItem("lower", $lower, $lng->txt("from"));
if ($this->getLowerADT()->getDate() && !$this->getLowerADT()->isNull()) {
$lower->setDate($this->getLowerADT()->getDate());
}
$upper = new ilDateTimeInputGUI("", $this->addToElementId("upper"));
$upper->setShowTime(true);
$item->addCombinationItem("upper", $upper, $lng->txt("to"));
if ($this->getUpperADT()->getDate() && !$this->getUpperADT()->isNull()) {
$upper->setDate($this->getUpperADT()->getDate());
}
$item->setComparisonMode(ilCombinationInputGUI::COMPARISON_ASCENDING);
$item->setMode(ilDateTimeInputGUI::MODE_INPUT);
$this->addToParentElement($item);
}
}
示例5: 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());
}
示例6: _initForm
/**
* Init Social Bookmark edit/create Form
*
* @param ilObjectGUI $formhandlerObject taken as form target
* @param int $mode "create" / "edit"
*/
public static function _initForm($formhandlerObject, $mode = "create", $id = 0)
{
global $lng, $ilCtrl;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setMultipart(true);
// File Title
$in_title = new ilTextInputGUI($lng->txt("title"), "title");
$in_title->setMaxLength(128);
$in_title->setSize(40);
$in_title->setRequired(true);
$form->addItem($in_title);
// Link
$in_link = new ilTextInputGUI($lng->txt("link"), "link");
$in_link->setMaxLength(300);
$in_link->setSize(40);
$in_link->setRequired(true);
$in_link->setInfo($lng->txt('socialbm_link_description'));
$form->addItem($in_link);
// File
$in_file = new ilFileInputGUI($lng->txt("file"), "image_file");
$in_file->setSuffixes(array('bmp', 'gif', 'jpg', 'jpeg', 'png'));
$form->addItem($in_file);
// Activate on submit
$in_activate = new ilCheckboxInputGUI($lng->txt("activate"), "activate");
$in_activate->setValue('1');
$form->addItem($in_activate);
// save and cancel commands
if ($mode == "create") {
$form->addCommandButton("createSocialBookmark", $lng->txt("create"));
$form->addCommandButton("editSocialBookmarks", $lng->txt("cancel"));
$form->setTitle($lng->txt("adm_social_bm_create"));
$in_file->setRequired(true);
} else {
if ($mode == "update") {
$in_hidden = new ilHiddenInputGUI("sbm_id", $id);
$form->addItem($in_hidden);
$form->addCommandButton("updateSocialBookmark", $lng->txt("update"));
$form->addCommandButton("cancel", $lng->txt("cancel"));
$form->setTitle($lng->txt("adm_social_bm_edit"));
$in_file->setRequired(false);
}
}
$form->setTableWidth("60%");
$form->setFormAction($ilCtrl->getFormAction($formhandlerObject));
return $form;
}
示例7: initConfigurationForm
/**
* Init configuration form.
*
* @return object form object
*/
public function initConfigurationForm()
{
global $lng, $ilCtrl;
$pl = $this->getPluginObject();
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
// Setting for the ephorus logging
$ephorus_logging = new ilCheckboxInputGUI($pl->txt("ephorus_logging"), "ephorus_logging");
$ephorus_logging->setValue(1);
$ephorus_logging->setInfo($pl->txt("ephorus_logging_description"));
$form->addItem($ephorus_logging);
// Setting for the hand-in code
$handin_code = new ilTextInputGUI($pl->txt("handin_code"), "handin_code");
$handin_code->setRequired(true);
$form->addItem($handin_code);
// Setting for the hand-in address
$handin_address = new ilTextInputGUI($pl->txt("handin_address"), "handin_address");
$handin_address->setSize(80);
$handin_address->setRequired(true);
$form->addItem($handin_address);
// Setting for the index address
$index_address = new ilTextInputGUI($pl->txt("index_address"), "index_address");
$index_address->setSize(80);
$index_address->setRequired(true);
$form->addItem($index_address);
// Setting for the processtype
$processtype = new ilSelectInputGUI($pl->txt("default_processtype"), "processtype");
$processtype->setOptions(array(1 => $pl->txt("default"), 3 => $pl->txt("private")));
$processtype->setInfo($pl->txt("default_processtype_description"));
$form->addItem($processtype);
// Setting for the disclosure
$disclosure = new ilTextAreaInputGUI($pl->txt("disclosure"), "disclosure");
$disclosure->setCols(79);
$disclosure->setRows(4);
$form->addItem($disclosure);
$form->addCommandButton("save", $lng->txt("save") . " / " . $pl->txt("check_connection"));
$form->setTitle($pl->txt("ephorus_plugin_configuration"));
$form->setFormAction($ilCtrl->getFormAction($this));
return $form;
}
示例8: initConfigurationForm
/**
* Init configuration form
* @global type $ilCtrl
*/
protected function initConfigurationForm()
{
global $ilCtrl, $lng;
$settings = ilFhoevEventSettings::getInstance();
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setTitle($this->getPluginObject()->txt('tbl_fhoev_event_settings'));
$form->setFormAction($ilCtrl->getFormAction($this));
$form->addCommandButton('save', $lng->txt('save'));
$form->setShowTopButtons(false);
$lock = new ilCheckboxInputGUI($this->getPluginObject()->txt('tbl_settings_active'), 'active');
$lock->setValue(1);
$lock->setChecked($settings->isActive());
$form->addItem($lock);
$dtpl = new ilNumberInputGUI($this->getPluginObject()->txt('tbl_settings_dtpl'), 'dtpl');
$dtpl->setSize(8);
$dtpl->setValue($settings->getTemplateId());
$dtpl->setRequired(TRUE);
$dtpl->setMinValue(1);
$form->addItem($dtpl);
return $form;
}
示例9: addCustomSettingsToForm
public function addCustomSettingsToForm(ilPropertyFormGUI $a_form)
{
global $lng;
$lng->loadLanguageModule("file");
require_once 'Services/WebDAV/classes/class.ilObjDiskQuotaSettings.php';
$disk_quota_obj = ilObjDiskQuotaSettings::getInstance();
// Enable disk quota reminder mail
$cb_prop_reminder = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_reminder_mail"), "enable_disk_quota_reminder_mail");
$cb_prop_reminder->setValue('1');
$cb_prop_reminder->setChecked($disk_quota_obj->isDiskQuotaReminderMailEnabled());
$cb_prop_reminder->setInfo($lng->txt('disk_quota_reminder_mail_desc'));
$a_form->addItem($cb_prop_reminder);
// Enable summary mail for certain users
$cb_prop_summary = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_summary_mail"), "enable_disk_quota_summary_mail");
$cb_prop_summary->setValue(1);
$cb_prop_summary->setChecked($disk_quota_obj->isDiskQuotaSummaryMailEnabled());
$cb_prop_summary->setInfo($lng->txt('enable_disk_quota_summary_mail_desc'));
$a_form->addItem($cb_prop_summary);
// Edit disk quota recipients
$summary_rcpt = new ilTextInputGUI($lng->txt("disk_quota_summary_rctp"), "disk_quota_summary_rctp");
$summary_rcpt->setValue($disk_quota_obj->getSummaryRecipients());
$summary_rcpt->setInfo($lng->txt('disk_quota_summary_rctp_desc'));
$cb_prop_summary->addSubItem($summary_rcpt);
}
示例10: StatutoryRegulationsObject
public function StatutoryRegulationsObject()
{
$this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, 'saveStatutoryRegulations'));
$form->setTitle($this->lng->txt('statutory_regulations'));
$form->setTableWidth('100%');
// message
$post_gui = new ilTextAreaInputGUI($this->lng->txt('content'), 'statutory_regulations');
$post_gui->setCols(50);
$post_gui->setRows(15);
$post_gui->setUseRte(true);
$post_gui->addPlugin('latex');
$post_gui->addButton('latex');
$post_gui->addButton('pastelatex');
$post_gui->addPlugin('ilimgupload');
$post_gui->addButton('ilimgupload');
$post_gui->removePlugin('advlink');
$post_gui->removePlugin(ilRTE::ILIAS_IMG_MANAGER_PLUGIN);
$post_gui->removePlugin('image');
$post_gui->usePurifier(true);
$post_gui->setRTERootBlockElement('');
$post_gui->setRTESupport(ilObject::_lookupObjId($this->ref_id), 'pays~', 'frm_post', 'tpl.tinymce_frm_post.html', false, '3.4.7');
$post_gui->disableButtons(array('charmap', 'undo', 'redo', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'anchor', 'fullscreen', 'cut', 'copy', 'paste', 'pastetext', 'formatselect', 'image'));
// purifier
require_once 'Services/Html/classes/class.ilHtmlPurifierFactory.php';
require_once 'Services/RTE/classes/class.ilRTE.php';
$post_gui->setPurifier(ilHtmlPurifierFactory::_getInstanceByType('frm_post'));
$post_gui->setValue(ilRTE::_replaceMediaObjectImageSrc($this->genSetData->get('statutory_regulations'), 1));
$form->addItem($post_gui);
// show staturaltyio regulations in shoppingcart
$cb_showShoppingCart = new ilCheckboxInputGUI($this->lng->txt('show_sr_shoppingcart'), 'show_sr_shoppingcart');
$cb_showShoppingCart->setInfo($this->lng->txt('show_sr_shoppingcart_info'));
$cb_showShoppingCart->setValue(1);
$cb_showShoppingCart->setChecked($this->genSetData->get('show_sr_shoppingcart'));
$form->addItem($cb_showShoppingCart);
// attach staturaltyio regulations at invoice
$cb_attachInvoice = new ilCheckboxInputGUI($this->lng->txt('attach_sr_invoice'), 'attach_sr_invoice');
$cb_attachInvoice->setInfo($this->lng->txt('attach_sr_invoice_info'));
$cb_attachInvoice->setValue(1);
$cb_attachInvoice->setChecked($this->genSetData->get('attach_sr_invoice'));
$form->addItem($cb_attachInvoice);
$form->addCommandButton('saveStatutoryRegulations', $this->lng->txt('save'));
$this->tpl->setVariable('FORM', $form->getHTML());
}
示例11: initFormSettings
/**
* Init settings property form
*
* @access protected
*/
protected function initFormSettings()
{
if (is_object($this->form)) {
return true;
}
include_once 'Services/Calendar/classes/class.ilCalendarUtil.php';
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this));
$this->form->setTitle($this->lng->txt('cal_global_settings'));
$this->form->addCommandButton('save', $this->lng->txt('save'));
#$this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
$check = new ilCheckboxInputGUI($this->lng->txt('enable_calendar'), 'enable');
$check->setValue(1);
$check->setChecked($this->settings->isEnabled() ? true : false);
$this->form->addItem($check);
$server_tz = new ilNonEditableValueGUI($this->lng->txt('cal_server_tz'));
$server_tz->setValue(ilTimeZone::_getDefaultTimeZone());
$this->form->addItem($server_tz);
$select = new ilSelectInputGUI($this->lng->txt('cal_def_timezone'), 'default_timezone');
$select->setOptions(ilCalendarUtil::_getShortTimeZoneList());
$select->setInfo($this->lng->txt('cal_def_timezone_info'));
$select->setValue($this->settings->getDefaultTimeZone());
$this->form->addItem($select);
$year = date("Y");
$select = new ilSelectInputGUI($this->lng->txt('cal_def_date_format'), 'default_date_format');
$select->setOptions(array(ilCalendarSettings::DATE_FORMAT_DMY => '31.10.' . $year, ilCalendarSettings::DATE_FORMAT_YMD => $year . "-10-31", ilCalendarSettings::DATE_FORMAT_MDY => "10/31/" . $year));
$select->setInfo($this->lng->txt('cal_def_date_format_info'));
$select->setValue($this->settings->getDefaultDateFormat());
$this->form->addItem($select);
$select = new ilSelectInputGUI($this->lng->txt('cal_def_time_format'), 'default_time_format');
$select->setOptions(array(ilCalendarSettings::TIME_FORMAT_24 => '13:00', ilCalendarSettings::TIME_FORMAT_12 => '1:00pm'));
$select->setInfo($this->lng->txt('cal_def_time_format_info'));
$select->setValue($this->settings->getDefaultTimeFormat());
$this->form->addItem($select);
// Weekstart
$radio = new ilRadioGroupInputGUI($this->lng->txt('cal_def_week_start'), 'default_week_start');
$radio->setValue($this->settings->getDefaultWeekStart());
$option = new ilRadioOption($this->lng->txt('l_su'), 0);
$radio->addOption($option);
$option = new ilRadioOption($this->lng->txt('l_mo'), 1);
$radio->addOption($option);
$this->form->addItem($radio);
// Day start
$day_start = new ilSelectInputGUI($this->lng->txt('cal_day_start'), 'dst');
$day_start->setOptions(ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat()));
$day_start->setValue($this->settings->getDefaultDayStart());
$this->form->addItem($day_start);
$day_end = new ilSelectInputGUI($this->lng->txt('cal_day_end'), 'den');
$day_end->setOptions(ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat()));
$day_end->setValue($this->settings->getDefaultDayEnd());
$this->form->addItem($day_end);
$sync = new ilCheckboxInputGUI($this->lng->txt('cal_webcal_sync'), 'webcal');
$sync->setValue(1);
$sync->setChecked($this->settings->isWebCalSyncEnabled());
$sync->setInfo($this->lng->txt('cal_webcal_sync_info'));
$sync_min = new ilNumberInputGUI('', 'webcal_hours');
$sync_min->setSize(2);
$sync_min->setMaxLength(3);
$sync_min->setValue($this->settings->getWebCalSyncHours());
$sync_min->setSuffix($this->lng->txt('hours'));
$sync->addSubItem($sync_min);
$this->form->addItem($sync);
// enable milestone planning in groups
$mil = new ilFormSectionHeaderGUI();
$mil->setTitle($this->lng->txt('cal_milestone_settings'));
$this->form->addItem($mil);
$checkm = new ilCheckboxInputGUI($this->lng->txt('cal_enable_group_milestones'), 'enable_grp_milestones');
$checkm->setValue(1);
$checkm->setChecked($this->settings->getEnableGroupMilestones() ? true : false);
$checkm->setInfo($this->lng->txt('cal_enable_group_milestones_desc'));
$this->form->addItem($checkm);
// Consultation hours
$con = new ilFormSectionHeaderGUI();
$con->setTitle($this->lng->txt('cal_ch_form_header'));
$this->form->addItem($con);
$ch = new ilCheckboxInputGUI($this->lng->txt('cal_ch_form'), 'ch');
$ch->setInfo($this->lng->txt('cal_ch_form_info'));
$ch->setValue(1);
$ch->setChecked($this->settings->areConsultationHoursEnabled());
$this->form->addItem($ch);
// repository visibility default
$rep = new ilFormSectionHeaderGUI();
$rep->setTitle($GLOBALS['lng']->txt('cal_setting_global_vis_repos'));
$this->form->addItem($rep);
$crs = new ilCheckboxInputGUI($GLOBALS['lng']->txt('cal_setting_global_crs_vis'), 'visible_crs');
$crs->setInfo($GLOBALS['lng']->txt('cal_setting_global_crs_vis_info'));
$crs->setValue(1);
$crs->setInfo($GLOBALS['lng']->txt('cal_setting_global_crs_vis_info'));
$crs->setChecked($this->settings->isCourseCalendarEnabled());
$this->form->addItem($crs);
$grp = new ilCheckboxInputGUI($GLOBALS['lng']->txt('cal_setting_global_grp_vis'), 'visible_grp');
$grp->setInfo($GLOBALS['lng']->txt('cal_setting_global_grp_vis_info'));
$grp->setValue(1);
$grp->setInfo($GLOBALS['lng']->txt('cal_setting_global_grp_vis_info'));
//.........这里部分代码省略.........
示例12: initSettingsForm
/**
* init settings form
*
* @access protected
*/
protected function initSettingsForm($a_mode = 'update')
{
if (is_object($this->form)) {
return true;
}
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this, 'settings'));
$this->form->setTitle($this->lng->txt('ecs_connection_settings'));
$ena = new ilCheckboxInputGUI($this->lng->txt('ecs_active'), 'active');
$ena->setChecked($this->settings->isEnabled());
$ena->setValue(1);
$this->form->addItem($ena);
$ser = new ilTextInputGUI($this->lng->txt('ecs_server_url'), 'server');
$ser->setValue((string) $this->settings->getServer());
$ser->setRequired(true);
$this->form->addItem($ser);
$pro = new ilSelectInputGUI($this->lng->txt('ecs_protocol'), 'protocol');
// fixed to https
#$pro->setOptions(array(ilECSSetting::PROTOCOL_HTTP => $this->lng->txt('http'),
# ilECSSetting::PROTOCOL_HTTPS => $this->lng->txt('https')));
$pro->setOptions(array(ilECSSetting::PROTOCOL_HTTPS => 'HTTPS'));
$pro->setValue($this->settings->getProtocol());
$pro->setRequired(true);
$this->form->addItem($pro);
$por = new ilTextInputGUI($this->lng->txt('ecs_port'), 'port');
$por->setSize(5);
$por->setMaxLength(5);
$por->setValue((string) $this->settings->getPort());
$por->setRequired(true);
$this->form->addItem($por);
$tcer = new ilRadioGroupInputGUI($this->lng->txt('ecs_auth_type'), 'auth_type');
$tcer->setValue($this->settings->getAuthType());
$this->form->addItem($tcer);
// Certificate based authentication
$cert_based = new ilRadioOption($this->lng->txt('ecs_auth_type_cert'), ilECSSetting::AUTH_CERTIFICATE);
$tcer->addOption($cert_based);
$cli = new ilTextInputGUI($this->lng->txt('ecs_client_cert'), 'client_cert');
$cli->setSize(60);
$cli->setValue((string) $this->settings->getClientCertPath());
$cli->setRequired(true);
$cert_based->addSubItem($cli);
$key = new ilTextInputGUI($this->lng->txt('ecs_cert_key'), 'key_path');
$key->setSize(60);
$key->setValue((string) $this->settings->getKeyPath());
$key->setRequired(true);
$cert_based->addSubItem($key);
$cerp = new ilTextInputGUI($this->lng->txt('ecs_key_password'), 'key_password');
$cerp->setSize(12);
$cerp->setValue((string) $this->settings->getKeyPassword());
$cerp->setInputType('password');
$cerp->setRequired(true);
$cert_based->addSubItem($cerp);
$cer = new ilTextInputGUI($this->lng->txt('ecs_ca_cert'), 'ca_cert');
$cer->setSize(60);
$cer->setValue((string) $this->settings->getCACertPath());
$cer->setRequired(true);
$cert_based->addSubItem($cer);
// Apache auth
$apa_based = new ilRadioOption($this->lng->txt('ecs_auth_type_apache'), ilECSSetting::AUTH_APACHE);
$tcer->addOption($apa_based);
$user = new ilTextInputGUI($this->lng->txt('ecs_apache_user'), 'auth_user');
$user->setSize(32);
$user->setValue((string) $this->settings->getAuthUser());
$user->setRequired(true);
$apa_based->addSubItem($user);
$pass = new ilPasswordInputGUI($this->lng->txt('ecs_apache_pass'), 'auth_pass');
$pass->setRetype(false);
$pass->setSize(16);
$pass->setMaxLength(32);
$pass->setValue((string) $this->settings->getAuthPass());
$pass->setRequired(true);
$apa_based->addSubItem($pass);
$ser = new ilNonEditableValueGUI($this->lng->txt('cert_serial'));
$ser->setValue($this->settings->getCertSerialNumber() ? $this->settings->getCertSerialNumber() : $this->lng->txt('ecs_no_value'));
$cert_based->addSubItem($ser);
$loc = new ilFormSectionHeaderGUI();
$loc->setTitle($this->lng->txt('ecs_local_settings'));
$this->form->addItem($loc);
$pol = new ilDurationInputGUI($this->lng->txt('ecs_polling'), 'polling');
$pol->setShowDays(false);
$pol->setShowHours(false);
$pol->setShowMinutes(true);
$pol->setShowSeconds(true);
$pol->setSeconds($this->settings->getPollingTimeSeconds());
$pol->setMinutes($this->settings->getPollingTimeMinutes());
$pol->setRequired(true);
$pol->setInfo($this->lng->txt('ecs_polling_info'));
$this->form->addItem($pol);
$imp = new ilCustomInputGUI($this->lng->txt('ecs_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');
//.........这里部分代码省略.........
示例13: initFormEdit
/**
* init form edit
*
* @access protected
* @return
*/
protected function initFormEdit()
{
global $tree;
include_once "Services/Object/classes/class.ilObjectActivation.php";
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this));
$title = ilObject::_lookupTitle(ilObject::_lookupObjId($this->getItemId()));
$this->form->setTitle($title . ': ' . $this->lng->txt('crs_edit_timings'));
$timings = new ilRadioGroupInputGUI($this->lng->txt('timings'), 'timing_type');
// opt deactivated
$dea = new ilRadioOption($this->lng->txt('crs_timings_disabled'), ilObjectActivation::TIMINGS_DEACTIVATED);
$dea->setInfo($this->lng->txt('crs_timings_disabled_info'));
$timings->addOption($dea);
// Visiblity
$vis = new ilRadioOption($this->lng->txt('crs_timings_availability_enabled'), ilObjectActivation::TIMINGS_ACTIVATION);
#$vis->setInfo($this->lng->txt('crs_timings_visibility'));
$start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_start'), 'timing_start');
$start->setShowTime(true);
#$start->setMinuteStepSize(5);
$vis->addSubItem($start);
$end = new ilDateTimeInputGUI($this->lng->txt('crs_timings_end'), 'timing_end');
$end->setShowTime(true);
#$end->setMinuteStepSize(5);
$vis->addSubItem($end);
$isv = new ilCheckboxInputGUI($this->lng->txt('crs_timings_visibility_short'), 'visible');
$isv->setInfo($this->lng->txt('crs_timings_visibility'));
$isv->setValue(1);
$vis->addSubItem($isv);
$timings->addOption($vis);
// Timings
$tim = new ilRadioOption($this->lng->txt('crs_timings_presetting'), ilObjectActivation::TIMINGS_PRESETTING);
$tim->setInfo($this->lng->txt('crs_item_presetting_info'));
$start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_sug_begin'), 'sug_start');
$tim->addSubItem($start);
$end = new ilDateTimeInputGUI($this->lng->txt('crs_timings_sug_end'), 'sug_end');
$tim->addSubItem($end);
if ($tree->checkForParentType($this->parent_ref_id, 'crs')) {
$cha = new ilCheckboxInputGUI($this->lng->txt('crs_timings_changeable'), 'changeable');
$tim->addSubItem($cha);
$start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_early_begin'), 'early_start');
$tim->addSubItem($start);
$late = new ilDateTimeInputGUI($this->lng->txt('crs_timings_short_limit_start_end'), 'late_end');
$tim->addSubItem($late);
}
$timings->addOption($tim);
$this->form->addItem($timings);
$this->form->addCommandButton('update', $this->lng->txt('save'));
$this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
}
示例14: initPropertiesForm
/**
* Init survey settings form
*
* @return ilPropertyFormGUI
*/
function initPropertiesForm()
{
$template_settings = $hide_rte_switch = null;
$template = $this->object->getTemplate();
if ($template) {
include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
$template = new ilSettingsTemplate($template);
$template_settings = $template->getSettings();
$hide_rte_switch = $template_settings["rte_switch"]["hide"];
}
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTableWidth("100%");
$form->setId("survey_properties");
// general properties
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("settings"));
$form->addItem($header);
// title & description (meta data)
include_once 'Services/MetaData/classes/class.ilMD.php';
$md_obj = new ilMD($this->object->getId(), 0, "svy");
$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);
}
// pool usage
$pool_usage = new ilRadioGroupInputGUI($this->lng->txt("survey_question_pool_usage"), "use_pool");
$opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_active"), 1);
$opt->setInfo($this->lng->txt("survey_question_pool_usage_active_info"));
$pool_usage->addOption($opt);
$opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_inactive"), 0);
$opt->setInfo($this->lng->txt("survey_question_pool_usage_inactive_info"));
$pool_usage->addOption($opt);
$pool_usage->setValue($this->object->getPoolUsage());
$form->addItem($pool_usage);
// 360°: appraisees
if ($this->object->get360Mode()) {
$self_eval = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_evaluation"), "self_eval");
$self_eval->setInfo($this->lng->txt("survey_360_self_evaluation_info"));
$self_eval->setChecked($this->object->get360SelfEvaluation());
$form->addItem($self_eval);
$self_rate = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_raters"), "self_rate");
$self_rate->setInfo($this->lng->txt("survey_360_self_raters_info"));
$self_rate->setChecked($this->object->get360SelfRaters());
$form->addItem($self_rate);
$self_appr = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_appraisee"), "self_appr");
$self_appr->setInfo($this->lng->txt("survey_360_self_appraisee_info"));
$self_appr->setChecked($this->object->get360SelfAppraisee());
$form->addItem($self_appr);
}
// activation
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->setInfo($this->lng->txt('svy_activation_online_info') . $act_obj_info);
$online->setChecked($this->object->isOnline());
$form->addItem($online);
$act_type = new ilCheckboxInputGUI($this->lng->txt('rep_visibility_until'), 'access_type');
// $act_type->setInfo($this->lng->txt('svy_availability_until_info'));
$act_type->setChecked($this->object->isActivationLimited());
$this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
$dur = new ilDateDurationInputGUI($this->lng->txt('rep_time_period'), "access_period");
$dur->setShowTime(true);
$date = $this->object->getActivationStartDate();
$dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$dur->setStartText($this->lng->txt('rep_activation_limited_start'));
$date = $this->object->getActivationEndDate();
$dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$dur->setEndText($this->lng->txt('rep_activation_limited_end'));
$act_type->addSubItem($dur);
$visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'access_visiblity');
$visible->setInfo($this->lng->txt('svy_activation_limited_visibility_info'));
$visible->setChecked($this->object->getActivationVisibility());
$act_type->addSubItem($visible);
//.........这里部分代码省略.........
示例15: initHTTPSForm
private function initHTTPSForm()
{
global $ilCtrl, $lng;
$this->setServerInfoSubTabs('adm_https');
$lng->loadLanguageModule('ps');
include_once './Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
$security = ilSecuritySettings::_getInstance();
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setTitle($lng->txt("adm_https"));
$form->setFormAction($ilCtrl->getFormAction($this, 'saveHTTPS'));
$check2 = new ilCheckboxInputGUI($lng->txt('activate_https'), 'https_enabled');
$check2->setChecked($security->isHTTPSEnabled() ? 1 : 0);
$check2->setValue(1);
$form->addItem($check2);
// save and cancel commands
$form->addCommandButton('saveHTTPS', $lng->txt('save'));
return $form;
}