/** * 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; }
/** * Init the mapping form */ protected function cInitMappingForm($current_node, $current_attribute) { include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php'; $attributes_obj = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid()); include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setTableWidth("100%"); $this->ctrl->setParameter($this, 'ecs_ca', $current_attribute); $form->setFormAction($this->ctrl->getFormAction($this)); $this->ctrl->setParameter($this, 'ecs_ca', ''); $form->setTitle($this->lng->txt('ecs_cmap_mapping_form_title') . ' ' . ilObject::_lookupTitle(ilObject::_lookupObjId($current_node))); // Iterate through all current attributes $attributes = $attributes_obj->getAttributeSequence($current_attribute); foreach ($attributes as $att_name) { include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMappingRule.php'; $rule = ilECSCourseMappingRule::getInstanceByAttribute($this->getServer()->getServerId(), $this->getMid(), $current_node, $att_name); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('ecs_cmap_att_' . $att_name)); // Filter $form->addItem($section); $isfilter = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_filter'), $att_name . '_is_filter'); $isfilter->setValue($rule->isFilterEnabled() ? 1 : 0); $all_values = new ilRadioOption($this->lng->txt('ecs_cmap_form_all_values'), 0); $isfilter->addOption($all_values); $use_filter = new ilRadioOption($this->lng->txt('ecs_cmap_form_filter_by_values'), 1); $filter = new ilTextInputGUI('', $att_name . '_filter'); $filter->setInfo($this->lng->txt('ecs_cmap_form_filter_info')); $filter->setSize(50); $filter->setMaxLength(512); $filter->setRequired(true); $filter->setValue($rule->getFilter()); $use_filter->addSubItem($filter); $isfilter->addOption($use_filter); $form->addItem($isfilter); // Create subdirs $subdirs = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_form_create_subdirs'), $att_name . '_subdirs'); $subdirs->setChecked($rule->isSubdirCreationEnabled()); $subdirs->setValue(1); // Subdir types (disabled in spec) /* $subdir_type = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_subdir_type'), $att_name.'_subdir_type'); $subdir_type->setValue($rule->getSubDirectoryType()); $value = new ilRadioOption($this->lng->txt('ecs_cmap_form_subdir_value'), ilECSCourseMappingRule::SUBDIR_VALUE); $subdir_type->addOption($value); $name = new ilRadioOption($this->lng->txt('ecs_cmap_form_subdir_name'), ilECSCourseMappingRule::SUBDIR_ATTRIBUTE_NAME); $subdir_type->addOption($name); $subdirs->addSubItem($subdir_type); */ $form->addItem($subdirs); // Directory relations /* $upper_attributes = ilECSCourseAttributes::getInstance( $this->getServer()->getServerId(), $this->getMid())->getUpperAttributes($att_name); if($upper_attributes) { $dir_relation = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_dir_relation'),$att_name.'_dir_relation'); $current_dir = new ilRadioOption($this->lng->txt('ecs_cmap_form_current_dir'),''); $dir_relation->addOption($current_dir); } foreach($upper_attributes as $subdir_name) { $subdir = new ilRadioOption($this->lng->txt('ecs_cmap_att_'.$subdir_name),$subdir_name); $dir_relation->addOption($subdir); } if($upper_attributes) { $dir_relation->setValue((string) $rule->getDirectory()); $form->addItem($dir_relation); } */ } // add list of attributes $hidden_atts = new ilHiddenInputGUI('attributes'); $hidden_atts->setValue(implode(',', $attributes)); $form->addItem($hidden_atts); if ($current_attribute) { $form->addCommandButton('cSaveOverview', $this->lng->txt('save')); } if ($attributes_obj->getNextAttributeName($current_attribute)) { $form->addCommandButton('cAddAttribute', $this->lng->txt('ecs_cmap_add_attribute_btn')); } if ($attributes_obj->getPreviousAttributeName($current_attribute)) { $form->addCommandButton('cDeleteAttribute', $this->lng->txt('ecs_cmap_delete_attribute_btn')); } if (ilECSCourseMappingRule::hasRules($this->getServer()->getServerId(), $this->getMid(), $current_node)) { $form->addCommandButton('cDeleteRulesOfNode', $this->lng->txt('ecs_cmap_delete_rule')); } #$form->addCommandButton('cInitOverview', $this->lng->txt('cancel')); $form->setShowTopButtons(false); return $form; }
public function initTreeImplementationForm() { include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setId('tree_impl'); $form->setTitle($this->lng->txt('tree_implementation')); $form->setFormAction('setup.php?cmd=gateway'); $options = new ilRadioGroupInputGUI('', 'tree_impl_type'); #$options->setRequired(true); $set = new ilSetting('common'); $type = $set->get('main_tree_impl', 'ns') == 'ns' ? 'ns' : 'mp'; $options->setValue($type); $ns = new ilRadioOption($this->lng->txt('tree_implementation_ns'), 'ns'); $options->addOption($ns); $mp = new ilRadioOption($this->lng->txt('tree_implementation_mp'), 'mp'); $options->addOption($mp); $form->addItem($options); $form->addCommandButton('switchTree', $this->lng->txt('tree_implementation_switch_btn')); $form->setShowTopButtons(false); return $form; }
/** * Show openid login if enabled * @return */ protected function showOpenIdLoginForm($page_editor_html) { global $lng, $tpl; include_once './Services/OpenId/classes/class.ilOpenIdSettings.php'; if (!ilOpenIdSettings::getInstance()->isActive()) { return $page_editor_html; } $lng->loadLanguageModule('auth'); include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); //$form->setTableWidth('500'); $form->setShowTopButtons(false); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($lng->txt('login_to_ilias_via_openid')); $openid = new ilTextInputGUI($lng->txt('auth_openid_login'), 'oid_username'); $openid->setSize(18); $openid->setMaxLength(255); $openid->setRequired(true); $openid->setCssClass('ilOpenIDBox'); $openid->setInfo($lng->txt('auth_openid_login_info_a')); $form->addItem($openid); include_once './Services/OpenId/classes/class.ilOpenIdProviders.php'; $pro = new ilSelectInputGUI($lng->txt('auth_openid_provider'), 'oid_provider'); $pro->setOptions(ilOpenIdProviders::getInstance()->getProviderSelection()); $pro->setValue(ilOpenIdProviders::getInstance()->getSelectedProvider()); $form->addItem($pro); $form->addCommandButton("showLogin", $lng->txt("log_in")); return $this->substituteLoginPageElements($tpl, $page_editor_html, $form->getHTML(), '[list-openid-login-form]', 'OID_LOGIN_FORM'); }
/** * Init configuration form. * * @return object form object */ public function initConfigurationForm() { global $lng, $ilCtrl; $pl = $this->getPluginObject(); $this->getPluginObject()->includeClass('class.ilViteroSettings.php'); $settings = ilViteroSettings::getInstance(); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setTitle($this->getPluginObject()->txt('vitero_plugin_configuration')); $form->setFormAction($ilCtrl->getFormAction($this)); $form->addCommandButton('save', $lng->txt('save')); $form->setShowTopButtons(false); // Server url $uri = new ilTextInputGUI($this->getPluginObject()->txt('server_uri'), 'server_uri'); $uri->setRequired(true); $uri->setSize(80); $uri->setMaxLength(512); $uri->setValue($settings->getServerUrl()); $form->addItem($uri); // Admin user $admin = new ilTextInputGUI($this->getPluginObject()->txt('admin_user'), 'admin_user'); $admin->setRequired(true); $admin->setSize(16); $admin->setMaxLength(128); $admin->setValue($settings->getAdminUser()); $form->addItem($admin); // Admin pass $pass = new ilPasswordInputGUI($this->getPluginObject()->txt('admin_pass'), 'admin_pass'); $pass->setSkipSyntaxCheck(true); //$pass->setRequired(true); $pass->setRetype(true); $pass->setSize(12); $pass->setMaxLength(32); //$pass->setValue($settings->getAdminPass()); $form->addItem($pass); // Customer id $cid = new ilNumberInputGUI($this->getPluginObject()->txt('customer_id'), 'customer'); $cid->setSize(3); $cid->setMaxLength(9); $cid->setRequired(true); $cid->setMinValue(1); $cid->setValue($settings->getCustomer()); $form->addItem($cid); // Webstart $ws = new ilTextInputGUI($this->getPluginObject()->txt('webstart_url'), 'webstart'); $ws->setRequired(true); $ws->setSize(80); $ws->setMaxLength(512); $ws->setValue($settings->getWebstartUrl()); $form->addItem($ws); // Client Section $client = new ilFormSectionHeaderGUI(); $client->setTitle($this->getPluginObject()->txt('client_settings')); $form->addItem($client); // cafe $cafe = new ilCheckboxInputGUI($this->getPluginObject()->txt('cafe_setting'), 'cafe'); $cafe->setInfo($this->getPluginObject()->txt('cafe_setting_info')); $cafe->setValue(1); $cafe->setChecked($settings->isCafeEnabled()); $form->addItem($cafe); // content $content = new ilCheckboxInputGUI($this->getPluginObject()->txt('content_admin'), 'content'); $content->setInfo($this->getPluginObject()->txt('content_admin_info')); $content->setValue(1); $content->setChecked($settings->isContentAdministrationEnabled()); $form->addItem($content); // Standard room $standard = new ilCheckboxInputGUI($this->getPluginObject()->txt('standard_room'), 'std_room'); $standard->setInfo($this->getPluginObject()->txt('standard_room_info')); $standard->setValue(1); $standard->setChecked($settings->isStandardRoomEnabled()); $form->addItem($standard); // ldap $ldap = new ilCheckboxInputGUI($this->getPluginObject()->txt('ldap_setting'), 'ldap'); $ldap->setInfo($this->getPluginObject()->txt('ldap_setting_info')); $ldap->setValue(1); $ldap->setChecked($settings->isLdapUsed()); #$form->addItem($ldap); // userprefix $prefix = new ilTextInputGUI($this->getPluginObject()->txt('uprefix'), 'uprefix'); $prefix->setInfo($this->getPluginObject()->txt('uprefix_info')); $prefix->setSize(6); $prefix->setMaxLength(16); $prefix->setValue($settings->getUserPrefix()); $form->addItem($prefix); // avatar $ava = new ilCheckboxInputGUI($this->getPluginObject()->txt('avatar'), 'avatar'); $ava->setValue(1); $ava->setChecked($settings->isAvatarEnabled()); $ava->setInfo($this->getPluginObject()->txt('avatar_info')); $form->addItem($ava); /* if(!class_exists('WSMessage')) { $ava->setDisabled(true); $ava->setAlert($this->getPluginObject()->txt('avatar_warning')); } $cert = new ilTextInputGUI($this->getPluginObject()->txt('mtom_cert'),'mtom_cert'); $cert->setValue($settings->getMTOMCert()); $cert->setSize(100); $cert->setMaxLength(512); $cert->setInfo($this->getPluginObject()->txt('mtom_cert_info')); if(!class_exists('WSMessage')) { $cert->setDisabled(true); } $ava->addSubItem($cert); */ // grace period before $gpb = new ilSelectInputGUI($this->getPluginObject()->txt('std_grace_period_before'), 'grace_period_before'); $gpb->setInfo($this->getPluginObject()->txt('std_grace_period_before_info')); $gpb->setOptions(array(0 => '0 min', 15 => '15 min', 30 => '30 min', 45 => '45 min', 60 => '1 h')); $gpb->setValue($settings->getStandardGracePeriodBefore()); $form->addItem($gpb); // grace period after $gpa = new ilSelectInputGUI($this->getPluginObject()->txt('std_grace_period_after'), 'grace_period_after'); $gpa->setInfo($this->getPluginObject()->txt('std_grace_period_after_info')); $gpa->setOptions(array(0 => '0 min', 15 => '15 min', 30 => '30 min', 45 => '45 min', 60 => '1 h')); $gpa->setValue($settings->getStandardGracePeriodAfter()); $form->addItem($gpa); return $form; }
/** * Init edit template form */ protected function initEditTemplate(ilDidacticTemplateSetting $set) { global $ilCtrl, $objDefinition; include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setShowTopButtons(false); $form->setFormAction($ilCtrl->getFormAction($this, 'updateTemplate')); $form->setTitle($this->lng->txt('didactic_edit_tpl')); $form->addCommandButton('updateTemplate', $this->lng->txt('save')); $form->addCommandButton('overview', $this->lng->txt('cancel')); // title $title = new ilTextInputGUI($this->lng->txt('title'), 'title'); $title->setValue($set->getTitle()); $title->setSize(40); $title->setMaxLength(64); $title->setRequired(true); $form->addItem($title); // desc $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'description'); $desc->setValue($set->getDescription()); $desc->setRows(3); $form->addItem($desc); // info $info = new ilTextAreaInputGUI($this->lng->txt('didactic_install_info'), 'info'); $info->setValue($set->getInfo()); $info->setRows(6); $form->addItem($info); // object type $type = new ilSelectInputGUI($this->lng->txt('obj_type'), 'type'); $type->setRequired(true); $assigned = $set->getAssignments(); $type->setValue(isset($assigned[0]) ? $assigned[0] : ''); $subs = $objDefinition->getCreatableSubobjects('root', false); $options = array(); foreach (array_merge($subs, array('fold' => 1)) as $obj => $null) { if ($objDefinition->isAllowedInRepository($obj)) { $options[$obj] = $this->lng->txt('obj_' . $obj); } } $type->setOptions($options); $form->addItem($type); return $form; }