• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ilCustomInputGUI类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ilCustomInputGUI的典型用法代码示例。如果您正苦于以下问题:PHP ilCustomInputGUI类的具体用法?PHP ilCustomInputGUI怎么用?PHP ilCustomInputGUI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ilCustomInputGUI类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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());
 }
开发者ID:ba-al,项目名称:ILIAS-ChemistryQuestion44,代码行数:39,代码来源:class.assJSMEQuestionGUI.php


示例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']);
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:40,代码来源:class.ilBibliographicDetailsGUI.php


示例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);
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:55,代码来源:class.ilADTDateTimeSearchBridgeRange.php


示例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;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:25,代码来源:class.ilDataCollectionRecordListGUI.php


示例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;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:71,代码来源:class.ilScoringAdjustmentGUI.php


示例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;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:86,代码来源:class.ilECSMappingSettingsGUI.php


示例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);
             }
         }
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:63,代码来源:class.ilAdministrationSettingsFormHandler.php


示例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);
//.........这里部分代码省略.........
开发者ID:arlendotcn,项目名称:ilias,代码行数:101,代码来源:class.ilMailFolderGUI.php


示例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'))));
//.........这里部分代码省略.........
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:101,代码来源:class.ilLuceneAdvancedSearchFields.php


示例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);
         }
     }
 }
开发者ID:ilifau,项目名称:ExternalContent,代码行数:84,代码来源:class.ilExternalContentType.php


示例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;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:62,代码来源:class.ilTestScoringGUI.php


示例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"));
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:79,代码来源:class.ilAccountRegistrationGUI.php


示例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 book 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ilDatePresentation类代码示例发布时间:2022-05-23
下一篇:
PHP ilCtrl类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap