本文整理汇总了PHP中ilRadioOption::setValue方法的典型用法代码示例。如果您正苦于以下问题:PHP ilRadioOption::setValue方法的具体用法?PHP ilRadioOption::setValue怎么用?PHP ilRadioOption::setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilRadioOption
的用法示例。
在下文中一共展示了ilRadioOption::setValue方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initFormSettings
/**
* Init property form
*
* @return ilPropertyFormGUI $form
*/
protected function initFormSettings()
{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setTitle($this->lng->txt('tracking_settings'));
$form->setFormAction($this->ctrl->getFormAction($this));
// Mode
$mod = new ilRadioGroupInputGUI($this->lng->txt('trac_mode'), 'modus');
$mod->setRequired(true);
$mod->setValue($this->obj_lp->getCurrentMode());
$form->addItem($mod);
foreach ($this->obj_lp->getValidModes() as $mode_key) {
$opt = new ilRadioOption($this->obj_lp->getModeText($mode_key), $mode_key, $this->obj_lp->getModeInfoText($mode_key));
$opt->setValue($mode_key);
$mod->addOption($opt);
// :TODO: Subitem for visits ?!
if ($mode_key == ilLPObjSettings::LP_MODE_VISITS) {
$vis = new ilNumberInputGUI($this->lng->txt('trac_visits'), 'visits');
$vis->setSize(3);
$vis->setMaxLength(4);
$vis->setInfo(sprintf($this->lng->txt('trac_visits_info'), ilObjUserTracking::_getValidTimeSpan()));
$vis->setRequired(true);
$vis->setValue($this->obj_settings->getVisits());
$opt->addSubItem($vis);
}
}
$form->addCommandButton('saveSettings', $this->lng->txt('save'));
return $form;
}
示例2: initFormSettings
/**
* Init property form
*
* @return ilPropertyFormGUI $form
*/
protected function initFormSettings()
{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setTitle($this->lng->txt('tracking_settings'));
$form->setFormAction($this->ctrl->getFormAction($this));
// Mode
$mod = new ilRadioGroupInputGUI($this->lng->txt('trac_mode'), 'modus');
$mod->setRequired(true);
$mod->setValue($this->obj_settings->getMode());
$form->addItem($mod);
foreach ($this->obj_settings->getValidModes() as $mode_key => $mode_name) {
$opt = new ilRadioOption($mode_name, $mode_key, ilLPObjSettings::_mode2InfoText($mode_key));
$opt->setValue($mode_key);
$mod->addOption($opt);
// Subitem for vistits
if ($mode_key == LP_MODE_VISITS) {
$vis = new ilNumberInputGUI($this->lng->txt('trac_visits'), 'visits');
$vis->setSize(3);
$vis->setMaxLength(4);
$vis->setInfo(sprintf($this->lng->txt('trac_visits_info'), ilObjUserTracking::_getValidTimeSpan()));
$vis->setRequired(true);
$vis->setValue($this->obj_settings->getVisits());
$opt->addSubItem($vis);
}
}
/*
// Info Active
$act = new ilCustomInputGUI($this->lng->txt('trac_activated'), '');
$img = new ilTemplate('tpl.obj_settings_img_row.html',true,true,'Services/Tracking');
$img->setVariable("IMG_SRC",
$activated = ilObjUserTracking::_enabledLearningProgress()
? ilUtil::getImagePath('icon_ok.png')
: ilUtil::getImagePath('icon_not_ok.png')
);
$act->setHTML($img->get());
$form->addItem($act);
// Info Anonymized
$ano = new ilCustomInputGUI($this->lng->txt('trac_anonymized'), '');
$img = new ilTemplate('tpl.obj_settings_img_row.html',true,true,'Services/Tracking');
$img->setVariable("IMG_SRC",
$anonymized = !ilObjUserTracking::_enabledUserRelatedData()
? ilUtil::getImagePath('icon_ok.png')
: ilUtil::getImagePath('icon_not_ok.png')
);
$ano->setHTML($img->get());
$form->addItem($ano);
*/
$form->addCommandButton('saveSettings', $this->lng->txt('save'));
return $form;
}
示例3: initEditCustomForm
protected function initEditCustomForm(ilPropertyFormGUI $a_form)
{
// Show didactic template type
$this->initDidacticTemplate($a_form);
// Sorting
$sog = new ilRadioGroupInputGUI($this->lng->txt('sorting_header'), 'sor');
$sog->setRequired(true);
// implicit: there is always a group or course in the path
$sde = new ilRadioOption();
$sde->setValue(ilContainer::SORT_INHERIT);
$sde->setTitle($this->lng->txt('sort_inherit_prefix') . ' (' . ilContainerSortingSettings::sortModeToString(ilContainerSortingSettings::lookupSortModeFromParentContainer($this->object->getId())) . ') ');
$sde->setInfo($this->lng->txt('sorting_info_inherit'));
$sog->addOption($sde);
$sma = new ilRadioOption();
$sma->setValue(ilContainer::SORT_TITLE);
$sma->setTitle($this->lng->txt('sorting_title_header'));
$sma->setInfo($this->lng->txt('sorting_info_title'));
$sog->addOption($sma);
$sti = new ilRadioOption();
$sti->setValue(ilContainer::SORT_MANUAL);
$sti->setTitle($this->lng->txt('sorting_manual_header'));
$sti->setInfo($this->lng->txt('sorting_info_manual'));
$sog->addOption($sti);
$a_form->addItem($sog);
}
示例4: initSortingForm
/**
* Append sorting settings to property form
* @param ilPropertyFormGUI $form
* @param type $a_sorting_settings
*/
protected function initSortingForm(ilPropertyFormGUI $form, array $a_sorting_settings)
{
include_once 'Services/Container/classes/class.ilContainerSortingSettings.php';
include_once './Services/Container/classes/class.ilContainer.php';
$settings = new ilContainerSortingSettings($this->object->getId());
$sort = new ilRadioGroupInputGUI($this->lng->txt('sorting_header'), "sorting");
if (in_array(ilContainer::SORT_INHERIT, $a_sorting_settings)) {
$sort_inherit = new ilRadioOption();
$sort_inherit->setTitle($this->lng->txt('sort_inherit_prefix') . ' (' . ilContainerSortingSettings::sortModeToString(ilContainerSortingSettings::lookupSortModeFromParentContainer($this->object->getId())) . ') ');
$sort_inherit->setValue(ilContainer::SORT_INHERIT);
$sort_inherit->setInfo($this->lng->txt('sorting_info_inherit'));
$sort->addOption($sort_inherit);
}
if (in_array(ilContainer::SORT_TITLE, $a_sorting_settings)) {
$sort_title = new ilRadioOption($this->lng->txt('sorting_title_header'), ilContainer::SORT_TITLE);
$sort_title->setInfo($this->lng->txt('sorting_info_title'));
$this->initSortingDirectionForm($settings, $sort_title, 'title');
$sort->addOption($sort_title);
}
if (in_array(ilContainer::SORT_CREATION, $a_sorting_settings)) {
$sort_activation = new ilRadioOption($this->lng->txt('sorting_creation_header'), ilContainer::SORT_CREATION);
$sort_activation->setInfo($this->lng->txt('sorting_creation_info'));
$this->initSortingDirectionForm($settings, $sort_activation, 'creation');
$sort->addOption($sort_activation);
}
if (in_array(ilContainer::SORT_ACTIVATION, $a_sorting_settings)) {
$sort_activation = new ilRadioOption($this->lng->txt('crs_sort_activation'), ilContainer::SORT_ACTIVATION);
$sort_activation->setInfo($this->lng->txt('crs_sort_timing_info'));
$this->initSortingDirectionForm($settings, $sort_activation, 'activation');
$sort->addOption($sort_activation);
}
if (in_array(ilContainer::SORT_MANUAL, $a_sorting_settings)) {
$sort_manual = new ilRadioOption($this->lng->txt('sorting_manual_header'), ilContainer::SORT_MANUAL);
$sort_manual->setInfo($this->lng->txt('sorting_info_manual'));
$this->initManualSortingOptionForm($settings, $sort_manual, "manual", $a_sorting_settings);
$sort->addOption($sort_manual);
}
$sort->setValue($settings->getSortMode());
$form->addItem($sort);
return $form;
}
示例5: initFormTitle
/**
* Init title form
* @return ilPropertyFormGUI
*/
protected function initFormTitle()
{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setTitle($this->lng->txt('objref_title_settings'));
$form->setFormAction($this->ctrl->getFormAction($this));
$form->addCommandButton('updateTitle', $this->lng->txt('save'));
// title type
$ttype = new ilRadioGroupInputGUI($this->lng->txt('title'), 'title_type');
$ttype->setValue($this->object->getTitleType());
$reuse = new ilRadioOption($this->lng->txt('objref_reuse_title'));
$reuse->setValue(ilContainerReference::TITLE_TYPE_REUSE);
$ttype->addOption($reuse);
$custom = new ilRadioOption($this->lng->txt('objref_custom_title'));
$custom->setValue(ilContainerReference::TITLE_TYPE_CUSTOM);
// title
$title = new ilTextInputGUI($this->lng->txt('title'), 'title');
$title->setSize(min(40, ilObject::TITLE_LENGTH));
$title->setMaxLength(ilObject::TITLE_LENGTH);
$title->setRequired(true);
$title->setValue($this->object->getTitle());
$custom->addSubItem($title);
$ttype->addOption($custom);
$form->addItem($ttype);
return $form;
}
示例6: parseSearch
/**
* Parse search
*
* @access private
* @param
*
*/
private function parseSearch()
{
include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
foreach (ilAdvancedMDRecord::_getActiveSearchableRecords() as $record) {
$section = new ilFormSectionHeaderGUI();
$section->setTitle($record->getTitle());
$this->form->addItem($section);
foreach (ilAdvancedMDFieldDefinition::_getDefinitionsByRecordId($record->getRecordId()) as $field) {
if (!$field->isSearchable()) {
continue;
}
switch ($field->getFieldType()) {
case ilAdvancedMDFieldDefinition::TYPE_TEXT:
$group = new ilRadioGroupInputGUI('', 'boolean[' . $field->getFieldId() . ']');
$group->setValue(isset($this->search_values['boolean'][$field->getFieldId()]) ? $this->search_values['boolean'][$field->getFieldId()] : 0);
$radio_option = new ilRadioOption($this->lng->txt("search_any_word"), 0);
$radio_option->setValue(0);
$group->addOption($radio_option);
$radio_option = new ilRadioOption($this->lng->txt("search_all_words"), 1);
$radio_option->setValue(1);
$group->addOption($radio_option);
$text = new ilTextInputGUI($field->getTitle(), $field->getFieldId());
$text->setValue(isset($this->search_values[$field->getFieldId()]) ? $this->search_values[$field->getFieldId()] : '');
$text->setSize(30);
$text->setMaxLength(255);
$text->addSubItem($group);
$this->form->addItem($text);
break;
case ilAdvancedMDFieldDefinition::TYPE_SELECT:
$select = new ilSelectInputGUI($field->getTitle(), $field->getFieldId());
$select->setValue(isset($this->search_values[$field->getFieldId()]) ? $this->search_values[$field->getFieldId()] : 0);
$options = array(0 => $this->lng->txt('search_any'));
$counter = 1;
foreach ($field->getFieldValues() as $key => $value) {
$options[$counter++] = $value;
}
$select->setOptions($options);
$this->form->addItem($select);
break;
case ilAdvancedMDFieldDefinition::TYPE_DATETIME:
case ilAdvancedMDFieldDefinition::TYPE_DATE:
$check = new ilCheckboxInputGUI($field->getTitle(), $field->getFieldId());
$check->setValue(1);
$check->setChecked(isset($this->search_values[$field->getFieldId()]) ? $this->search_values[$field->getFieldId()] : 0);
$time = new ilDateTimeInputGUI($this->lng->txt('from'), 'date_start[' . $field->getFieldId() . ']');
if ($field->getFieldType() == ilAdvancedMDFieldDefinition::TYPE_DATE) {
$time->setShowTime(false);
} else {
$time->setShowTime(true);
}
if (isset($this->search_values['date_start'][$field->getFieldId()]) and 0) {
#$time->setUnixTime($this->toUnixTime($this->search_values['date_start'][$field->getFieldId()]['date'],$this->search_values['date_start'][$field->getFieldId()]['time']));
} else {
$time->setDate(new ilDateTime(mktime(8, 0, 0, date('m'), date('d'), date('Y')), IL_CAL_UNIX));
}
$check->addSubItem($time);
$time = new ilDateTimeInputGUI($this->lng->txt('until'), 'date_end[' . $field->getFieldId() . ']');
if ($field->getFieldType() == ilAdvancedMDFieldDefinition::TYPE_DATE) {
$time->setShowTime(false);
} else {
$time->setShowTime(true);
}
if (isset($this->search_values['date_end'][$field->getFieldId()]) and 0) {
#$time->setUnixTime($this->toUnixTime($this->search_values['date_end'][$field->getFieldId()]['date'],$this->search_values['date_end'][$field->getFieldId()]['time']));
} else {
$time->setDate(new ilDateTime(mktime(16, 0, 0, date('m'), date('d'), date('Y')), IL_CAL_UNIX));
}
$check->addSubItem($time);
$this->form->addItem($check);
break;
}
}
}
}
示例7: initForm
/**
* init create/edit form
*
* @access protected
* @param string edit or create
* @return
*/
protected function initForm($a_mode = 'edit')
{
global $ilUser, $tpl, $tree;
if (is_object($this->form)) {
return true;
}
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form = new ilPropertyFormGUI();
switch ($a_mode) {
case 'edit':
$this->form->setFormAction($this->ctrl->getFormAction($this, 'update'));
break;
default:
$this->form->setTableWidth('600px');
$this->form->setFormAction($this->ctrl->getFormAction($this, 'save'));
break;
}
// title
$title = new ilTextInputGUI($this->lng->txt('title'), 'title');
$title->setSubmitFormOnEnter(true);
$title->setValue($this->object->getTitle());
$title->setSize(40);
$title->setMaxLength(128);
$title->setRequired(true);
$this->form->addItem($title);
// desc
$desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
$desc->setValue($this->object->getLongDescription());
$desc->setRows(2);
$desc->setCols(40);
$this->form->addItem($desc);
// Group type
$grp_type = new ilRadioGroupInputGUI($this->lng->txt('grp_typ'), 'grp_type');
if ($a_mode == 'edit') {
$type = $this->object->getGroupType() ? $this->object->getGroupType() : $this->object->readGroupStatus();
} else {
$type = $this->object->getGroupType() ? $this->object->getGroupType() : GRP_TYPE_PUBLIC;
}
$grp_type->setValue($type);
$grp_type->setRequired(true);
// PUBLIC GROUP
$opt_public = new ilRadioOption($this->lng->txt('grp_public'), GRP_TYPE_PUBLIC, $this->lng->txt('grp_public_info'));
$grp_type->addOption($opt_public);
// CLOSED GROUP
$opt_closed = new ilRadioOption($this->lng->txt('grp_closed'), GRP_TYPE_CLOSED, $this->lng->txt('grp_closed_info'));
$grp_type->addOption($opt_closed);
if ($a_mode == 'update_group_type') {
$grp_type->setAlert($this->lng->txt('grp_type_changed_info'));
}
$this->form->addItem($grp_type);
if ($a_mode == 'edit') {
// Group registration ############################################################
$pres = new ilFormSectionHeaderGUI();
$pres->setTitle($this->lng->txt('grp_setting_header_registration'));
$this->form->addItem($pres);
// Registration type
$reg_type = new ilRadioGroupInputGUI($this->lng->txt('group_registration_mode'), 'registration_type');
$reg_type->setValue($this->object->getRegistrationType());
$opt_dir = new ilRadioOption($this->lng->txt('grp_reg_direct'), GRP_REGISTRATION_DIRECT);
#$this->lng->txt('grp_reg_direct_info'));
$reg_type->addOption($opt_dir);
$opt_pass = new ilRadioOption($this->lng->txt('grp_pass_request'), GRP_REGISTRATION_PASSWORD);
$pass = new ilTextInputGUI('', 'password');
$pass->setInfo($this->lng->txt('grp_reg_password_info'));
$pass->setValue($this->object->getPassword());
$pass->setSize(10);
$pass->setMaxLength(32);
$opt_pass->addSubItem($pass);
$reg_type->addOption($opt_pass);
$opt_req = new ilRadioOption($this->lng->txt('grp_reg_request'), GRP_REGISTRATION_REQUEST, $this->lng->txt('grp_reg_request_info'));
$reg_type->addOption($opt_req);
$opt_deact = new ilRadioOption($this->lng->txt('grp_reg_disabled'), GRP_REGISTRATION_DEACTIVATED, $this->lng->txt('grp_reg_disabled_info'));
$reg_type->addOption($opt_deact);
// Registration codes
$reg_code = new ilCheckboxInputGUI($this->lng->txt('grp_reg_code'), 'reg_code_enabled');
$reg_code->setChecked($this->object->isRegistrationAccessCodeEnabled());
$reg_code->setValue(1);
$reg_code->setInfo($this->lng->txt('grp_reg_code_enabled_info'));
$this->form->addItem($reg_type);
// time limit
$time_limit = new ilCheckboxInputGUI($this->lng->txt('grp_reg_limited'), 'reg_limit_time');
$time_limit->setOptionTitle($this->lng->txt('grp_reg_limit_time'));
$time_limit->setChecked($this->object->isRegistrationUnlimited() ? false : true);
$this->lng->loadLanguageModule('dateplaner');
include_once './Services/Form/classes/class.ilDateDurationInputGUI.php';
$tpl->addJavaScript('./Services/Form/js/date_duration.js');
$dur = new ilDateDurationInputGUI($this->lng->txt('grp_reg_period'), 'reg');
$dur->setStartText($this->lng->txt('cal_start'));
$dur->setEndText($this->lng->txt('cal_end'));
$dur->setMinuteStepSize(5);
$dur->setShowDate(true);
$dur->setShowTime(true);
$dur->setStart($this->object->getRegistrationStart());
//.........这里部分代码省略.........
示例8: settings
public function settings()
{
global $rbacreview;
$this->tabs_gui->setSubTabActive('shib_settings');
// set already saved data or default value for port
$settings = $this->ilias->getAllSettings();
// Compose role list
$role_list = $rbacreview->getRolesByFilter(2);
$role = array();
if (!isset($settings["shib_user_default_role"])) {
$settings["shib_user_default_role"] = 4;
}
if (!isset($settings["shib_idp_list"]) || $settings["shib_idp_list"] == '') {
$settings["shib_idp_list"] = "urn:mace:organization1:providerID, Example Organization 1\nurn:mace:organization2:providerID, Example Organization 2, /Shibboleth.sso/WAYF/SWITCHaai";
}
if (!isset($settings["shib_login_button"]) || $settings["shib_login_button"] == '') {
$settings["shib_login_button"] = "templates/default/images/shib_login_button.png";
}
if (!isset($settings["shib_hos_type"]) || $settings["shib_hos_type"] == '') {
$settings["shib_hos_type"] = 'internal_wayf';
}
foreach ($role_list as $data) {
$role[$data["obj_id"]] = $data["title"];
}
// Set text field content
$shib_settings = array('shib_login', 'shib_title', 'shib_firstname', 'shib_lastname', 'shib_email', 'shib_gender', 'shib_institution', 'shib_department', 'shib_zipcode', 'shib_city', 'shib_country', 'shib_street', 'shib_phone_office', 'shib_phone_home', 'shib_phone_mobile', 'shib_language', 'shib_matriculation');
//set PropertyFormGUI
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$propertys = new ilPropertyFormGUI();
$propertys->setTitle($this->lng->txt("shib"));
$propertys->setFormAction($this->ctrl->getFormAction($this, "save"));
$propertys->addCommandButton("save", $this->lng->txt("save"));
$propertys->addCommandButton("settings", $this->lng->txt("cancel"));
//set enable shibboleth support
$enable = new ilCheckboxInputGUI();
$enable->setTitle($this->lng->txt("shib_active"));
$read_me_link = "./Services/AuthShibboleth/README.SHIBBOLETH.txt";
$info = "<a href='" . $read_me_link . "' target='_blank'>" . $this->lng->txt("auth_shib_instructions") . "</a>";
$enable->setInfo($info);
$enable->setPostVar("shib[active]");
$enable->setChecked($settings["shib_active"]);
//set allow local authentication
$local = new ilCheckboxInputGUI();
$local->setTitle($this->lng->txt("auth_allow_local"));
$local->setPostVar("shib[auth_allow_local]");
$local->setChecked($settings['shib_auth_allow_local']);
//set user default role
$defaultrole = new ilSelectInputGUI();
$defaultrole->setTitle($this->lng->txt("shib_user_default_role"));
$defaultrole->setPostVar("shib[user_default_role]");
$defaultrole->setOptions($role);
$defaultrole->setRequired(true);
$defaultrole->setValue($settings["shib_user_default_role"]);
//set name of federation
$name = new ilTextInputGUI();
$name->setTitle($this->lng->txt("shib_federation_name"));
$name->setPostVar("shib[federation_name]");
$name->setSize(40);
$name->setMaxLength(50);
$name->setRequired(true);
$name->setValue(stripslashes($settings["shib_federation_name"]));
//set Organize selection group
include_once "./Services/Form/classes/class.ilRadioGroupInputGUI.php";
include_once "./Services/Form/classes/class.ilRadioOption.php";
$organize = new ilRadioGroupInputGUI();
$organize->setTitle($this->lng->txt("shib_login_type"));
$organize->setPostVar("shib[hos_type]");
$organize->setRequired(true);
$organize->setValue($settings["shib_hos_type"]);
//set 1. option internalwayf
$internalwayf = new ilRadioOption();
$internalwayf->setTitle($this->lng->txt("shib_login_internal_wayf"));
$internalwayf->setValue("internal_wayf");
//set 1. option internalwayf textbox idplist
$idplist = new ilTextAreaInputGUI();
$idplist->setInfo($this->lng->txt("shib_idp_list"));
$idplist->setPostVar("shib[idp_list]");
$idplist->setRows(3);
$idplist->setCols(50);
$idplist->setValue($settings["shib_idp_list"]);
//set 2. Option externalwayf
$externalwayf = new ilRadioOption();
$externalwayf->setTitle($this->lng->txt("shib_login_external_wayf"));
$externalwayf->setValue("external_wayf");
//set 2. Option externalwayf textfield path to login button image
$loginbutton = new ilTextInputGUI();
$loginbutton->setInfo($this->lng->txt("shib_login_button"));
$loginbutton->setPostVar("shib[login_button]");
$loginbutton->setSize(50);
$loginbutton->setMaxLength(255);
$loginbutton->setValue($settings["shib_login_button"]);
//set 3. Option embeddedwayf
$embeddedwayf = new ilRadioOption();
$embeddedwayf->setTitle($this->lng->txt("shib_login_embedded_wayf"));
$embeddedwayf->setInfo($this->lng->txt("shib_login_embedded_wayf_description"));
$embeddedwayf->setValue("embedded_wayf");
//set login instructions
$logininstruction = new ilTextAreaInputGUI();
$logininstruction->setTitle($this->lng->txt("auth_login_instructions"));
$logininstruction->setPostVar("shib[login_instructions]");
//.........这里部分代码省略.........