本文整理汇总了PHP中ilCustomInputGUI类的典型用法代码示例。如果您正苦于以下问题:PHP ilCustomInputGUI类的具体用法?PHP ilCustomInputGUI怎么用?PHP ilCustomInputGUI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ilCustomInputGUI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editQuestion
/**
* Creates an output of the edit form for the question
* @access public
*/
function editQuestion()
{
global $ilDB, $tpl;
$plugin = $this->object->getPlugin();
$this->getQuestionTemplate();
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->outQuestionType());
$form->setMultipart(FALSE);
$form->setTableWidth("100%");
$form->setId("assJSMEQuestion");
// Basiseingabefelder: title, author, description, question, working time (assessment mode)
$this->addBasicQuestionFormProperties($form);
// points
$points = new ilNumberInputGUI($plugin->txt("points"), "points");
$points->setValue($this->object->getPoints());
$points->setRequired(TRUE);
$points->setSize(10);
$points->setMinValue(0.0);
$form->addItem($points);
// optionString for the JSME-Applet
include_once "./Services/Form/classes/class.ilTextInputGUI.php";
$optionString = new ilTextInputGUI($plugin->txt("optionString"), "optionString");
$optionString->setValue($this->object->getOptionString());
$form->addItem($optionString);
// JSME-Applet for sampleSolution
include_once "./Services/Form/classes/class.ilCustomInputGUI.php";
$sampleSolution = new ilCustomInputGUI($plugin->txt("sampleSolution"), "sampleSolution");
$template = $this->getJsmeOutputTemplate("", $this->object->getOptionString(), $this->object->getSampleSolution());
$sampleSolution->setHtml($template->get());
$form->addItem($sampleSolution);
$form->addCommandButton('save', $plugin->txt("save"));
$this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
}
示例2: showDetails
/**
* @param ilObjBibliographic $bibl_obj
* @return void
*
*/
public function showDetails(ilObjBibliographic $bibl_obj)
{
global $tpl, $ilTabs, $ilCtrl, $lng;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$ilTabs->clearTargets();
$ilTabs->setBackTarget("back", $ilCtrl->getLinkTarget($this, 'showContent'));
$form->setTitle($lng->txt('detail_view'));
$entry = new ilBibliographicEntry($bibl_obj->getFiletype(), $_GET['entryId']);
$attributes = $entry->getAttributes();
//translate array key in order to sort by those keys
foreach ($attributes as $key => $attribute) {
//Check if there is a specific language entry
if ($lng->exists($key)) {
$strDescTranslated = $lng->txt($key);
} else {
$arrKey = explode("_", $key);
$strDescTranslated = $lng->txt($arrKey[0] . "_default_" . $arrKey[2]);
}
unset($attributes[$key]);
$attributes[$strDescTranslated] = $attribute;
}
// sort attributes alphabetically by their array-key
ksort($attributes, SORT_STRING);
// render attributes to html
foreach ($attributes as $key => $attribute) {
$ci = new ilCustomInputGUI($key);
$ci->setHtml($attribute);
$form->addItem($ci);
}
// set content and title
$tpl->setContent($form->getHTML());
//Permanent Link
$tpl->setPermanentLink("bibl", $bibl_obj->getRefId(), "_" . $_GET['entryId']);
}
示例3: 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);
}
}
示例4: initForm
/**
* Init form
*
* @return ilPropertyFormGUI
*/
public function initForm()
{
global $lng, $ilCtrl;
/** @var $ilCtrl ilCtrl */
$ilCtrl = $ilCtrl;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$item = new ilCustomInputGUI();
$item->setHtml($lng->txt('dcl_file_format_description'));
$item->setTitle("Info");
$form->addItem($item);
$file = new ilFileInputGUI($lng->txt("import_file"), "import_file");
$file->setRequired(true);
$form->addItem($file);
$cb = new ilCheckboxInputGUI($lng->txt("dcl_simulate_import"), "simulate");
$cb->setInfo($lng->txt("dcl_simulate_info"));
$form->addItem($cb);
$form->addCommandButton("importExcel", $lng->txt("save"));
return $form;
}
示例5: buildAdjustQuestionForm
/**
* @param $question_id
* @param $question_pool_id
*
* @return ilPropertyFormGUI
*/
protected function buildAdjustQuestionForm($question_id, $question_pool_id)
{
require_once './Services/Form/classes/class.ilPropertyFormGUI.php';
require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setMultipart(FALSE);
$form->setTableWidth("100%");
$form->setId("adjustment");
/** @var $question assQuestionGUI|ilGuiQuestionScoringAdjustable|ilGuiAnswerScoringAdjustable */
$question = assQuestion::instantiateQuestionGUI($question_id);
$form->setTitle($question->object->getTitle() . '<br /><small>(' . $question->outQuestionType() . ')</small>');
$hidden_question_id = new ilHiddenInputGUI('q_id');
$hidden_question_id->setValue($question_id);
$form->addItem($hidden_question_id);
$hidden_qpl_id = new ilHiddenInputGUI('qpl_id');
$hidden_qpl_id->setValue($question_pool_id);
$form->addItem($hidden_qpl_id);
$this->populateScoringAdjustments($question, $form);
$manscoring_section = new ilFormSectionHeaderGUI();
$manscoring_section->setTitle($this->lng->txt('manscoring'));
$form->addItem($manscoring_section);
$manscoring_preservation = new ilCheckboxInputGUI($this->lng->txt('preserve_manscoring'), 'preserve_manscoring');
$manscoring_preservation->setChecked(true);
$manscoring_preservation->setInfo($this->lng->txt('preserve_manscoring_info'));
$form->addItem($manscoring_preservation);
$form->addCommandButton("savescoringfortest", $this->lng->txt("save"));
$participants = $this->object->getParticipants();
$active_ids = array_keys($participants);
$results = array();
foreach ($active_ids as $active_id) {
$passes[] = $this->object->_getPass($active_id);
foreach ($passes as $key => $pass) {
for ($i = 0; $i <= $pass; $i++) {
$results[] = $question->object->getSolutionValues($active_id, $i);
}
}
}
$relevant_answers = array();
foreach ($results as $result) {
foreach ($result as $answer) {
if ($answer['question_fi'] == $question->object->getId()) {
$relevant_answers[] = $answer;
}
}
}
$answers_view = $question->getAggregatedAnswersView($relevant_answers);
include_once 'Services/jQuery/classes/class.iljQueryUtil.php';
iljQueryUtil::initjQuery();
include_once 'Services/YUI/classes/class.ilYuiUtil.php';
ilYuiUtil::initPanel();
ilYuiUtil::initOverlay();
$this->tpl->addJavascript('./Services/UIComponent/Overlay/js/ilOverlay.js');
$this->tpl->addJavaScript("./Services/JavaScript/js/Basic.js");
$container = new ilTemplate('tpl.il_as_tst_adjust_answer_aggregation_container.html', true, true, 'Modules/Test');
$container->setVariable('FORM_ELEMENT_NAME', 'aggr_usr_answ');
$container->setVariable('CLOSE_HTML', json_encode(ilGlyphGUI::get(ilGlyphGUI::CLOSE, $this->lng->txt('close'))));
$container->setVariable('TXT_SHOW_ANSWER_OVERVIEW', $this->lng->txt('show_answer_overview'));
$container->setVariable('TXT_CLOSE', $this->lng->txt('close'));
$container->setVariable('ANSWER_OVERVIEW', $answers_view);
$custom_input = new ilCustomInputGUI('', 'aggr_usr_answ');
$custom_input->setHtml($container->get());
$form->addItem($custom_input);
return $form;
}
示例6: initFormCSettings
/**
* Init settings form
*/
protected function initFormCSettings()
{
include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt('settings'));
// individual course allocation
$check = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_enable'), 'enabled');
$check->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isCourseAllocationEnabled());
$form->addItem($check);
// add default container
$imp = new ilCustomInputGUI($this->lng->txt('ecs_cmap_def_cat'), 'default_cat');
$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', 'default_cat');
$default = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getDefaultCourseCategory();
$tpl->setVariable('PROPERTY_VALUE', $default);
if ($default) {
include_once './Services/Tree/classes/class.ilPathGUI.php';
$path = new ilPathGUI();
$path->enableTextOnly(false);
$path->enableHideLeaf(false);
$tpl->setVariable('COMPLETE_PATH', $path->getPath(ROOT_FOLDER_ID, $default));
}
$imp->setHtml($tpl->get());
$imp->setInfo($this->lng->txt('ecs_cmap_def_cat_info'));
$form->addItem($imp);
// all in one category
$allinone = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_all_in_one'), 'allinone');
$allinone->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isAllInOneCategoryEnabled());
$allinone->setInfo($this->lng->txt('ecs_cmap_all_in_one_info'));
$allinone_cat = new ilCustomInputGUI($this->lng->txt('ecs_cmap_all_in_one_cat'), 'allinone_cat');
$allinone_cat->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', 'allinone_cat');
$cat = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getAllInOneCategory();
$tpl->setVariable('PROPERTY_VALUE', $cat);
if ($cat) {
include_once './Services/Tree/classes/class.ilPathGUI.php';
$path = new ilPathGUI();
$path->enableTextOnly(false);
$path->enableHideLeaf(false);
$tpl->setVariable('COMPLETE_PATH', $path->getPath(ROOT_FOLDER_ID, $default));
}
$allinone_cat->setHtml($tpl->get());
$allinone->addSubItem($allinone_cat);
$form->addItem($allinone);
// multiple attributes
$multiple = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_multiple_atts'), 'multiple');
$multiple->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isAttributeMappingEnabled());
// attribute selection
include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
$attributes = new ilSelectInputGUI($this->lng->txt('ecs_cmap_attributes'), 'atts');
$attributes->setMulti(true);
$attributes->setValue(ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid())->getAttributeValues());
$attributes->setRequired(true);
$attributes->setOptions(ilECSMappingUtils::getCourseMappingFieldSelectOptions());
$multiple->addSubItem($attributes);
$form->addItem($multiple);
// role mapping
$rm = new ilFormSectionHeaderGUI();
$rm->setTitle($this->lng->txt('ecs_role_mappings'));
$form->addItem($rm);
$mapping_defs = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getRoleMappings();
include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
foreach (ilECSMappingUtils::getRoleMappingInfo() as $name => $info) {
$role_map = new ilTextInputGUI($this->lng->txt($info['lang']), $name);
$role_map->setValue($mapping_defs[$name]);
$role_map->setSize(32);
$role_map->setMaxLength(64);
$role_map->setRequired($info['required']);
$form->addItem($role_map);
}
$form->addCommandButton('cUpdateSettings', $this->lng->txt('save'));
$form->addCommandButton('cSettings', $this->lng->txt('cancel'));
return $form;
}
示例7: parseFieldDefinition
protected static function parseFieldDefinition($a_type, ilPropertyFormGUI $a_form, ilObjectGUI $a_gui, $a_data)
{
global $lng, $rbacsystem, $ilCtrl;
if (!is_array($a_data)) {
return;
}
foreach ($a_data as $area_caption => $fields) {
if (is_numeric($area_caption) || !trim($area_caption)) {
$area_caption = "obj_" . $a_type;
}
if (is_array($fields) && sizeof($fields) == 2) {
$cmd = $fields[0];
$fields = $fields[1];
if (is_array($fields)) {
$ftpl = new ilTemplate("tpl.external_settings.html", true, true, "Services/Administration");
$stack = array();
foreach ($fields as $field_caption_id => $field_value) {
$field_type = $subitems = null;
if (is_array($field_value)) {
$field_type = $field_value[1];
$subitems = $field_value[2];
$field_value = $field_value[0];
}
if (self::parseFieldValue($field_type, $field_value)) {
$ftpl->setCurrentBlock("value_bl");
$ftpl->setVariable("VALUE", $field_value);
$ftpl->parseCurrentBlock();
}
if (is_array($subitems)) {
$ftpl->setCurrentBlock("subitem_bl");
foreach ($subitems as $sub_caption_id => $sub_value) {
$sub_type = null;
if (is_array($sub_value)) {
$sub_type = $sub_value[1];
$sub_value = $sub_value[0];
}
self::parseFieldValue($sub_type, $sub_value);
$ftpl->setVariable("SUBKEY", $lng->txt($sub_caption_id));
$ftpl->setVariable("SUBVALUE", $sub_value);
$ftpl->parseCurrentBlock();
}
}
$ftpl->setCurrentBlock("row_bl");
$ftpl->setVariable("KEY", $lng->txt($field_caption_id));
$ftpl->parseCurrentBlock();
}
if ($rbacsystem->checkAccess("visible,read", $a_gui->object->getRefId())) {
if (!$cmd) {
$cmd = "view";
}
$ilCtrl->setParameter($a_gui, "ref_id", $a_gui->object->getRefId());
$ftpl->setCurrentBlock("edit_bl");
$ftpl->setVariable("URL_EDIT", $ilCtrl->getLinkTargetByClass(array("ilAdministrationGUI", get_class($a_gui)), $cmd));
$ftpl->setVariable("TXT_EDIT", $lng->txt("adm_external_setting_edit"));
$ftpl->parseCurrentBlock();
}
$ext = new ilCustomInputGUI($lng->txt($area_caption));
$ext->setHtml($ftpl->get());
$a_form->addItem($ext);
}
}
}
}
示例8: showMail
/**
* Detail view of a mail
*/
public function showMail()
{
/**
* @var $ilUser ilObjUser
* @var $ilToolbar ilToolbarGUI
* @var $ilTabs ilTabsGUI
*/
global $ilUser, $ilToolbar, $ilTabs;
if ($_SESSION['mail_id']) {
$_GET['mail_id'] = $_SESSION['mail_id'];
$_SESSION['mail_id'] = '';
}
$ilTabs->clearTargets();
$ilTabs->setBackTarget($this->lng->txt('back_to_folder'), $this->ctrl->getFormAction($this, 'showFolder'));
$this->umail->markRead(array((int) $_GET['mail_id']));
$mailData = $this->umail->getMail((int) $_GET['mail_id']);
$this->tpl->setTitle($this->lng->txt('mail_mails_of'));
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setPreventDoubleSubmission(false);
$form->setTableWidth('100%');
$this->ctrl->setParameter($this, 'mail_id', (int) $_GET['mail_id']);
$form->setFormAction($this->ctrl->getFormAction($this, 'showMail'));
$this->ctrl->clearParameters($this);
$form->setTitle($this->lng->txt('mail_mails_of'));
if ('tree' == ilSession::get(ilMailGUI::VIEWMODE_SESSION_KEY)) {
$this->tpl->setVariable('FORM_TARGET', ilFrameTargetInfo::_getFrame('MainContent'));
}
include_once 'Services/Accessibility/classes/class.ilAccessKeyGUI.php';
/**
* @var $sender ilObjUser
*/
$sender = ilObjectFactory::getInstanceByObjId($mailData['sender_id'], false);
if ($sender && $sender->getId() && $sender->getId() != ANONYMOUS_USER_ID) {
$this->ctrl->setParameterByClass('ilmailformgui', 'mail_id', (int) $_GET['mail_id']);
$this->ctrl->setParameterByClass('ilmailformgui', 'type', 'reply');
$this->ctrl->clearParametersByClass('iliasmailformgui');
$ilToolbar->addButton($this->lng->txt('reply'), $this->ctrl->getLinkTargetByClass('ilmailformgui'), '', ilAccessKey::REPLY);
$this->ctrl->clearParameters($this);
}
$this->ctrl->setParameterByClass('ilmailformgui', 'mail_id', (int) $_GET['mail_id']);
$this->ctrl->setParameterByClass('ilmailformgui', 'type', 'forward');
$this->ctrl->clearParametersByClass('iliasmailformgui');
$ilToolbar->addButton($this->lng->txt('forward'), $this->ctrl->getLinkTargetByClass('ilmailformgui'), '', ilAccessKey::FORWARD_MAIL);
$this->ctrl->clearParameters($this);
$this->ctrl->setParameter($this, 'mail_id', (int) $_GET['mail_id']);
$ilToolbar->addButton($this->lng->txt('print'), $this->ctrl->getLinkTarget($this, 'printMail'), '_blank');
$this->ctrl->clearParameters($this);
$this->ctrl->setParameter($this, 'mail_id', (int) $_GET['mail_id']);
$this->ctrl->setParameter($this, 'selected_cmd', 'deleteMails');
$ilToolbar->addButton($this->lng->txt('delete'), $this->ctrl->getLinkTarget($this), '', ilAccessKey::DELETE);
$this->ctrl->clearParameters($this);
if ($sender && $sender->getId() && $sender->getId() != ANONYMOUS_USER_ID) {
$linked_fullname = $sender->getPublicName();
$picture = ilUtil::img($sender->getPersonalPicturePath('xsmall'), $sender->getPublicName());
$add_to_addb_button = '';
if (in_array(ilObjUser::_lookupPref($sender->getId(), 'public_profile'), array('y', 'g'))) {
$this->ctrl->setParameter($this, 'mail_id', (int) $_GET['mail_id']);
$this->ctrl->setParameter($this, 'user', $sender->getId());
$linked_fullname = '<br /><a href="' . $this->ctrl->getLinkTarget($this, 'showUser') . '" title="' . $linked_fullname . '">' . $linked_fullname . '</a>';
$this->ctrl->clearParameters($this);
}
if ($sender->getId() != $ilUser->getId()) {
require_once 'Services/Contact/classes/class.ilAddressbook.php';
$abook = new ilAddressbook($ilUser->getId());
if ($abook->checkEntryByLogin($sender->getLogin()) == 0) {
$tplbtn = new ilTemplate('tpl.buttons.html', true, true);
$tplbtn->setCurrentBlock('btn_cell');
$this->ctrl->setParameter($this, 'mail_id', (int) $_GET['mail_id']);
$tplbtn->setVariable('BTN_LINK', $this->ctrl->getLinkTarget($this, 'add'));
$this->ctrl->clearParameters($this);
$tplbtn->setVariable('BTN_TXT', $this->lng->txt('mail_add_to_addressbook'));
$tplbtn->parseCurrentBlock();
$add_to_addb_button = '<br />' . $tplbtn->get();
}
}
$from = new ilCustomInputGUI($this->lng->txt('from'));
$from->setHtml($picture . ' ' . $linked_fullname . $add_to_addb_button);
$form->addItem($from);
} else {
if (!$sender || !$sender->getId()) {
$from = new ilCustomInputGUI($this->lng->txt('from'));
$from->setHtml($mailData['import_name'] . ' (' . $this->lng->txt('user_deleted') . ')');
$form->addItem($from);
} else {
$from = new ilCustomInputGUI($this->lng->txt('from'));
$from->setHtml(ilUtil::img(ilUtil::getImagePath('HeaderIconAvatar.svg'), ilMail::_getIliasMailerName()) . '<br />' . ilMail::_getIliasMailerName());
$form->addItem($from);
}
}
$to = new ilCustomInputGUI($this->lng->txt('mail_to'));
$to->setHtml(ilUtil::htmlencodePlainString($this->umail->formatNamesForOutput($mailData['rcp_to']), false));
$form->addItem($to);
if ($mailData['rcp_cc']) {
$cc = new ilCustomInputGUI($this->lng->txt('cc'));
$cc->setHtml(ilUtil::htmlencodePlainString($this->umail->formatNamesForOutput($mailData['rcp_cc']), false));
$form->addItem($cc);
//.........这里部分代码省略.........
示例9: getFormElement
public function getFormElement($a_query, $a_field_name)
{
include_once './Services/MetaData/classes/class.ilMDUtilSelect.php';
$a_post_name = 'query[' . $a_field_name . ']';
switch ($a_field_name) {
case 'general_offline':
$offline_options = array('0' => $this->lng->txt('search_any'), self::ONLINE_QUERY => $this->lng->txt('search_option_online'), self::OFFLINE_QUERY => $this->lng->txt('search_option_offline'));
$offline = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
$offline->setOptions($offline_options);
$offline->setValue($a_query['general_offline']);
return $offline;
case 'lom_content':
$text = new ilTextInputGUI($this->active_fields[$a_field_name], $a_post_name);
$text->setSubmitFormOnEnter(true);
$text->setValue($a_query['lom_content']);
$text->setSize(30);
$text->setMaxLength(255);
return $text;
// General
// General
case 'lom_language':
$select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
$select->setValue($a_query['lom_language']);
$select->setOptions(ilMDUtilSelect::_getLanguageSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
return $select;
case 'lom_keyword':
$text = new ilTextInputGUI($this->active_fields[$a_field_name], $a_post_name);
$text->setSubmitFormOnEnter(true);
$text->setValue($a_query['lom_keyword']);
$text->setSize(30);
$text->setMaxLength(255);
return $text;
case 'lom_coverage':
$text = new ilTextInputGUI($this->active_fields[$a_field_name], $a_post_name);
$text->setSubmitFormOnEnter(true);
$text->setValue($a_query['lom_coverage']);
$text->setSize(30);
$text->setMaxLength(255);
return $text;
case 'lom_structure':
$select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
$select->setValue($a_query['lom_structure']);
$select->setOptions(ilMDUtilSelect::_getStructureSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
return $select;
// Lifecycle
// Lifecycle
case 'lom_status':
$select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
$select->setValue($a_query['lom_status']);
$select->setOptions(ilMDUtilSelect::_getStatusSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
return $select;
case 'lom_version':
$text = new ilTextInputGUI($this->active_fields[$a_field_name], $a_post_name);
$text->setSubmitFormOnEnter(true);
$text->setValue($a_query['lom_version']);
$text->setSize(30);
$text->setMaxLength(255);
return $text;
case 'lom_contribute':
$select = new ilSelectInputGUI($this->active_fields[$a_field_name], 'query[' . 'lom_role' . ']');
$select->setValue($a_query['lom_role']);
$select->setOptions(ilMDUtilSelect::_getRoleSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
$text = new ilTextInputGUI($this->lng->txt('meta_entry'), 'query[' . 'lom_role_entry' . ']');
$text->setValue($a_query['lom_role_entry']);
$text->setSize(30);
$text->setMaxLength(255);
$select->addSubItem($text);
return $select;
// Technical
// Technical
case 'lom_format':
$select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
$select->setValue($a_query['lom_format']);
$select->setOptions(ilMDUtilSelect::_getFormatSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
return $select;
case 'lom_operating_system':
$select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
$select->setValue($a_query['lom_operating_system']);
$select->setOptions(ilMDUtilSelect::_getOperatingSystemSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
return $select;
case 'lom_browser':
$select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
$select->setValue($a_query['lom_browser']);
$select->setOptions(ilMDUtilSelect::_getBrowserSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
return $select;
// Education
// Education
case 'lom_interactivity':
$select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
$select->setValue($a_query['lom_interactivity']);
$select->setOptions(ilMDUtilSelect::_getInteractivityTypeSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
return $select;
case 'lom_resource':
$select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
$select->setValue($a_query['lom_resource']);
$select->setOptions(ilMDUtilSelect::_getLearningResourceTypeSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
return $select;
case 'lom_level':
$range = new ilCustomInputGUI($this->active_fields[$a_field_name]);
$html = $this->getRangeSelect($this->lng->txt('from'), ilMDUtilSelect::_getInteractivityLevelSelect($a_query['lom_level_start'], 'query[' . 'lom_level_start' . ']', array(0 => $this->lng->txt('search_any'))), $this->lng->txt('until'), ilMDUtilSelect::_getInteractivityLevelSelect($a_query['lom_level_end'], 'query[' . 'lom_level_end' . ']', array(0 => $this->lng->txt('search_any'))));
//.........这里部分代码省略.........
示例10: addFormElements
/**
* add type specific input fields to a form
*
* @param object form, property or radio option
* @param array (assoc) input values
* @param string configuration level ("type" or "object")
* @param string parent field value
* @param string parent option value
* @param int maximum recursion depth
*/
function addFormElements($a_object, $a_values = array(), $a_level = "object", $a_parentfield = '', $a_parentvalue = '', $a_maxdepth = "3")
{
// recursion end
if ($a_maxdepth == 0) {
return;
}
foreach ($this->getInputFields($a_level, $a_parentfield, $a_parentvalue) as $field) {
$value = $a_values['field_' . $field->field_name];
$value = $value ? $value : $field->default;
switch ($field->field_type) {
case self::FIELDTYPE_HEADER:
$item = new ilFormSectionHeaderGUI();
$item->setTitle($field->title);
break;
case self::FIELDTYPE_DESCRIPTION:
$item = new ilCustomInputGUI($field->title);
$item->setHtml(nl2br($field->description));
break;
case self::FIELDTYPE_TEXT:
$item = new ilTextInputGUI($field->title, 'field_' . $field->field_name);
$item->setInfo($field->description);
$item->setRequired($field->required ? true : false);
$item->setSize($field->size);
$item->setValue($value);
break;
case self::FIELDTYPE_TEXTAREA:
$item = new ilTextAreaInputGUI($field->title, 'field_' . $field->field_name);
$item->setInfo($field->description);
$item->setRequired($field->required ? true : false);
$item->setUseRte($field->richtext ? true : false);
$item->setRows($field->rows);
$item->setCols($field->cols);
$item->setValue($value);
break;
case self::FIELDTYPE_PASSWORD:
$item = new ilPasswordInputGUI($field->title, 'field_' . $field->field_name);
$item->setInfo($field->description);
$item->setRequired($field->required ? true : false);
$item->setValue($value);
break;
case self::FIELDTYPE_CHECKBOX:
$item = new ilCheckboxInputGUI($field->title, 'field_' . $field->field_name);
$item->setInfo($field->description);
if ($value) {
$item->setChecked(true);
}
break;
case self::FIELDTYPE_RADIO:
$item = new ilRadioGroupInputGUI($field->title, 'field_' . $field->field_name);
$item->setInfo($field->description);
$item->setValue($value);
foreach ($field->options as $option) {
$ropt = new ilRadioOption($option->title, $option->value);
$ropt->setInfo($option->description);
// add the sub items to the option
$item->addOption($ropt);
$this->addFormElements($ropt, $a_values, $a_level, $field->field_name, $option->value, $a_maxdepth - 1);
}
break;
default:
continue 2;
}
// add the item to the form or to the parent item
if (is_a($a_object, 'ilPropertyFormGUI')) {
$a_object->addItem($item);
} else {
$a_object->addSubItem($item);
}
// add the sub items to the item
if (is_a($item, 'ilSubEnabledFormPropertyGUI')) {
$this->addFormElements($item, $a_level, $a_values, $field->field_name, '', $a_maxdepth - 1);
}
}
}
示例11: buildManScoringParticipantForm
private function buildManScoringParticipantForm($questionGuiList, $activeId, $pass, $initValues = false)
{
global $ilCtrl, $lng;
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
require_once 'Services/Form/classes/class.ilFormSectionHeaderGUI.php';
require_once 'Services/Form/classes/class.ilCustomInputGUI.php';
require_once 'Services/Form/classes/class.ilCheckboxInputGUI.php';
require_once 'Services/Form/classes/class.ilTextInputGUI.php';
require_once 'Services/Form/classes/class.ilTextAreaInputGUI.php';
$ilCtrl->setParameter($this, 'active_id', $activeId);
$ilCtrl->setParameter($this, 'pass', $pass);
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this));
$form->setTitle(sprintf($lng->txt('manscoring_results_pass'), $pass + 1));
$form->setTableWidth('100%');
foreach ($questionGuiList as $questionId => $questionGUI) {
$questionHeader = sprintf($lng->txt('tst_manscoring_question_section_header'), $questionGUI->object->getTitle());
$questionSolution = $questionGUI->getSolutionOutput($activeId, $pass, false, false, true, false, false, true);
$bestSolution = $questionGUI->object->getSuggestedSolutionOutput();
$sect = new ilFormSectionHeaderGUI();
$sect->setTitle($questionHeader . ' [' . $this->lng->txt('question_id_short') . ': ' . $questionGUI->object->getId() . ']');
$form->addItem($sect);
$cust = new ilCustomInputGUI($lng->txt('tst_manscoring_input_question_and_user_solution'));
$cust->setHtml($questionSolution);
$form->addItem($cust);
$text = new ilTextInputGUI($lng->txt('tst_change_points_for_question'), "question__{$questionId}__points");
if ($initValues) {
$text->setValue(assQuestion::_getReachedPoints($activeId, $questionId, $pass));
}
$form->addItem($text);
$nonedit = new ilNonEditableValueGUI($lng->txt('tst_manscoring_input_max_points_for_question'), "question__{$questionId}__maxpoints");
if ($initValues) {
$nonedit->setValue(assQuestion::_getMaximumPoints($questionId));
}
$form->addItem($nonedit);
$area = new ilTextAreaInputGUI($lng->txt('set_manual_feedback'), "question__{$questionId}__feedback");
$area->setUseRTE(true);
if ($initValues) {
$area->setValue($this->object->getManualFeedback($activeId, $questionId, $pass));
}
$form->addItem($area);
if (strlen(trim($bestSolution))) {
$cust = new ilCustomInputGUI($lng->txt('tst_show_solution_suggested'));
$cust->setHtml($bestSolution);
$form->addItem($cust);
}
}
$sect = new ilFormSectionHeaderGUI();
$sect->setTitle($lng->txt('tst_participant'));
$form->addItem($sect);
$check = new ilCheckboxInputGUI($lng->txt('set_manscoring_done'), 'manscoring_done');
if ($initValues && ilTestService::isManScoringDone($activeId)) {
$check->setChecked(true);
}
$form->addItem($check);
$check = new ilCheckboxInputGUI($lng->txt('tst_manscoring_user_notification'), 'manscoring_notify');
$form->addItem($check);
$form->addCommandButton('saveManScoringParticipantScreen', $lng->txt('save'));
$form->addCommandButton('saveReturnManScoringParticipantScreen', $lng->txt('save_return'));
$form->addCommandButton('saveNextManScoringParticipantScreen', $lng->txt('save_and_next'));
return $form;
}
示例12: __initForm
protected function __initForm()
{
global $lng, $ilUser;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this));
// code handling
if ($this->code_enabled) {
include_once 'Services/Registration/classes/class.ilRegistrationCode.php';
$code = new ilTextInputGUI($lng->txt("registration_code"), "usr_registration_code");
$code->setSize(40);
$code->setMaxLength(ilRegistrationCode::CODE_LENGTH);
if ((bool) $this->registration_settings->registrationCodeRequired()) {
$code->setRequired(true);
$code->setInfo($lng->txt("registration_code_required_info"));
} else {
$code->setInfo($lng->txt("registration_code_optional_info"));
}
$this->form->addItem($code);
}
// user defined fields
$user_defined_data = $ilUser->getUserDefinedData();
include_once './Services/User/classes/class.ilUserDefinedFields.php';
$user_defined_fields =& ilUserDefinedFields::_getInstance();
$custom_fields = array();
foreach ($user_defined_fields->getRegistrationDefinitions() as $field_id => $definition) {
if ($definition['field_type'] == UDF_TYPE_TEXT) {
$custom_fields["udf_" . $definition['field_id']] = new ilTextInputGUI($definition['field_name'], "udf_" . $definition['field_id']);
$custom_fields["udf_" . $definition['field_id']]->setValue($user_defined_data["f_" . $field_id]);
$custom_fields["udf_" . $definition['field_id']]->setMaxLength(255);
$custom_fields["udf_" . $definition['field_id']]->setSize(40);
} else {
if ($definition['field_type'] == UDF_TYPE_WYSIWYG) {
$custom_fields["udf_" . $definition['field_id']] = new ilTextAreaInputGUI($definition['field_name'], "udf_" . $definition['field_id']);
$custom_fields["udf_" . $definition['field_id']]->setValue($user_defined_data["f_" . $field_id]);
$custom_fields["udf_" . $definition['field_id']]->setUseRte(true);
} else {
$custom_fields["udf_" . $definition['field_id']] = new ilSelectInputGUI($definition['field_name'], "udf_" . $definition['field_id']);
$custom_fields["udf_" . $definition['field_id']]->setValue($user_defined_data["f_" . $field_id]);
$custom_fields["udf_" . $definition['field_id']]->setOptions($user_defined_fields->fieldValuesToSelectArray($definition['field_values']));
}
}
if ($definition['required']) {
$custom_fields["udf_" . $definition['field_id']]->setRequired(true);
}
}
// standard fields
include_once "./Services/User/classes/class.ilUserProfile.php";
$up = new ilUserProfile();
$up->setMode(ilUserProfile::MODE_REGISTRATION);
$up->skipGroup("preferences");
// add fields to form
$up->addStandardFieldsToForm($this->form, NULL, $custom_fields);
unset($custom_fields);
// set language selection to current display language
$flang = $this->form->getItemByPostVar("usr_language");
if ($flang) {
$flang->setValue($lng->getLangKey());
}
// add information to role selection (if not hidden)
if ($this->code_enabled) {
$role = $this->form->getItemByPostVar("usr_roles");
if ($role && $role->getType() == "select") {
$role->setInfo($lng->txt("registration_code_role_info"));
}
}
// user agreement
$field = new ilFormSectionHeaderGUI();
$field->setTitle($lng->txt("usr_agreement"));
$this->form->addItem($field);
$field = new ilCustomInputGUI();
$field->setHTML('<div id="agreement">' . ilUserAgreement::_getText() . '</div>');
$this->form->addItem($field);
$field = new ilCheckboxInputGUI($lng->txt("accept_usr_agreement"), "usr_agreement");
$field->setRequired(true);
$field->setValue(1);
$this->form->addItem($field);
$this->form->addCommandButton("saveForm", $lng->txt("register"));
}
示例13: initPartProperties
/**
* add the properties of a question part to the form
*
* @param object form object to extend
* @param object question part object
* @param integer counter of the question part
*/
private function initPartProperties($form, $part_obj = null, $counter = "1")
{
// Use a dummy part object for a new booking definition
if (!isset($part_obj)) {
$part_obj = new assAccountingQuestionPart($this->object);
}
// Part identifier (is 0 for a new part)
$item = new ilHiddenInputGUI("parts[]");
$item->setValue($part_obj->getPartId());
$form->addItem($item);
// Title
$item = new ilFormSectionHeaderGUI();
$item->setTitle($this->plugin->txt('accounting_table') . ' ' . $counter);
$form->addItem($item);
// Position
$item = new ilNumberInputGUI($this->plugin->txt('position'), 'position_' . $part_obj->getPartId());
$item->setSize(2);
$item->setDecimals(1);
$item->SetInfo($this->plugin->txt('position_info'));
if ($part_obj->getPartId()) {
$item->setValue(sprintf("%01.1f", $part_obj->getPosition()));
}
$form->addItem($item);
// Text
$item = new ilTextAreaInputGUI($this->plugin->txt("question_part"), 'text_' . $part_obj->getPartId());
$item->setValue($this->object->prepareTextareaOutput($part_obj->getText()));
$item->setRows(10);
$item->setCols(80);
if (!$this->object->getSelfAssessmentEditingMode()) {
$item->setUseRte(TRUE);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$item->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$item->addPlugin("latex");
$item->addButton("latex");
$item->addButton("pastelatex");
$item->setRTESupport($this->object->getId(), "qpl", "assessment");
} else {
$item->setRteTags(self::getSelfAssessmentTags());
$item->setUseTagsForRteOnly(false);
}
$form->addItem($item);
// Booking XML definition
$item = new ilCustomInputGUI($this->plugin->txt('booking_xml'));
$item->setInfo($this->plugin->txt('booking_xml_info'));
$tpl = $this->plugin->getTemplate('tpl.il_as_qpl_accqst_edit_xml.html');
$tpl->setVariable("CONTENT", ilUtil::prepareFormOutput($part_obj->getBookingXML()));
$tpl->setVariable("NAME", 'booking_xml_' . $part_obj->getPartId());
$item->setHTML($tpl->get());
// Booking file
$subitem = new ilFileInputGUI($this->plugin->txt('booking_file'), "booking_file_" . $part_obj->getPartId());
$subitem->setSuffixes(array('xml'));
$item->addSubItem($subitem);
// Download button
if (strlen($part_obj->getBookingXML())) {
$tpl = $this->plugin->getTemplate('tpl.il_as_qpl_accqst_form_custom.html');
$this->ctrl->setParameter($this, 'xmltype', 'booking');
$this->ctrl->setParameter($this, 'part_id', $part_obj->getPartId());
$tpl->setCurrentBlock('button');
$tpl->setVariable('BUTTON_HREF', $this->ctrl->getLinkTarget($this, 'downloadXml'));
$tpl->setVariable('BUTTON_TEXT', $this->plugin->txt('download_booking_xml'));
$tpl->ParseCurrentBlock();
$subitem = new ilcustomInputGUI('');
$subitem->setHTML($tpl->get());
$item->addSubItem($subitem);
}
$form->addItem($item);
// Delete Button
if ($part_obj->getPartId()) {
$tpl = $this->plugin->getTemplate('tpl.il_as_qpl_accqst_form_custom.html');
$tpl->setCurrentBlock('button');
$this->ctrl->setParameter($this, 'part_id', $part_obj->getPartId());
$tpl->setVariable('BUTTON_HREF', $this->ctrl->getLinkTarget($this, 'deletePart'));
$tpl->setVariable('BUTTON_TEXT', $this->plugin->txt('delete_accounting_table'));
$tpl->ParseCurrentBlock();
$item = new ilcustomInputGUI();
$item->setHTML($tpl->get());
$form->addItem($item);
}
}
示例14: addFieldsToEditForm
protected function addFieldsToEditForm(ilPropertyFormGUI $a_form)
{
// subtype
$subtype = new ilRadioGroupInputGUI($this->lng->txt("subtype"), "type");
$subtype->setRequired(false);
$subtypes = array("0" => "matrix_subtype_sr", "1" => "matrix_subtype_mr");
foreach ($subtypes as $idx => $st) {
$subtype->addOption(new ilRadioOption($this->lng->txt($st), $idx));
}
$a_form->addItem($subtype);
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("matrix_appearance"));
$a_form->addItem($header);
// column separators
$column_separators = new ilCheckboxInputGUI($this->lng->txt("matrix_column_separators"), "column_separators");
$column_separators->setValue(1);
$column_separators->setInfo($this->lng->txt("matrix_column_separators_description"));
$column_separators->setRequired(false);
$a_form->addItem($column_separators);
// row separators
$row_separators = new ilCheckboxInputGUI($this->lng->txt("matrix_row_separators"), "row_separators");
$row_separators->setValue(1);
$row_separators->setInfo($this->lng->txt("matrix_row_separators_description"));
$row_separators->setRequired(false);
$a_form->addItem($row_separators);
// neutral column separators
$neutral_column_separator = new ilCheckboxInputGUI($this->lng->txt("matrix_neutral_column_separator"), "neutral_column_separator");
$neutral_column_separator->setValue(1);
$neutral_column_separator->setInfo($this->lng->txt("matrix_neutral_column_separator_description"));
$neutral_column_separator->setRequired(false);
$a_form->addItem($neutral_column_separator);
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("matrix_columns"));
$a_form->addItem($header);
// Answers
include_once "./Modules/SurveyQuestionPool/classes/class.ilCategoryWizardInputGUI.php";
$columns = new ilCategoryWizardInputGUI("", "columns");
$columns->setRequired(false);
$columns->setAllowMove(true);
$columns->setShowWizard(true);
$columns->setShowNeutralCategory(true);
$columns->setDisabledScale(false);
$columns->setNeutralCategoryTitle($this->lng->txt('matrix_neutral_answer'));
$columns->setCategoryText($this->lng->txt('matrix_standard_answers'));
$columns->setShowSavePhrase(true);
$a_form->addItem($columns);
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("matrix_column_settings"));
$a_form->addItem($header);
// bipolar adjectives
$bipolar = new ilCustomInputGUI($this->lng->txt("matrix_bipolar_adjectives"));
$bipolar->setInfo($this->lng->txt("matrix_bipolar_adjectives_description"));
// left pole
$bipolar1 = new ilTextInputGUI($this->lng->txt("matrix_left_pole"), "bipolar1");
$bipolar1->setRequired(false);
$bipolar->addSubItem($bipolar1);
// right pole
$bipolar2 = new ilTextInputGUI($this->lng->txt("matrix_right_pole"), "bipolar2");
$bipolar2->setRequired(false);
$bipolar->addSubItem($bipolar2);
$a_form->addItem($bipolar);
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("matrix_rows"));
$a_form->addItem($header);
// matrix rows
include_once "./Modules/SurveyQuestionPool/classes/class.ilMatrixRowWizardInputGUI.php";
$rows = new ilMatrixRowWizardInputGUI("", "rows");
$rows->setRequired(false);
$rows->setAllowMove(true);
$rows->setLabelText($this->lng->txt('label'));
$rows->setUseOtherAnswer(true);
$a_form->addItem($rows);
// values
$subtype->setValue($this->object->getSubtype());
$column_separators->setChecked($this->object->getColumnSeparators());
$row_separators->setChecked($this->object->getRowSeparators());
$neutral_column_separator->setChecked($this->object->getNeutralColumnSeparator());
if (!$this->object->getColumnCount()) {
$this->object->columns->addCategory("");
}
$columns->setValues($this->object->getColumns());
$bipolar1->setValue($this->object->getBipolarAdjective(0));
$bipolar2->setValue($this->object->getBipolarAdjective(1));
if ($this->object->getRowCount() == 0) {
$this->object->getRows()->addCategory("");
}
$rows->setValues($this->object->getRows());
}
示例15: initPublicProfileForm
/**
* Init public profile form.
*
* @param int $a_mode Edit Mode
*/
public function initPublicProfileForm()
{
global $lng, $ilUser, $ilSetting;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form = new ilPropertyFormGUI();
$this->form->setTitle($lng->txt("public_profile"));
$this->form->setDescription($lng->txt("user_public_profile_info"));
$this->form->setFormAction($this->ctrl->getFormAction($this));
$portfolio_id = $this->getProfilePortfolio();
if (!$portfolio_id) {
// Activate public profile
$radg = new ilRadioGroupInputGUI($lng->txt("user_activate_public_profile"), "public_profile");
$info = $this->lng->txt("user_activate_public_profile_info");
$pub_prof = in_array($ilUser->prefs["public_profile"], array("y", "n", "g")) ? $ilUser->prefs["public_profile"] : "n";
if (!$ilSetting->get('enable_global_profiles') && $pub_prof == "g") {
$pub_prof = "y";
}
$radg->setValue($pub_prof);
$op1 = new ilRadioOption($lng->txt("usr_public_profile_disabled"), "n", $lng->txt("usr_public_profile_disabled_info"));
$radg->addOption($op1);
$op2 = new ilRadioOption($lng->txt("usr_public_profile_logged_in"), "y");
$radg->addOption($op2);
if ($ilSetting->get('enable_global_profiles')) {
$op3 = new ilRadioOption($lng->txt("usr_public_profile_global"), "g");
$radg->addOption($op3);
}
$this->form->addItem($radg);
// #11773
if ($ilSetting->get('user_portfolios')) {
// #10826
$prtf = "<br />" . $lng->txt("user_profile_portfolio");
$prtf .= "<br /><a href=\"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToPortfolio\">» " . $lng->txt("user_portfolios") . "</a>";
$info .= $prtf;
}
$radg->setInfo($info);
} else {
$prtf = $lng->txt("user_profile_portfolio_selected");
$prtf .= "<br /><a href=\"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToPortfolio&prt_id=" . $portfolio_id . "\">» " . $lng->txt("portfolio") . "</a>";
$info = new ilCustomInputGUI($lng->txt("user_activate_public_profile"));
$info->setHTML($prtf);
$this->form->addItem($info);
}
$this->showPublicProfileFields($this->form, $ilUser->prefs);
$this->form->addCommandButton("savePublicProfile", $lng->txt("save"));
}