本文整理汇总了PHP中ilNonEditableValueGUI::addSubItem方法的典型用法代码示例。如果您正苦于以下问题:PHP ilNonEditableValueGUI::addSubItem方法的具体用法?PHP ilNonEditableValueGUI::addSubItem怎么用?PHP ilNonEditableValueGUI::addSubItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilNonEditableValueGUI
的用法示例。
在下文中一共展示了ilNonEditableValueGUI::addSubItem方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initFormRoleAssignments
/**
* Init form table for new role assignments
*
* @param string mode edit | create
* @param object object of ilLDAPRoleAsssignmentRule
* @access protected
*
*/
protected function initFormRoleAssignments($a_mode)
{
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
include_once 'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php';
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this));
switch ($a_mode) {
case 'edit':
$this->form->setTitle($this->lng->txt('ldap_edit_role_ass_rule'));
$this->form->addCommandButton('updateRoleAssignment', $this->lng->txt('save'));
$this->form->addCommandButton('roleAssignments', $this->lng->txt('cancel'));
break;
case 'create':
$this->form->setTitle($this->lng->txt('ldap_add_role_ass_rule'));
$this->form->addCommandButton('addRoleAssignment', $this->lng->txt('ldap_btn_add_role_ass'));
$this->form->addCommandButton('roleAssignments', $this->lng->txt('cancel'));
break;
}
// Role Selection
$role = new ilRadioGroupInputGUI($this->lng->txt('ldap_ilias_role'), 'role_name');
$role->setRequired(true);
$global = new ilRadioOption($this->lng->txt('ldap_global_role'), 0);
$role->addOption($global);
$role_select = new ilSelectInputGUI('', 'role_id');
$role_select->setOptions($this->prepareGlobalRoleSelection());
$global->addSubItem($role_select);
$local = new ilRadioOption($this->lng->txt('ldap_local_role'), 1);
$role->addOption($local);
include_once './Services/Form/classes/class.ilRoleAutoCompleteInputGUI.php';
$role_search = new ilRoleAutoCompleteInputGUI('', 'role_search', $this, 'addRoleAutoCompleteObject');
$role_search->setSize(40);
$local->addSubItem($role_search);
$role->setInfo($this->lng->txt('ldap_role_name_info'));
$this->form->addItem($role);
// Update options
$update = new ilNonEditableValueGUI($this->lng->txt('ldap_update_roles'), 'update_roles');
$update->setValue($this->lng->txt('ldap_check_role_assignment'));
$add = new ilCheckboxInputGUI('', 'add_missing');
$add->setOptionTitle($this->lng->txt('ldap_add_missing'));
$update->addSubItem($add);
$remove = new ilCheckboxInputGUI('', 'remove_deprecated');
$remove->setOptionTitle($this->lng->txt('ldap_remove_deprecated'));
$update->addSubItem($remove);
$this->form->addItem($update);
// Assignment Type
$group = new ilRadioGroupInputGUI($this->lng->txt('ldap_assignment_type'), 'type');
#$group->setValue($current_rule->getType());
$group->setRequired(true);
// Option by group
$radio_group = new ilRadioOption($this->lng->txt('ldap_role_by_group'), ilLDAPRoleAssignmentRule::TYPE_GROUP);
$dn = new ilTextInputGUI($this->lng->txt('ldap_group_dn'), 'dn');
#$dn->setValue($current_rule->getDN());
$dn->setSize(32);
$dn->setMaxLength(512);
$dn->setInfo($this->lng->txt('ldap_role_grp_dn_info'));
$radio_group->addSubItem($dn);
$at = new ilTextInputGUI($this->lng->txt('ldap_role_grp_at'), 'at');
#$at->setValue($current_rule->getMemberAttribute());
$at->setSize(16);
$at->setMaxLength(128);
$radio_group->addSubItem($at);
$isdn = new ilCheckboxInputGUI($this->lng->txt('ldap_role_grp_isdn'), 'isdn');
#$isdn->setChecked($current_rule->isMemberAttributeDN());
$isdn->setInfo($this->lng->txt('ldap_group_member_info'));
$radio_group->addSubItem($isdn);
$radio_group->setInfo($this->lng->txt('ldap_role_grp_info'));
$group->addOption($radio_group);
// Option by Attribute
$radio_attribute = new ilRadioOption($this->lng->txt('ldap_role_by_attribute'), ilLDAPRoleAssignmentRule::TYPE_ATTRIBUTE);
$name = new ilTextInputGUI($this->lng->txt('ldap_role_at_name'), 'name');
#$name->setValue($current_rule->getAttributeName());
$name->setSize(32);
$name->setMaxLength(128);
#$name->setInfo($this->lng->txt('ldap_role_at_name_info'));
$radio_attribute->addSubItem($name);
// Radio Attribute
$val = new ilTextInputGUI($this->lng->txt('ldap_role_at_value'), 'value');
#$val->setValue($current_rule->getAttributeValue());
$val->setSize(32);
$val->setMaxLength(128);
#$val->setInfo($this->lng->txt('ldap_role_at_value_info'));
$radio_attribute->addSubItem($val);
$radio_attribute->setInfo($this->lng->txt('ldap_role_at_info'));
$group->addOption($radio_attribute);
// Option by Plugin
$pl_active = (bool) $this->hasActiveRoleAssignmentPlugins();
$pl = new ilRadioOption($this->lng->txt('ldap_plugin'), 3);
$pl->setInfo($this->lng->txt('ldap_plugin_info'));
$pl->setDisabled(!$pl_active);
$id = new ilNumberInputGUI($this->lng->txt('ldap_plugin_id'), 'plugin_id');
$id->setDisabled(!$pl_active);
$id->setSize(3);
//.........这里部分代码省略.........
示例2: initFormGeneralSettings
/**
* init general settings form
* @return
*/
protected function initFormGeneralSettings()
{
global $ilSetting;
$this->setSubTabs('settings');
$this->tabs_gui->setTabActive('settings');
$this->tabs_gui->setSubTabActive('general_settings');
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this, 'saveGeneralSettings'));
$this->form->setTitle($this->lng->txt('general_settings'));
$lua = new ilCheckboxInputGUI($this->lng->txt('enable_local_user_administration'), 'lua');
$lua->setInfo($this->lng->txt('enable_local_user_administration_info'));
$lua->setValue(1);
$this->form->addItem($lua);
$lrua = new ilCheckboxInputGUI($this->lng->txt('restrict_user_access'), 'lrua');
$lrua->setInfo($this->lng->txt('restrict_user_access_info'));
$lrua->setValue(1);
$this->form->addItem($lrua);
// enable alphabetical navigation in user administration
$alph = new ilCheckboxInputGUI($this->lng->txt('user_adm_enable_alpha_nav'), 'user_adm_alpha_nav');
//$alph->setInfo($this->lng->txt('restrict_user_access_info'));
$alph->setValue(1);
$this->form->addItem($alph);
// account codes
$code = new ilCheckboxInputGUI($this->lng->txt("user_account_code_setting"), "user_reactivate_code");
$code->setInfo($this->lng->txt('user_account_code_setting_info'));
$this->form->addItem($code);
// delete own account
$own = new ilCheckboxInputGUI($this->lng->txt("user_allow_delete_own_account"), "user_own_account");
$this->form->addItem($own);
$own_email = new ilEMailInputGUI($this->lng->txt("user_delete_own_account_notification_email"), "user_own_account_email");
$own->addSubItem($own_email);
// BEGIN SESSION SETTINGS
// create session handling radio group
$ssettings = new ilRadioGroupInputGUI($this->lng->txt('sess_mode'), 'session_handling_type');
// first option, fixed session duration
$fixed = new ilRadioOption($this->lng->txt('sess_fixed_duration'), ilSession::SESSION_HANDLING_FIXED);
// create session reminder subform
$cb = new ilCheckboxInputGUI($this->lng->txt("session_reminder"), "session_reminder_enabled");
$expires = ilSession::getSessionExpireValue();
$time = ilFormat::_secondsToString($expires, true);
$cb->setInfo($this->lng->txt("session_reminder_info") . "<br />" . sprintf($this->lng->txt('session_reminder_session_duration'), $time));
$fixed->addSubItem($cb);
// add session handling to radio group
$ssettings->addOption($fixed);
// second option, session control
$ldsh = new ilRadioOption($this->lng->txt('sess_load_dependent_session_handling'), ilSession::SESSION_HANDLING_LOAD_DEPENDENT);
// add session control subform
require_once 'Services/Authentication/classes/class.ilSessionControl.php';
// this is the max count of active sessions
// that are getting started simlutanously
$sub_ti = new ilTextInputGUI($this->lng->txt('session_max_count'), 'session_max_count');
$sub_ti->setMaxLength(5);
$sub_ti->setSize(5);
$sub_ti->setInfo($this->lng->txt('session_max_count_info'));
if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) {
$sub_ti->setDisabled(true);
}
$ldsh->addSubItem($sub_ti);
// after this (min) idle time the session can be deleted,
// if there are further requests for new sessions,
// but max session count is reached yet
$sub_ti = new ilTextInputGUI($this->lng->txt('session_min_idle'), 'session_min_idle');
$sub_ti->setMaxLength(5);
$sub_ti->setSize(5);
$sub_ti->setInfo($this->lng->txt('session_min_idle_info'));
if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) {
$sub_ti->setDisabled(true);
}
$ldsh->addSubItem($sub_ti);
// after this (max) idle timeout the session expires
// and become invalid, so it is not considered anymore
// when calculating current count of active sessions
$sub_ti = new ilTextInputGUI($this->lng->txt('session_max_idle'), 'session_max_idle');
$sub_ti->setMaxLength(5);
$sub_ti->setSize(5);
$sub_ti->setInfo($this->lng->txt('session_max_idle_info'));
if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) {
$sub_ti->setDisabled(true);
}
$ldsh->addSubItem($sub_ti);
// this is the max duration that can elapse between the first and the secnd
// request to the system before the session is immidietly deleted
$sub_ti = new ilTextInputGUI($this->lng->txt('session_max_idle_after_first_request'), 'session_max_idle_after_first_request');
$sub_ti->setMaxLength(5);
$sub_ti->setSize(5);
$sub_ti->setInfo($this->lng->txt('session_max_idle_after_first_request_info'));
if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) {
$sub_ti->setDisabled(true);
}
$ldsh->addSubItem($sub_ti);
// add session control to radio group
$ssettings->addOption($ldsh);
// add radio group to form
if ($ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) {
// just shows the status wether the session
//.........这里部分代码省略.........
示例3: initFormLink
//.........这里部分代码省略.........
$this->form->addCommandButton('updateLink', $this->lng->txt('save'));
$this->form->addCommandButton('view', $this->lng->txt('cancel'));
break;
}
$this->form->setFormAction($this->ctrl->getFormAction($this));
if ($a_mode == self::LINK_MOD_ADD and $this->isContainerMetaDataRequired()) {
ilUtil::sendInfo($this->lng->txt('webr_container_info'));
$this->form->setTitle($this->lng->txt('webr_edit_list'));
// List Title
$title = new ilTextInputGUI($this->lng->txt('webr_list_title'), 'lti');
$title->setRequired(true);
$title->setSize(40);
$title->setMaxLength(127);
$this->form->addItem($title);
// List Description
$desc = new ilTextAreaInputGUI($this->lng->txt('webr_list_desc'), 'tde');
$desc->setRows(3);
$desc->setCols(40);
$this->form->addItem($desc);
// Addtional section
$sect = new ilFormSectionHeaderGUI();
$sect->setTitle($this->lng->txt('webr_add'));
$this->form->addItem($sect);
}
// Target
/*
$tar = new ilTextInputGUI($this->lng->txt('webr_link_target'),'tar');
$tar->setValue("http://");
$tar->setSize(40);
$tar->setMaxLength(500);
*/
include_once 'Services/Form/classes/class.ilLinkInputGUI.php';
$tar = new ilLinkInputGUI($this->lng->txt('webr_link_target'), 'tar');
$tar->setInternalLinkFilterTypes(array("PageObject", "GlossaryItem", "RepositoryItem"));
$tar->setRequired(true);
$this->form->addItem($tar);
// Title
$tit = new ilTextInputGUI($this->lng->txt('webr_link_title'), 'tit');
$tit->setRequired(true);
$tit->setSize(40);
$tit->setMaxLength(127);
$this->form->addItem($tit);
// Description
$des = new ilTextAreaInputGUI($this->lng->txt('description'), 'des');
$des->setRows(3);
$des->setCols(40);
$this->form->addItem($des);
if ($a_mode != self::LINK_MOD_CREATE) {
// Active
$act = new ilCheckboxInputGUI($this->lng->txt('active'), 'act');
$act->setChecked(true);
$act->setValue(1);
$this->form->addItem($act);
// Check
$che = new ilCheckboxInputGUI($this->lng->txt('webr_disable_check'), 'che');
$che->setValue(1);
$this->form->addItem($che);
}
// Valid
if ($a_mode == self::LINK_MOD_EDIT) {
$val = new ilCheckboxInputGUI($this->lng->txt('valid'), 'vali');
$this->form->addItem($val);
}
if (ilParameterAppender::_isEnabled() && $a_mode != self::LINK_MOD_CREATE) {
$dyn = new ilNonEditableValueGUI($this->lng->txt('links_dyn_parameter'));
$dyn->setInfo($this->lng->txt('links_dynamic_info'));
if (count($links = ilParameterAppender::_getParams((int) $_GET['link_id']))) {
$ex = new ilCustomInputGUI($this->lng->txt('links_existing_params'), 'ex');
$dyn->addSubItem($ex);
foreach ($links as $id => $link) {
$p = new ilCustomInputGUI();
$ptpl = new ilTemplate('tpl.link_dyn_param_edit.html', true, true, 'Modules/WebResource');
$ptpl->setVariable('INFO_TXT', ilParameterAppender::parameterToInfo($link['name'], $link['value']));
$this->ctrl->setParameter($this, 'param_id', $id);
$ptpl->setVariable('LINK_DEL', $this->ctrl->getLinkTarget($this, 'deleteParameterForm'));
$ptpl->setVariable('LINK_TXT', $this->lng->txt('delete'));
$p->setHtml($ptpl->get());
$dyn->addSubItem($p);
}
}
// Existing parameters
// New parameter
if ($a_mode != self::LINK_MOD_CREATE) {
#$new = new ilCustomInputGUI($this->lng->txt('links_add_param'),'');
#$dyn->addSubItem($new);
}
// Dynyamic name
$nam = new ilTextInputGUI($this->lng->txt('links_name'), 'nam');
$nam->setSize(12);
$nam->setMaxLength(128);
$dyn->addSubItem($nam);
// Dynamic value
$val = new ilSelectInputGUI($this->lng->txt('links_value'), 'val');
$val->setOptions(ilParameterAppender::_getOptionSelect());
$val->setValue(0);
$dyn->addSubItem($val);
$this->form->addItem($dyn);
}
}
示例4: showCustomFields
/**
* Show course defined fields
*
* @access protected
*/
protected function showCustomFields()
{
global $ilUser;
include_once 'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php';
include_once 'Modules/Course/classes/Export/class.ilCourseUserData.php';
if (!count($cdf_fields = ilCourseDefinedFieldDefinition::_getFields($this->container->getId()))) {
return true;
}
$cdf = new ilNonEditableValueGUI($this->lng->txt('ps_crs_user_fields'));
$cdf->setValue($this->lng->txt($this->type . '_ps_cdf_info'));
$cdf->setRequired(true);
foreach ($cdf_fields as $field_obj) {
$course_user_data = new ilCourseUserData($ilUser->getId(), $field_obj->getId());
switch ($field_obj->getType()) {
case IL_CDF_TYPE_SELECT:
$select = new ilSelectInputGUI($field_obj->getName(), 'cdf[' . $field_obj->getId() . ']');
$select->setValue(ilUtil::stripSlashes($_POST['cdf'][$field_obj->getId()]));
$select->setOptions($field_obj->prepareSelectBox());
if ($field_obj->isRequired()) {
$select->setRequired(true);
}
$cdf->addSubItem($select);
break;
case IL_CDF_TYPE_TEXT:
$text = new ilTextInputGUI($field_obj->getName(), 'cdf[' . $field_obj->getId() . ']');
$text->setValue(ilUtil::stripSlashes($_POST['cdf'][$field_obj->getId()]));
$text->setSize(32);
$text->setMaxLength(255);
if ($field_obj->isRequired()) {
$text->setRequired(true);
}
$cdf->addSubItem($text);
break;
}
}
$this->form->addItem($cdf);
return true;
}
示例5: addCustomFields
/**
* Add custom course fields
* @param type $form
* @param type $a_obj_id
* @param type $a_type
*/
public static function addCustomFields($form, $a_obj_id, $a_type, $a_mode = 'user')
{
global $lng;
include_once 'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php';
include_once 'Modules/Course/classes/Export/class.ilCourseUserData.php';
if (!count($cdf_fields = ilCourseDefinedFieldDefinition::_getFields($a_obj_id))) {
return $form;
}
if ($a_mode == 'user') {
$cdf = new ilNonEditableValueGUI($lng->txt('ps_' . $a_type . '_user_fields'));
$cdf->setValue($lng->txt($a_type . '_ps_cdf_info'));
$cdf->setRequired(true);
}
foreach ($cdf_fields as $field_obj) {
switch ($field_obj->getType()) {
case IL_CDF_TYPE_SELECT:
if ($field_obj->getValueOptions()) {
// Show as radio group
$option_radios = new ilRadioGroupInputGUI($field_obj->getName(), 'cdf_' . $field_obj->getId());
if ($field_obj->isRequired()) {
$option_radios->setRequired(true);
}
$open_answer_indexes = (array) $field_obj->getValueOptions();
foreach ($field_obj->getValues() as $key => $val) {
$option_radio = new ilRadioOption($val, $field_obj->getId() . '_' . $key);
// open answers
if (in_array($key, $open_answer_indexes)) {
$open_answer = new ilTextInputGUI($lng->txt("form_open_answer"), 'cdf_oa_' . $field_obj->getId() . '_' . $key);
$open_answer->setRequired(true);
$option_radio->addSubItem($open_answer);
}
$option_radios->addOption($option_radio);
}
if ($a_mode == 'user') {
$cdf->addSubItem($option_radios);
} else {
$form->addItem($option_radios);
}
} else {
$select = new ilSelectInputGUI($field_obj->getName(), 'cdf_' . $field_obj->getId());
#$select->setValue(ilUtil::stripSlashes($_POST['cdf'][$field_obj->getId()]));
$select->setOptions($field_obj->prepareSelectBox());
if ($field_obj->isRequired()) {
$select->setRequired(true);
}
if ($a_mode == 'user') {
$cdf->addSubItem($select);
} else {
$form->addItem($select);
}
}
break;
case IL_CDF_TYPE_TEXT:
$text = new ilTextInputGUI($field_obj->getName(), 'cdf_' . $field_obj->getId());
#$text->setValue(ilUtil::stripSlashes($_POST['cdf'][$field_obj->getId()]));
$text->setSize(32);
$text->setMaxLength(255);
if ($field_obj->isRequired()) {
$text->setRequired(true);
}
if ($a_mode == 'user') {
$cdf->addSubItem($text);
} else {
$form->addItem($text);
}
break;
}
}
if ($a_mode == 'user') {
$form->addItem($cdf);
}
return $form;
}
示例6: initFormTimeBuffer
protected function initFormTimeBuffer(ilPropertyFormGUI $form)
{
$tbuffer = new ilNonEditableValueGUI(ilViteroPlugin::getInstance()->txt('time_buffer'), 'dummy');
// Buffer before
$buffer_before = new ilSelectInputGUI(ilViteroPlugin::getInstance()->txt('time_buffer_before'), 'buffer_before');
$buffer_before->setOptions(array(0 => '0 min', 15 => '15 min', 30 => '30 min', 45 => '45 min', 60 => '1 h'));
$buffer_before->setValue(ilViteroSettings::getInstance()->getStandardGracePeriodBefore());
$tbuffer->addSubItem($buffer_before);
// Buffer after
$buffer_after = new ilSelectInputGUI(ilViteroPlugin::getInstance()->txt('time_buffer_after'), 'buffer_after');
$buffer_after->setOptions(array(0 => '0 min', 15 => '15 min', 30 => '30 min', 45 => '45 min', 60 => '1 h'));
$buffer_after->setValue(ilViteroSettings::getInstance()->getStandardGracePeriodAfter());
$tbuffer->addSubItem($buffer_after);
$form->addItem($tbuffer);
return true;
}
示例7: fillRegistrationType
/**
* fill registration type
*
* @access protected
* @return
*/
protected function fillRegistrationType()
{
global $ilUser;
if ($this->container->getSubscriptionLimitationType() == IL_CRS_SUBSCRIPTION_DEACTIVATED) {
$reg = new ilCustomInputGUI($this->lng->txt('mem_reg_type'));
#$reg->setHtml($this->lng->txt('crs_info_reg_deactivated'));
$reg->setAlert($this->lng->txt('crs_info_reg_deactivated'));
#ilUtil::sendFailure($this->lng->txt('crs_info_reg_deactivated'));
#$reg = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
#$reg->setValue($this->lng->txt('crs_info_reg_deactivated'));
#$reg->setAlert($this->lng->txt('grp_reg_deactivated_alert'));
$this->form->addItem($reg);
// Disable registration
$this->enableRegistration(false);
return true;
}
switch ($this->container->getSubscriptionType()) {
case IL_CRS_SUBSCRIPTION_DIRECT:
// no "request" info if waiting list is active
if ($this->isWaitingListActive()) {
return true;
}
$txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
$txt->setValue($this->lng->txt('crs_info_reg_direct'));
$this->form->addItem($txt);
break;
case IL_CRS_SUBSCRIPTION_PASSWORD:
$txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
$txt->setValue($this->lng->txt('crs_subscription_options_password'));
$pass = new ilTextInputGUI($this->lng->txt('passwd'), 'grp_passw');
$pass->setInputType('password');
$pass->setSize(12);
$pass->setMaxLength(32);
#$pass->setRequired(true);
$pass->setInfo($this->lng->txt('crs_info_reg_password'));
$txt->addSubItem($pass);
$this->form->addItem($txt);
break;
case IL_CRS_SUBSCRIPTION_CONFIRMATION:
// no "request" info if waiting list is active
if ($this->isWaitingListActive()) {
return true;
}
$txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
$txt->setValue($this->lng->txt('crs_subscription_options_confirmation'));
$sub = new ilTextAreaInputGUI($this->lng->txt('crs_reg_subject'), 'subject');
$sub->setValue($_POST['subject']);
$sub->setInfo($this->lng->txt('crs_info_reg_confirmation'));
$sub->setCols(40);
$sub->setRows(5);
if ($this->participants->isSubscriber($ilUser->getId())) {
$sub_data = $this->participants->getSubscriberData($ilUser->getId());
$sub->setValue($sub_data['subject']);
$sub->setInfo('');
ilUtil::sendFailure($this->lng->txt('crs_reg_user_already_subscribed'));
$this->enableRegistration(false);
}
$txt->addSubItem($sub);
$this->form->addItem($txt);
break;
default:
return true;
}
return true;
}
示例8: initBasicSettingsForm
/**
* Init basic settings form.
*/
public function initBasicSettingsForm()
{
global $lng, $ilSetting;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form = new ilPropertyFormGUI();
$lng->loadLanguageModule("pd");
// installation short title
$ti = new ilTextInputGUI($this->lng->txt("short_inst_name"), "short_inst_name");
$ti->setMaxLength(200);
$ti->setSize(40);
$ti->setValue($ilSetting->get("short_inst_name"));
$ti->setInfo($this->lng->txt("short_inst_name_info"));
$this->form->addItem($ti);
// public section
$cb = new ilCheckboxInputGUI($this->lng->txt("pub_section"), "pub_section");
$cb->setInfo($lng->txt("pub_section_info"));
if ($ilSetting->get("pub_section")) {
$cb->setChecked(true);
}
// search engine
include_once 'Services/PrivacySecurity/classes/class.ilRobotSettings.php';
$robot_settings = ilRobotSettings::_getInstance();
$cb2 = new ilCheckboxInputGUI($this->lng->txt("search_engine"), "open_google");
$cb2->setInfo($this->lng->txt("enable_search_engine"));
$cb->addSubItem($cb2);
if (!$robot_settings->checkModRewrite()) {
$cb2->setAlert($lng->txt("mod_rewrite_disabled"));
$cb2->setChecked(false);
$cb2->setDisabled(true);
} elseif (!$robot_settings->checkRewrite()) {
$cb2->setAlert($lng->txt("allow_override_alert"));
$cb2->setChecked(false);
$cb2->setDisabled(true);
} else {
if ($ilSetting->get("open_google")) {
$cb2->setChecked(true);
}
}
// Enable Global Profiles
$cb_prop = new ilCheckboxInputGUI($lng->txt('pd_enable_user_publish'), 'enable_global_profiles');
$cb_prop->setInfo($lng->txt('pd_enable_user_publish_info'));
$cb_prop->setChecked($ilSetting->get('enable_global_profiles'));
$cb->addSubItem($cb_prop);
// activate captcha for anonymous wiki/forum editing
include_once "./Services/Captcha/classes/class.ilCaptchaUtil.php";
$cap = new ilCheckboxInputGUI($this->lng->txt('adm_captcha_wiki_forum'), 'activate_captcha_anonym');
$cap->setValue(1);
if (ilCaptchaUtil::checkFreetype()) {
$cap->setChecked($ilSetting->get('activate_captcha_anonym'));
} else {
$cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
}
$cb->addSubItem($cap);
$this->form->addItem($cb);
// default repository view
$options = array("flat" => $lng->txt("flatview"), "tree" => $lng->txt("treeview"));
$si = new ilSelectInputGUI($this->lng->txt("def_repository_view"), "default_rep_view");
$si->setOptions($options);
$si->setInfo($this->lng->txt(""));
if ($ilSetting->get("default_repository_view") == "tree") {
$si->setValue("tree");
} else {
$si->setValue("flat");
}
$this->form->addItem($si);
//
$options = array("" => $lng->txt("adm_rep_tree_only_container"), "tree" => $lng->txt("adm_all_resource_types"));
// repository tree
$radg = new ilRadioGroupInputGUI($lng->txt("adm_rep_tree_presentation"), "tree_pres");
$radg->setValue($ilSetting->get("repository_tree_pres"));
$op1 = new ilRadioOption($lng->txt("adm_rep_tree_only_cntr"), "", $lng->txt("adm_rep_tree_only_cntr_info"));
$radg->addOption($op1);
$op2 = new ilRadioOption($lng->txt("adm_rep_tree_all_types"), "all_types", $lng->txt("adm_rep_tree_all_types_info"));
// limit tree in courses and groups
$cb = new ilCheckboxInputGUI($lng->txt("adm_rep_tree_limit_grp_crs"), "rep_tree_limit_grp_crs");
$cb->setChecked($ilSetting->get("rep_tree_limit_grp_crs"));
$cb->setInfo($lng->txt("adm_rep_tree_limit_grp_crs_info"));
$op2->addSubItem($cb);
$radg->addOption($op2);
$this->form->addItem($radg);
$sdesc = new ilCheckboxInputGUI($lng->txt("adm_rep_shorten_description"), "rep_shorten_description");
$sdesc->setInfo($lng->txt("adm_rep_shorten_description_info"));
$sdesc->setChecked($ilSetting->get("rep_shorten_description"));
$this->form->addItem($sdesc);
$sdesclen = new ilTextInputGUI($lng->txt("adm_rep_shorten_description_length"), "rep_shorten_description_length");
$sdesclen->setValue($ilSetting->get("rep_shorten_description_length"));
$sdesclen->setSize(3);
$sdesc->addSubItem($sdesclen);
// synchronize repository tree with main view
$cb = new ilCheckboxInputGUI($lng->txt("adm_synchronize_rep_tree"), "rep_tree_synchronize");
$cb->setInfo($lng->txt("adm_synchronize_rep_tree_info"));
$cb->setChecked($ilSetting->get("rep_tree_synchronize"));
$this->form->addItem($cb);
// repository access check
/* $options = array(
0 => "0",
10 => "10",
//.........这里部分代码省略.........
示例9: initFormRoleAssignment
protected function initFormRoleAssignment($a_mode = 'default')
{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this, 'cancel'));
$this->form->setTitle($this->lng->txt('shib_role_ass_table'));
if ($a_mode == 'default') {
$this->form->setTitle($this->lng->txt('shib_role_ass_table'));
$this->form->addCommandButton('addRoleAssignmentRule', $this->lng->txt('shib_new_rule'));
$this->form->addCommandButton('settings', $this->lng->txt('cancel'));
} else {
$this->form->setTitle($this->lng->txt('shib_update_role_ass_table'));
$this->form->addCommandButton('updateRoleAssignmentRule', $this->lng->txt('save'));
$this->form->addCommandButton('roleAssignment', $this->lng->txt('cancel'));
}
// Role selection
$role = new ilRadioGroupInputGUI($this->lng->txt('shib_role_name'), 'role_name');
$role->setRequired(true);
$global = new ilRadioOption($this->lng->txt('shib_global_role'), 0);
$role->addOption($global);
$role_select = new ilSelectInputGUI('', 'role_id');
$role_select->setOptions($this->prepareRoleSelect());
$global->addSubItem($role_select);
$local = new ilRadioOption($this->lng->txt('shib_local_role'), 1);
$role->addOption($local);
include_once './Services/Form/classes/class.ilRoleAutoCompleteInputGUI.php';
$role_search = new ilRoleAutoCompleteInputGUI('', 'role_search', $this, 'addRoleAutoCompleteObject');
$role_search->setSize(40);
$local->addSubItem($role_search);
include_once './Services/AccessControl/classes/class.ilRoleAutoComplete.php';
$role->setInfo($this->lng->txt('shib_role_name_info'));
$this->form->addItem($role);
// Update options
$update = new ilNonEditableValueGUI($this->lng->txt('shib_update_roles'), 'update_roles');
$update->setValue($this->lng->txt('shib_check_role_assignment'));
$add = new ilCheckboxInputGUI('', 'add_missing');
$add->setOptionTitle($this->lng->txt('shib_add_missing'));
$add->setValue(1);
$update->addSubItem($add);
$remove = new ilCheckboxInputGUI('', 'remove_deprecated');
$remove->setOptionTitle($this->lng->txt('shib_remove_deprecated'));
$remove->setValue(1);
$update->addSubItem($remove);
$this->form->addItem($update);
// Assignment type
$kind = new ilRadioGroupInputGUI($this->lng->txt('shib_assignment_type'), 'kind');
$kind->setValue(1);
$kind->setRequired(true);
$attr = new ilRadioOption($this->lng->txt('shib_attribute'), 1);
$attr->setInfo($this->lng->txt('shib_attr_info'));
$name = new ilTextInputGUI($this->lng->txt('shib_attribute_name'), 'attr_name');
$name->setSize(32);
$attr->addSubItem($name);
$value = new ilTextInputGUI($this->lng->txt('shib_attribute_value'), 'attr_value');
$value->setSize(32);
$attr->addSubItem($value);
$kind->addOption($attr);
$pl_active = (bool) $this->hasActiveRoleAssignmentPlugins();
$pl = new ilRadioOption($this->lng->txt('shib_plugin'), 2);
$pl->setInfo($this->lng->txt('shib_plugin_info'));
$pl->setDisabled(!$pl_active);
$id = new ilNumberInputGUI($this->lng->txt('shib_plugin_id'), 'plugin_id');
$id->setDisabled(!$pl_active);
$id->setSize(3);
$id->setMaxLength(3);
$id->setMaxValue(999);
$id->setMinValue(1);
$pl->addSubItem($id);
$kind->addOption($pl);
$this->form->addItem($kind);
}
示例10: 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);
}
示例11: fillRegistrationType
/**
* fill registration procedure
*
* @access protected
* @param
* @return
*/
protected function fillRegistrationType()
{
global $ilUser;
if ($this->getWaitingList()->isOnList($ilUser->getId())) {
return true;
}
switch ($this->container->getRegistrationType()) {
case GRP_REGISTRATION_DEACTIVATED:
$reg = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
$reg->setValue($this->lng->txt('grp_reg_disabled'));
#$reg->setAlert($this->lng->txt('grp_reg_deactivated_alert'));
$this->form->addItem($reg);
// Disable registration
$this->enableRegistration(false);
break;
case GRP_REGISTRATION_PASSWORD:
$txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
$txt->setValue($this->lng->txt('grp_pass_request'));
$pass = new ilTextInputGUI($this->lng->txt('passwd'), 'grp_passw');
$pass->setInputType('password');
$pass->setSize(12);
$pass->setMaxLength(32);
#$pass->setRequired(true);
$pass->setInfo($this->lng->txt('group_password_registration_msg'));
$txt->addSubItem($pass);
$this->form->addItem($txt);
break;
case GRP_REGISTRATION_REQUEST:
// no "request" info if waiting list is active
if ($this->isWaitingListActive()) {
return true;
}
$txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
$txt->setValue($this->lng->txt('grp_reg_request'));
$sub = new ilTextAreaInputGUI($this->lng->txt('grp_reg_subject'), 'subject');
$sub->setValue($_POST['subject']);
$sub->setInfo($this->lng->txt('group_req_registration_msg'));
$sub->setCols(40);
$sub->setRows(5);
if ($this->participants->isSubscriber($ilUser->getId())) {
$sub_data = $this->participants->getSubscriberData($ilUser->getId());
$sub->setValue($sub_data['subject']);
$sub->setInfo('');
ilUtil::sendFailure($this->lng->txt('grp_already_assigned'));
$this->enableRegistration(false);
}
$txt->addSubItem($sub);
$this->form->addItem($txt);
break;
case GRP_REGISTRATION_DIRECT:
// no "direct registration" info if waiting list is active
if ($this->isWaitingListActive()) {
return true;
}
$txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
$txt->setValue($this->lng->txt('group_req_direct'));
$this->form->addItem($txt);
break;
default:
return true;
}
return true;
}