/**
  * @return mixed
  */
 public function executeCommand()
 {
     // check hack attempts
     if (!$this->settings->get('password_assistance')) {
         if (empty($_SESSION['AccountId']) && $_SESSION['AccountId'] !== false) {
             $this->ilias->error_obj->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->WARNING);
         }
     }
     // check correct setup
     if (!$this->settings->get('setup_ok')) {
         die('Setup is not completed. Please run setup routine again.');
     }
     // Change the language, if necessary.
     // And load the 'pwassist' language module
     $lang = $_GET['lang'];
     if ($lang != null && $lang != '' && $this->lng->getLangKey() != $lang) {
         $lng = new ilLanguage($lang);
     }
     $this->lng->loadLanguageModule('pwassist');
     $cmd = $this->ctrl->getCmd();
     $next_class = $this->ctrl->getNextClass($this);
     switch ($next_class) {
         default:
             if ($cmd != '') {
                 return $this->{$cmd}();
             } else {
                 if (!empty($_GET['key'])) {
                     $this->showAssignPasswordForm();
                 } else {
                     $this->showAssistanceForm();
                 }
             }
             break;
     }
 }
 public function __construct(ilCtrl $ctrl, ilLanguage $lng, ilObjTest $testOBJ, ilTestRandomQuestionSetConfigGUI $questionSetConfigGUI, ilTestRandomQuestionSetConfig $questionSetConfig)
 {
     $this->ctrl = $ctrl;
     $this->lng = $lng;
     // Bugfix for mantis: 0015081
     $this->lng->loadLanguageModule('form');
     $this->testOBJ = $testOBJ;
     $this->questionSetConfigGUI = $questionSetConfigGUI;
     $this->questionSetConfig = $questionSetConfig;
 }
 /**
  *
  * @param
  *
  * @return \ilAuthShibbolethSettingsGUI
  */
 public function __construct($a_auth_ref_id)
 {
     global $lng, $ilCtrl, $tpl, $ilTabs, $ilias;
     $this->ctrl = $ilCtrl;
     $this->tabs_gui = $ilTabs;
     $this->lng = $lng;
     $this->lng->loadLanguageModule('shib');
     $this->ilias = $ilias;
     $this->tpl = $tpl;
     $this->ref_id = $a_auth_ref_id;
     $this->obj_id = ilObject::_lookupObjId($this->ref_id);
 }
 function __construct($parent_gui)
 {
     global $tpl, $ilCtrl, $ilTabs, $ilToolbar, $lng, $rbacsystem, $ilAccess;
     $this->tpl = $tpl;
     $this->ctrl = $ilCtrl;
     $this->parent_gui = $parent_gui;
     $this->object = $parent_gui->object;
     $this->tabs_gui = $this->parent_gui->tabs_gui;
     $this->toolbar = $ilToolbar;
     $this->lng = $lng;
     $this->ilAccess = $ilAccess;
     $this->lng->loadLanguageModule('user');
     if (!$rbacsystem->checkAccess("cat_administrate_users", $this->parent_gui->object->getRefId())) {
         ilUtil::sendFailure($this->lng->txt("msg_no_perm_admin_users"), true);
     }
 }
 /**
  *
  */
 protected function showUnitsOfCategory()
 {
     /**
      * @var $ilToolbar ilToolbarGUI
      */
     global $ilToolbar;
     $category = $this->getCategoryById((int) $_GET['category_id'], false);
     $this->tpl->addJavaScript("./Services/JavaScript/js/Basic.js");
     $this->tpl->addJavaScript("./Services/Form/js/Form.js");
     $this->lng->loadLanguageModule('form');
     require_once 'Modules/TestQuestionPool/classes/tables/class.ilUnitTableGUI.php';
     $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, $this->getUnitCategoryOverviewCommand()));
     if ($this->isCRUDContext()) {
         $ilToolbar->addButton($this->lng->txt('un_add_unit'), $this->ctrl->getLinkTarget($this, 'showUnitCreationForm'));
     }
     $table = new ilUnitTableGUI($this, 'showUnitsOfCategory', $category);
     $units = $this->repository->loadUnitsForCategory($category->getId());
     $data = array();
     foreach ($units as $unit) {
         /**
          * @var $unit assFormulaQuestionUnit
          */
         $data[] = array('unit_id' => $unit->getId(), 'unit' => $unit->getUnit(), 'baseunit' => $unit->getBaseunitTitle(), 'baseunit_id' => $unit->getBaseUnit(), 'factor' => $unit->getFactor(), 'sequence' => $unit->getSequence());
     }
     $table->setData($data);
     $this->tpl->setContent($table->getHTML());
 }
 /**
  * @param $parent_gui
  */
 function __construct($parent_gui)
 {
     global $tpl, $ilCtrl, $ilTabs, $ilToolbar, $lng, $ilAccess;
     $this->tpl = $tpl;
     $this->ctrl = $ilCtrl;
     $this->parent_gui = $parent_gui;
     $this->parent_object = $parent_gui->object;
     $this->tabs_gui = $this->parent_gui->tabs_gui;
     $this->toolbar = $ilToolbar;
     $this->lng = $lng;
     $this->ilAccess = $ilAccess;
     $this->lng->loadLanguageModule('user');
     if (!$this->ilAccess->checkaccess("write", "", $this->parent_gui->object->getRefId())) {
         ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
     }
 }
 /**
  * @param ilObjOrgUnitGUI $parent_gui
  */
 public function __construct(ilObjOrgUnitGUI $parent_gui)
 {
     global $tpl, $ilCtrl, $ilAccess, $ilToolbar, $ilLocator, $tree, $lng, $ilLog, $ilias, $ilTabs;
     $this->tpl = $tpl;
     $this->ctrl = $ilCtrl;
     $this->access = $ilAccess;
     $this->locator = $ilLocator;
     $this->toolbar = $ilToolbar;
     $this->tabs = $ilTabs;
     $this->log = $ilLog;
     $this->lng = $lng;
     $this->ilias = $ilias;
     $this->parent_gui = $parent_gui;
     $this->lng->loadLanguageModule('orgu');
     $this->ctrl->saveParameter($this, 'type_id');
     $this->lng->loadLanguageModule('meta');
     $this->checkAccess();
 }
 public function __construct()
 {
     global $tpl, $ilCtrl, $ilToolbar, $ilTabs, $lng, $ilAccess, $ilDB, $ilLocator;
     $this->ctrl = $ilCtrl;
     $this->tpl = $tpl;
     $this->toolbar = $ilToolbar;
     $this->tabs = $ilTabs;
     $this->ref_id = (int) $_GET['ref_id'];
     $this->crs = ilObjectFactory::getInstanceByRefId($this->ref_id);
     $this->definition = srCertificateDefinition::where(array('ref_id' => $this->ref_id))->first();
     $this->pl = ilCertificatePlugin::getInstance();
     $this->lng = $lng;
     $this->access = $ilAccess;
     $this->db = $ilDB;
     $this->ctrl->saveParameter($this, 'ref_id');
     $this->tpl->addJavaScript($this->pl->getStyleSheetLocation('uihk_certificate.js'));
     $this->lng->loadLanguageModule('common');
     $ilLocator->addRepositoryItems();
     $this->tpl->setVariable("LOCATOR", $ilLocator->getHTML());
 }
 public function __construct()
 {
     /**
      * @var $ilCtrl   ilCtrl
      * @var $tpl      ilTemplate
      * @var $lng      ilLanguage
      * @var $ilTabs   ilTabsGUI
      * @var $ilAccess ilAccessHandler
      * @var $ilias    ilias
      *  */
     global $ilCtrl, $tpl, $lng, $ilTabs, $ilAccess, $ilias;
     $this->ctrl = $ilCtrl;
     $this->tpl = $tpl;
     $this->lng = $lng;
     $ilTabs->setTabActive('frm_moderators');
     $this->lng->loadLanguageModule('search');
     if (!$ilAccess->checkAccess('write', '', (int) $_GET['ref_id'])) {
         $ilias->raiseError($this->lng->txt('permission_denied'), $ilias->error_obj->MESSAGE);
     }
     $this->oForumModerators = new ilForumModerators((int) $_GET['ref_id']);
     $this->ref_id = (int) $_GET['ref_id'];
 }
 public function editTranslations($a_get_post_values = false, $a_add = false)
 {
     $this->lng->loadLanguageModule($this->ilObjectOrgUnit->getType());
     $table = new ilObjectTranslationTableGUI($this, "editTranslations", true, "Translation");
     if ($a_get_post_values) {
         $vals = array();
         foreach ($_POST["title"] as $k => $v) {
             $vals[] = array("title" => $v, "desc" => $_POST["desc"][$k], "lang" => $_POST["lang"][$k], "default" => $_POST["default"] == $k);
         }
         $table->setData($vals);
     } else {
         $data = $this->ilObjectOrgUnit->getTranslations();
         foreach ($data["Fobject"] as $k => $v) {
             $data["Fobject"][$k]["default"] = $k == $data["default_language"];
         }
         if ($a_add) {
             $data["Fobject"][++$k]["title"] = "";
         }
         $table->setData($data["Fobject"]);
     }
     $this->tpl->setContent($table->getHTML());
 }
 /**
  *
  */
 protected function showAcceptanceHistory()
 {
     /**
      * @var $rbacsystem  ilRbacSystem
      * @var $ilErr       ilErrorHandling
      * @var $tpl         ilTemplate
      */
     global $rbacsystem, $ilErr, $tpl;
     if (!$rbacsystem->checkAccess('read', '', $this->object->getRefId()) || !$rbacsystem->checkAccess('read', '', USER_FOLDER_ID)) {
         $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->MESSAGE);
     }
     $this->lng->loadLanguageModule('meta');
     $table = new ilTermsOfServiceAcceptanceHistoryTableGUI($this, 'showAcceptanceHistory');
     $table->setProvider($this->factory->getByContext(ilTermsOfServiceTableDataProviderFactory::CONTEXT_ACCEPTANCE_HISTORY));
     $table->populate();
     $tpl->setContent($table->getHtml());
 }
 public function __construct()
 {
     global $tpl, $ilCtrl, $ilToolbar, $ilTabs, $lng, $ilAccess, $ilDB, $rbacreview, $ilUser;
     /** @var ilCtrl ctrl */
     $this->ctrl = $ilCtrl;
     $this->tpl = $tpl;
     $this->toolbar = $ilToolbar;
     $this->tabs = $ilTabs;
     $this->type = isset($_GET['type_id']) ? srCertificateType::find((int) $_GET['type_id']) : null;
     $this->pl = ilCertificatePlugin::getInstance();
     $this->lng = $lng;
     $this->access = $ilAccess;
     $this->db = $ilDB;
     $this->tpl->addJavaScript($this->pl->getStyleSheetLocation('uihk_certificate.js'));
     $this->lng->loadLanguageModule('common');
     $this->tpl->setTitleIcon(ilCertificatePlugin::getPluginIconImage());
     $this->rbac = $rbacreview;
     $this->user = $ilUser;
 }
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $ilias, $lng, $ilSetting, $ilErr, $ilAuth;
     // check hack attempts
     if (!$ilSetting->get("password_assistance")) {
         if (empty($_SESSION["AccountId"]) and $_SESSION["AccountId"] !== false) {
             $ilErr->raiseError($lng->txt("permission_denied"), $ilias->error_obj->WARNING);
         }
     }
     // check correct setup
     if (!$ilSetting->get("setup_ok")) {
         die("Setup is not completed. Please run setup routine again. (pwassist.php)");
     }
     // Change the language, if necessary.
     // And load the 'pwassist' language module
     $lang = $_GET['lang'];
     if ($lang != null && $lang != "" && $lng->getLangKey() != $lang) {
         $lng = new ilLanguage($lang);
     }
     $lng->loadLanguageModule('pwassist');
     $cmd = $this->ctrl->getCmd();
     $next_class = $this->ctrl->getNextClass($this);
     switch ($next_class) {
         default:
             if ($cmd != "") {
                 return $this->{$cmd}();
             } else {
                 if (!empty($_GET["key"])) {
                     $this->showAssignPasswordForm();
                 } else {
                     $this->showAssistanceForm();
                 }
             }
             break;
     }
     // Logout current session
     //$ilAuth->logout();
     //session_destroy();
 }
 public function executeCommand()
 {
     $this->tabs->setTabActive(self::TAB_ID_QUESTION_PREVIEW);
     $this->lng->loadLanguageModule('content');
     $nextClass = $this->ctrl->getNextClass($this);
     switch ($nextClass) {
         case 'ilassquestionhintrequestgui':
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
             $gui = new ilAssQuestionHintRequestGUI($this, self::CMD_SHOW, $this->questionGUI, $this->hintTracking);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilassspecfeedbackpagegui':
         case 'ilassgenfeedbackpagegui':
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackPageObjectCommandForwarder.php';
             $forwarder = new ilAssQuestionFeedbackPageObjectCommandForwarder($this->questionOBJ, $this->ctrl, $this->tabs, $this->lng);
             $forwarder->forward();
             break;
         default:
             $cmd = $this->ctrl->getCmd(self::CMD_SHOW) . 'Cmd';
             $this->{$cmd}();
     }
 }
 /**
  * @param ilPropertyFormGUI $form
  */
 private function addAvailabilityProperties(ilPropertyFormGUI $form)
 {
     include_once "Services/Object/classes/class.ilObjectActivation.php";
     $this->lng->loadLanguageModule('rep');
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('rep_activation_availability'));
     $form->addItem($section);
     // additional info only with multiple references
     $act_obj_info = $act_ref_info = "";
     if (sizeof(ilObject::_getAllReferences($this->testOBJ->getId())) > 1) {
         $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
         $act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
     }
     $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
     $online->setChecked($this->testOBJ->isOnline());
     $online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info);
     $form->addItem($online);
     $act_type = new ilCheckboxInputGUI($this->lng->txt('rep_visibility_until'), 'activation_type');
     $act_type->setChecked($this->testOBJ->isActivationLimited());
     // $act_type->setInfo($this->lng->txt('tst_availability_until_info'));
     $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
     include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
     $dur = new ilDateDurationInputGUI($this->lng->txt("rep_time_period"), "access_period");
     $dur->setShowTime(true);
     $date = $this->testOBJ->getActivationStartingTime();
     $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setStartText($this->lng->txt('rep_activation_limited_start'));
     $date = $this->testOBJ->getActivationEndingTime();
     $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setEndText($this->lng->txt('rep_activation_limited_end'));
     $act_type->addSubItem($dur);
     $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'activation_visibility');
     $visible->setInfo($this->lng->txt('tst_activation_limited_visibility_info'));
     $visible->setChecked($this->testOBJ->getActivationVisibility());
     $act_type->addSubItem($visible);
     $form->addItem($act_type);
 }
 /**
  * @param      $a_data
  * @param      $a_id
  * @param      $a_call_by_reference
  * @param bool $a_prepare_output
  */
 public function __construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output = true)
 {
     $this->type = 'sysc';
     parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
     $this->lng->loadLanguageModule('sysc');
 }
 /**
  * Translate message if possible 
  *
  * @param string $a_message_id
  * @param array $a_message_static
  * @return string
  */
 protected static function translateMessage($a_message_id, array $a_message_static = null)
 {
     global $ilDB, $lng, $ilSetting, $ilClientIniFile, $ilUser;
     // current language
     if (!$lng) {
         $lang = "en";
         if ($ilUser) {
             $lang = $ilUser->getLanguage();
         } else {
             if ($_REQUEST["lang"]) {
                 $lang = (string) $_REQUEST["lang"];
             } else {
                 if ($ilSetting) {
                     $lang = $ilSetting->get("language");
                 } else {
                     if ($ilClientIniFile) {
                         $lang = $ilClientIniFile->readVariable("language", "default");
                     }
                 }
             }
         }
     } else {
         $lang = $lng->getLangKey();
     }
     $message = "";
     if ($ilDB && $a_message_id) {
         if (!$lng) {
             require_once "./Services/Language/classes/class.ilLanguage.php";
             $lng = new ilLanguage($lang);
         }
         $lng->loadLanguageModule("init");
         $message = $lng->txt($a_message_id);
     } else {
         if (is_array($a_message_static)) {
             if (!isset($a_message_static[$lang])) {
                 $lang = "en";
             }
             $message = $a_message_static[$lang];
         }
     }
     return utf8_decode($message);
 }
 private function buildForm()
 {
     require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt("save"));
     $form->setTableWidth("100%");
     $form->setId("test_properties");
     if (!$this->settingsTemplate || $this->formShowGeneralSection($this->settingsTemplate->getSettings())) {
         // general properties
         $header = new ilFormSectionHeaderGUI();
         $header->setTitle($this->lng->txt("tst_general_properties"));
         $form->addItem($header);
     }
     // title & description (meta data)
     include_once 'Services/MetaData/classes/class.ilMD.php';
     $md_obj = new ilMD($this->testOBJ->getId(), 0, "tst");
     $md_section = $md_obj->getGeneral();
     $title = new ilTextInputGUI($this->lng->txt("title"), "title");
     $title->setRequired(true);
     $title->setValue($md_section->getTitle());
     $form->addItem($title);
     $ids = $md_section->getDescriptionIds();
     if ($ids) {
         $desc_obj = $md_section->getDescription(array_pop($ids));
         $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description");
         $desc->setCols(50);
         $desc->setRows(4);
         $desc->setValue($desc_obj->getDescription());
         $form->addItem($desc);
     }
     // anonymity
     $anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity');
     if ($this->testOBJ->participantDataExist()) {
         $anonymity->setDisabled(true);
     }
     $rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0);
     $anonymity->addOption($rb);
     $rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1);
     $anonymity->addOption($rb);
     $anonymity->setValue((int) $this->testOBJ->getAnonymity());
     $form->addItem($anonymity);
     // test mode (question set type)
     $questSetType = new ilRadioGroupInputGUI($this->lng->txt("tst_question_set_type"), 'question_set_type');
     $questSetTypeFixed = new ilRadioOption($this->lng->txt("tst_question_set_type_fixed"), ilObjTest::QUESTION_SET_TYPE_FIXED, $this->lng->txt("tst_question_set_type_fixed_desc"));
     $questSetType->addOption($questSetTypeFixed);
     $questSetTypeRandom = new ilRadioOption($this->lng->txt("tst_question_set_type_random"), ilObjTest::QUESTION_SET_TYPE_RANDOM, $this->lng->txt("tst_question_set_type_random_desc"));
     $questSetType->addOption($questSetTypeRandom);
     $questSetTypeContinues = new ilRadioOption($this->lng->txt("tst_question_set_type_dynamic"), ilObjTest::QUESTION_SET_TYPE_DYNAMIC, $this->lng->txt("tst_question_set_type_dynamic_desc"));
     $questSetType->addOption($questSetTypeContinues);
     $questSetType->setValue($this->testOBJ->getQuestionSetType());
     if ($this->testOBJ->participantDataExist()) {
         $questSetType->setDisabled(true);
     }
     $form->addItem($questSetType);
     // pool usage
     $pool_usage = new ilCheckboxInputGUI($this->lng->txt("test_question_pool_usage"), "use_pool");
     $pool_usage->setValue(1);
     $pool_usage->setChecked($this->testOBJ->getPoolUsage());
     $form->addItem($pool_usage);
     // enable_archiving
     $enable_archiving = new ilCheckboxInputGUI($this->lng->txt('test_enable_archiving'), 'enable_archiving');
     $enable_archiving->setValue(1);
     $enable_archiving->setChecked($this->testOBJ->getEnableArchiving());
     $form->addItem($enable_archiving);
     // activation/availability  (no template support yet)
     include_once "Services/Object/classes/class.ilObjectActivation.php";
     $this->lng->loadLanguageModule('rep');
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('rep_activation_availability'));
     $form->addItem($section);
     // additional info only with multiple references
     $act_obj_info = $act_ref_info = "";
     if (sizeof(ilObject::_getAllReferences($this->testOBJ->getId())) > 1) {
         $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
         $act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
     }
     $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
     $online->setChecked($this->testOBJ->isOnline());
     $online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info);
     $form->addItem($online);
     $act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type');
     $act_type->setInfo($act_ref_info);
     $act_type->setValue($this->testOBJ->isActivationLimited() ? ilObjectActivation::TIMINGS_ACTIVATION : ilObjectActivation::TIMINGS_DEACTIVATED);
     $opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED);
     $opt->setInfo($this->lng->txt('tst_availability_limitless_info'));
     $act_type->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION);
     $opt->setInfo($this->lng->txt('tst_availability_until_info'));
     $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
     include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
     $dur = new ilDateDurationInputGUI("", "access_period");
     $dur->setShowTime(true);
     $date = $this->testOBJ->getActivationStartingTime();
     $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setStartText($this->lng->txt('rep_activation_limited_start'));
     $date = $this->testOBJ->getActivationEndingTime();
     $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setEndText($this->lng->txt('rep_activation_limited_end'));
     $opt->addSubItem($dur);
     $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'activation_visibility');
     $visible->setInfo($this->lng->txt('tst_activation_limited_visibility_info'));
     $visible->setChecked($this->testOBJ->getActivationVisibility());
     $opt->addSubItem($visible);
     $act_type->addOption($opt);
     $form->addItem($act_type);
     if (!$this->settingsTemplate || $this->formShowBeginningEndingInformation($this->settingsTemplate->getSettings())) {
         // general properties
         $header = new ilFormSectionHeaderGUI();
         $header->setTitle($this->lng->txt("tst_beginning_ending_information"));
         $form->addItem($header);
     }
     // introduction
     $intro = new ilTextAreaInputGUI($this->lng->txt("tst_introduction"), "introduction");
     $intro->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getIntroduction()));
     $intro->setRows(10);
     $intro->setCols(80);
     $intro->setUseRte(TRUE);
     $intro->addPlugin("latex");
     $intro->addButton("latex");
     $intro->setRTESupport($this->testOBJ->getId(), "tst", "assessment");
     $intro->setRteTagSet('full');
     $intro->setInfo($this->lng->txt('intro_desc'));
     // showinfo
     $showinfo = new ilCheckboxInputGUI('', "showinfo");
     $showinfo->setValue(1);
     $showinfo->setChecked($this->testOBJ->getShowInfo());
     $showinfo->setOptionTitle($this->lng->txt("showinfo"));
     $showinfo->setInfo($this->lng->txt("showinfo_desc"));
     $intro->addSubItem($showinfo);
     $form->addItem($intro);
     // final statement
     $finalstatement = new ilTextAreaInputGUI($this->lng->txt("final_statement"), "finalstatement");
     $finalstatement->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getFinalStatement()));
     $finalstatement->setRows(10);
     $finalstatement->setCols(80);
     $finalstatement->setUseRte(TRUE);
     $finalstatement->addPlugin("latex");
     $finalstatement->addButton("latex");
     $finalstatement->setRTESupport($this->testOBJ->getId(), "tst", "assessment");
     $finalstatement->setRteTagSet('full');
     // show final statement
     $showfinal = new ilCheckboxInputGUI('', "showfinalstatement");
     $showfinal->setValue(1);
     $showfinal->setChecked($this->testOBJ->getShowFinalStatement());
     $showfinal->setOptionTitle($this->lng->txt("final_statement_show"));
     $showfinal->setInfo($this->lng->txt("final_statement_show_desc"));
     $finalstatement->addSubItem($showfinal);
     $form->addItem($finalstatement);
     // examview
     $enable_examview = new ilCheckboxInputGUI($this->lng->txt("enable_examview"), 'enable_examview');
     $enable_examview->setValue(1);
     $enable_examview->setChecked($this->testOBJ->getEnableExamview());
     $enable_examview->setInfo($this->lng->txt("enable_examview_desc"));
     $show_examview_html = new ilCheckboxInputGUI('', 'show_examview_html');
     $show_examview_html->setValue(1);
     $show_examview_html->setChecked($this->testOBJ->getShowExamviewHtml());
     $show_examview_html->setOptionTitle($this->lng->txt("show_examview_html"));
     $show_examview_html->setInfo($this->lng->txt("show_examview_html_desc"));
     $enable_examview->addSubItem($show_examview_html);
     $show_examview_pdf = new ilCheckboxInputGUI('', 'show_examview_pdf');
     $show_examview_pdf->setValue(1);
     $show_examview_pdf->setChecked($this->testOBJ->getShowExamviewPdf());
     $show_examview_pdf->setOptionTitle($this->lng->txt("show_examview_pdf"));
     $show_examview_pdf->setInfo($this->lng->txt("show_examview_pdf_desc"));
     $enable_examview->addSubItem($show_examview_pdf);
     $form->addItem($enable_examview);
     if (!$this->settingsTemplate || $this->formShowSessionSection($this->settingsTemplate->getSettings())) {
         // session properties
         $sessionheader = new ilFormSectionHeaderGUI();
         $sessionheader->setTitle($this->lng->txt("tst_session_settings"));
         $form->addItem($sessionheader);
     }
     // max. number of passes
     $nr_of_tries = new ilTextInputGUI($this->lng->txt("tst_nr_of_tries"), "nr_of_tries");
     $nr_of_tries->setSize(3);
     $nr_of_tries->setValue($this->testOBJ->getNrOfTries());
     $nr_of_tries->setRequired(true);
     $nr_of_tries->setSuffix($this->lng->txt("0_unlimited"));
     $total = $this->testOBJ->evalTotalPersons();
     if ($total) {
         $nr_of_tries->setDisabled(true);
     }
     $form->addItem($nr_of_tries);
     // enable max. processing time
     $processing = new ilCheckboxInputGUI($this->lng->txt("tst_processing_time"), "chb_processing_time");
     $processing->setValue(1);
     //$processing->setOptionTitle($this->lng->txt("enabled"));
     if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_processing_time')) {
         $processing->setChecked(true);
     } else {
         $processing->setChecked($this->testOBJ->getEnableProcessingTime());
     }
     // max. processing time
     $processingtime = new ilDurationInputGUI('', 'processing_time');
     $ptime = $this->testOBJ->getProcessingTimeAsArray();
     $processingtime->setHours($ptime['hh']);
     $processingtime->setMinutes($ptime['mm']);
     $processingtime->setSeconds($ptime['ss']);
     $processingtime->setShowMonths(false);
     $processingtime->setShowDays(false);
     $processingtime->setShowHours(true);
     $processingtime->setShowMinutes(true);
     $processingtime->setShowSeconds(true);
     $processingtime->setInfo($this->lng->txt("tst_processing_time_desc"));
     $processing->addSubItem($processingtime);
     // reset max. processing time
     $resetprocessing = new ilCheckboxInputGUI('', "chb_reset_processing_time");
     $resetprocessing->setValue(1);
     $resetprocessing->setOptionTitle($this->lng->txt("tst_reset_processing_time"));
     $resetprocessing->setChecked($this->testOBJ->getResetProcessingTime());
     $resetprocessing->setInfo($this->lng->txt("tst_reset_processing_time_desc"));
     $processing->addSubItem($resetprocessing);
     $form->addItem($processing);
     // enable starting time
     $enablestartingtime = new ilCheckboxInputGUI($this->lng->txt("tst_starting_time"), "chb_starting_time");
     $enablestartingtime->setValue(1);
     //$enablestartingtime->setOptionTitle($this->lng->txt("enabled"));
     if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_starting_time')) {
         $enablestartingtime->setChecked(true);
     } else {
         $enablestartingtime->setChecked(strlen($this->testOBJ->getStartingTime()));
     }
     // starting time
     $startingtime = new ilDateTimeInputGUI('', 'starting_time');
     $startingtime->setShowDate(true);
     $startingtime->setShowTime(true);
     if (strlen($this->testOBJ->getStartingTime())) {
         $startingtime->setDate(new ilDateTime($this->testOBJ->getStartingTime(), IL_CAL_TIMESTAMP));
     } else {
         $startingtime->setDate(new ilDateTime(time(), IL_CAL_UNIX));
     }
     $enablestartingtime->addSubItem($startingtime);
     $form->addItem($enablestartingtime);
     if ($this->testOBJ->participantDataExist()) {
         $enablestartingtime->setDisabled(true);
         $startingtime->setDisabled(true);
     }
     // enable ending time
     $enableendingtime = new ilCheckboxInputGUI($this->lng->txt("tst_ending_time"), "chb_ending_time");
     $enableendingtime->setValue(1);
     //$enableendingtime->setOptionTitle($this->lng->txt("enabled"));
     if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_ending_time')) {
         $enableendingtime->setChecked(true);
     } else {
         $enableendingtime->setChecked(strlen($this->testOBJ->getEndingTime()));
     }
     // ending time
     $endingtime = new ilDateTimeInputGUI('', 'ending_time');
     $endingtime->setShowDate(true);
     $endingtime->setShowTime(true);
     if (strlen($this->testOBJ->getEndingTime())) {
         $endingtime->setDate(new ilDateTime($this->testOBJ->getEndingTime(), IL_CAL_TIMESTAMP));
     } else {
         $endingtime->setDate(new ilDateTime(time(), IL_CAL_UNIX));
     }
     $enableendingtime->addSubItem($endingtime);
     $form->addItem($enableendingtime);
     // test password
     $password = new ilTextInputGUI($this->lng->txt("tst_password"), "password");
     $password->setSize(20);
     $password->setValue($this->testOBJ->getPassword());
     $password->setInfo($this->lng->txt("tst_password_details"));
     $form->addItem($password);
     if (!$this->settingsTemplate || $this->formShowPresentationSection($this->settingsTemplate->getSettings())) {
         // sequence properties
         $seqheader = new ilFormSectionHeaderGUI();
         $seqheader->setTitle($this->lng->txt("tst_presentation_properties"));
         $form->addItem($seqheader);
     }
     // use previous answers
     $prevanswers = new ilCheckboxInputGUI($this->lng->txt("tst_use_previous_answers"), "chb_use_previous_answers");
     $prevanswers->setValue(1);
     $prevanswers->setChecked($this->testOBJ->getUsePreviousAnswers());
     $prevanswers->setInfo($this->lng->txt("tst_use_previous_answers_description"));
     $form->addItem($prevanswers);
     // force js
     $forcejs = new ilCheckboxInputGUI($this->lng->txt("forcejs_short"), "forcejs");
     $forcejs->setValue(1);
     $forcejs->setChecked($this->testOBJ->getForceJS());
     $forcejs->setOptionTitle($this->lng->txt("forcejs"));
     $forcejs->setInfo($this->lng->txt("forcejs_desc"));
     $form->addItem($forcejs);
     // question title output
     $title_output = new ilRadioGroupInputGUI($this->lng->txt("tst_title_output"), "title_output");
     $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_full"), 0, ''));
     $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_hide_points"), 1, ''));
     $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_no_title"), 2, ''));
     $title_output->setValue($this->testOBJ->getTitleOutput());
     $title_output->setInfo($this->lng->txt("tst_title_output_description"));
     $form->addItem($title_output);
     // selector for unicode characters
     global $ilSetting;
     if ($ilSetting->get('char_selector_availability') > 0) {
         require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
         $char_selector = new ilCharSelectorGUI(ilCharSelectorConfig::CONTEXT_TEST);
         $char_selector->getConfig()->setAvailability($this->testOBJ->getCharSelectorAvailability());
         $char_selector->getConfig()->setDefinition($this->testOBJ->getCharSelectorDefinition());
         $char_selector->addFormProperties($form);
         $char_selector->setFormValues($form);
     }
     // Autosave
     $autosave_output = new ilCheckboxInputGUI($this->lng->txt('autosave'), 'autosave');
     $autosave_output->setValue(1);
     $autosave_output->setChecked($this->testOBJ->getAutosave());
     $autosave_output->setInfo($this->lng->txt('autosave_info'));
     $autosave_interval = new ilTextInputGUI($this->lng->txt('autosave_ival'), 'autosave_ival');
     $autosave_interval->setSize(10);
     $autosave_interval->setValue($this->testOBJ->getAutosaveIval() / 1000);
     $autosave_interval->setInfo($this->lng->txt('autosave_ival_info'));
     $autosave_output->addSubItem($autosave_interval);
     $form->addItem($autosave_output);
     if (!$this->settingsTemplate || $this->formShowSequenceSection($this->settingsTemplate->getSettings())) {
         // sequence properties
         $seqheader = new ilFormSectionHeaderGUI();
         $seqheader->setTitle($this->lng->txt("tst_sequence_properties"));
         $form->addItem($seqheader);
     }
     // postpone questions
     $postpone = new ilCheckboxInputGUI($this->lng->txt("tst_postpone"), "chb_postpone");
     $postpone->setValue(1);
     $postpone->setChecked($this->testOBJ->getSequenceSettings());
     $postpone->setInfo($this->lng->txt("tst_postpone_description"));
     $form->addItem($postpone);
     // shuffle questions
     $shuffle = new ilCheckboxInputGUI($this->lng->txt("tst_shuffle_questions"), "chb_shuffle_questions");
     $shuffle->setValue(1);
     $shuffle->setChecked($this->testOBJ->getShuffleQuestions());
     $shuffle->setInfo($this->lng->txt("tst_shuffle_questions_description"));
     $form->addItem($shuffle);
     // show list of questions
     $list_of_questions = new ilCheckboxInputGUI($this->lng->txt("tst_show_summary"), "list_of_questions");
     //$list_of_questions->setOptionTitle($this->lng->txt("tst_show_summary"));
     $list_of_questions->setValue(1);
     $list_of_questions->setChecked($this->testOBJ->getListOfQuestions());
     $list_of_questions->setInfo($this->lng->txt("tst_show_summary_description"));
     $list_of_questions_options = new ilCheckboxGroupInputGUI('', "list_of_questions_options");
     $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_start"), 'chb_list_of_questions_start', ''));
     $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_end"), 'chb_list_of_questions_end', ''));
     $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_with_description"), 'chb_list_of_questions_with_description', ''));
     $values = array();
     if ($this->testOBJ->getListOfQuestionsStart()) {
         array_push($values, 'chb_list_of_questions_start');
     }
     if ($this->testOBJ->getListOfQuestionsEnd()) {
         array_push($values, 'chb_list_of_questions_end');
     }
     if ($this->testOBJ->getListOfQuestionsDescription()) {
         array_push($values, 'chb_list_of_questions_with_description');
     }
     $list_of_questions_options->setValue($values);
     $list_of_questions->addSubItem($list_of_questions_options);
     $form->addItem($list_of_questions);
     // show question marking
     $marking = new ilCheckboxInputGUI($this->lng->txt("question_marking"), "chb_show_marker");
     $marking->setValue(1);
     $marking->setChecked($this->testOBJ->getShowMarker());
     $marking->setInfo($this->lng->txt("question_marking_description"));
     $form->addItem($marking);
     // show suspend test
     $cancel = new ilCheckboxInputGUI($this->lng->txt("tst_show_cancel"), "chb_show_cancel");
     $cancel->setValue(1);
     $cancel->setChecked($this->testOBJ->getShowCancel());
     $cancel->setInfo($this->lng->txt("tst_show_cancel_description"));
     $form->addItem($cancel);
     if (!$this->settingsTemplate || $this->formShowNotificationSection($this->settingsTemplate->getSettings())) {
         // notifications
         $notifications = new ilFormSectionHeaderGUI();
         $notifications->setTitle($this->lng->txt("tst_mail_notification"));
         $form->addItem($notifications);
     }
     // mail notification
     $mailnotification = new ilRadioGroupInputGUI($this->lng->txt("tst_finish_notification"), "mailnotification");
     $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_no"), 0, ''));
     $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_simple"), 1, ''));
     $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_advanced"), 2, ''));
     $mailnotification->setValue($this->testOBJ->getMailNotification());
     $form->addItem($mailnotification);
     $mailnottype = new ilCheckboxInputGUI('', "mailnottype");
     $mailnottype->setValue(1);
     $mailnottype->setOptionTitle($this->lng->txt("mailnottype"));
     $mailnottype->setChecked($this->testOBJ->getMailNotificationType());
     $form->addItem($mailnottype);
     /* This options always active (?) */
     $highscore_head = new ilFormSectionHeaderGUI();
     $highscore_head->setTitle($this->lng->txt("tst_highscore_options"));
     $form->addItem($highscore_head);
     $highscore = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_enabled"), "highscore_enabled");
     $highscore->setValue(1);
     $highscore->setChecked($this->testOBJ->getHighscoreEnabled());
     $highscore->setInfo($this->lng->txt("tst_highscore_description"));
     $form->addItem($highscore);
     $highscore_anon = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_anon"), "highscore_anon");
     $highscore_anon->setValue(1);
     $highscore_anon->setChecked($this->testOBJ->getHighscoreAnon());
     $highscore_anon->setInfo($this->lng->txt("tst_highscore_anon_description"));
     $highscore->addSubItem($highscore_anon);
     $highscore_achieved_ts = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_achieved_ts"), "highscore_achieved_ts");
     $highscore_achieved_ts->setValue(1);
     $highscore_achieved_ts->setChecked($this->testOBJ->getHighscoreAchievedTS());
     $highscore_achieved_ts->setInfo($this->lng->txt("tst_highscore_achieved_ts_description"));
     $highscore->addSubItem($highscore_achieved_ts);
     $highscore_score = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_score"), "highscore_score");
     $highscore_score->setValue(1);
     $highscore_score->setChecked($this->testOBJ->getHighscoreScore());
     $highscore_score->setInfo($this->lng->txt("tst_highscore_score_description"));
     $highscore->addSubItem($highscore_score);
     $highscore_percentage = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_percentage"), "highscore_percentage");
     $highscore_percentage->setValue(1);
     $highscore_percentage->setChecked($this->testOBJ->getHighscorePercentage());
     $highscore_percentage->setInfo($this->lng->txt("tst_highscore_percentage_description"));
     $highscore->addSubItem($highscore_percentage);
     $highscore_hints = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_hints"), "highscore_hints");
     $highscore_hints->setValue(1);
     $highscore_hints->setChecked($this->testOBJ->getHighscoreHints());
     $highscore_hints->setInfo($this->lng->txt("tst_highscore_hints_description"));
     $highscore->addSubItem($highscore_hints);
     $highscore_wtime = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_wtime"), "highscore_wtime");
     $highscore_wtime->setValue(1);
     $highscore_wtime->setChecked($this->testOBJ->getHighscoreWTime());
     $highscore_wtime->setInfo($this->lng->txt("tst_highscore_wtime_description"));
     $highscore->addSubItem($highscore_wtime);
     $highscore_own_table = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_own_table"), "highscore_own_table");
     $highscore_own_table->setValue(1);
     $highscore_own_table->setChecked($this->testOBJ->getHighscoreOwnTable());
     $highscore_own_table->setInfo($this->lng->txt("tst_highscore_own_table_description"));
     $highscore->addSubItem($highscore_own_table);
     $highscore_top_table = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_top_table"), "highscore_top_table");
     $highscore_top_table->setValue(1);
     $highscore_top_table->setChecked($this->testOBJ->getHighscoreTopTable());
     $highscore_top_table->setInfo($this->lng->txt("tst_highscore_top_table_description"));
     $highscore->addSubItem($highscore_top_table);
     $highscore_top_num = new ilTextInputGUI($this->lng->txt("tst_highscore_top_num"), "highscore_top_num");
     $highscore_top_num->setSize(4);
     $highscore_top_num->setSuffix($this->lng->txt("tst_highscore_top_num_unit"));
     $highscore_top_num->setValue($this->testOBJ->getHighscoreTopNum());
     $highscore_top_num->setInfo($this->lng->txt("tst_highscore_top_num_description"));
     $highscore->addSubItem($highscore_top_num);
     if (!$this->settingsTemplate || $this->formShowTestExecutionSection($this->settingsTemplate->getSettings())) {
         $testExecution = new ilFormSectionHeaderGUI();
         $testExecution->setTitle($this->lng->txt("tst_test_execution"));
         $form->addItem($testExecution);
     }
     // kiosk mode
     $kiosk = new ilCheckboxInputGUI($this->lng->txt("kiosk"), "kiosk");
     $kiosk->setValue(1);
     $kiosk->setChecked($this->testOBJ->getKioskMode());
     $kiosk->setInfo($this->lng->txt("kiosk_description"));
     // kiosk mode options
     $kiosktitle = new ilCheckboxGroupInputGUI($this->lng->txt("kiosk_options"), "kiosk_options");
     $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_title"), 'kiosk_title', ''));
     $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_participant"), 'kiosk_participant', ''));
     $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt('examid_in_kiosk'), 'examid_in_kiosk'));
     $values = array();
     if ($this->testOBJ->getShowKioskModeTitle()) {
         array_push($values, 'kiosk_title');
     }
     if ($this->testOBJ->getShowKioskModeParticipant()) {
         array_push($values, 'kiosk_participant');
     }
     if ($this->testOBJ->getExamidInKiosk()) {
         array_push($values, 'examid_in_kiosk');
     }
     $kiosktitle->setValue($values);
     $kiosktitle->setInfo($this->lng->txt("kiosk_options_desc"));
     $kiosk->addSubItem($kiosktitle);
     $form->addItem($kiosk);
     $redirection_mode = $this->testOBJ->getRedirectionMode();
     $rm_enabled = new ilCheckboxInputGUI($this->lng->txt('redirect_after_finishing_tst'), 'redirection_enabled');
     $rm_enabled->setChecked($redirection_mode == '0' ? false : true);
     $radio_rm = new ilRadioGroupInputGUI($this->lng->txt('redirect_after_finishing_tst'), 'redirection_mode');
     $always = new ilRadioOption($this->lng->txt('tst_results_access_always'), REDIRECT_ALWAYS);
     $radio_rm->addOption($always);
     $kiosk = new ilRadioOption($this->lng->txt('redirect_in_kiosk_mode'), REDIRECT_KIOSK);
     $radio_rm->addOption($kiosk);
     $radio_rm->setValue(in_array($redirection_mode, array(REDIRECT_ALWAYS, REDIRECT_KIOSK)) ? $redirection_mode : REDIRECT_ALWAYS);
     $rm_enabled->addSubItem($radio_rm);
     $redirection_url = new ilTextInputGUI($this->lng->txt('redirection_url'), 'redirection_url');
     $redirection_url->setValue((string) $this->testOBJ->getRedirectionUrl());
     $redirection_url->setRequired(true);
     $rm_enabled->addSubItem($redirection_url);
     $form->addItem($rm_enabled);
     // Sign submission
     $sign_submission = $this->testOBJ->getSignSubmission();
     $sign_submission_enabled = new ilCheckboxInputGUI($this->lng->txt('sign_submission'), 'sign_submission');
     $sign_submission_enabled->setChecked($sign_submission);
     $sign_submission_enabled->setInfo($this->lng->txt('sign_submission_info'));
     $form->addItem($sign_submission_enabled);
     if (!$this->settingsTemplate || $this->formShowParticipantSection($this->settingsTemplate->getSettings())) {
         // participants properties
         $restrictions = new ilFormSectionHeaderGUI();
         $restrictions->setTitle($this->lng->txt("tst_max_allowed_users"));
         $form->addItem($restrictions);
     }
     $fixedparticipants = new ilCheckboxInputGUI($this->lng->txt('participants_invitation'), "fixedparticipants");
     $fixedparticipants->setValue(1);
     $fixedparticipants->setChecked($this->testOBJ->getFixedParticipants());
     $fixedparticipants->setOptionTitle($this->lng->txt("tst_allow_fixed_participants"));
     $fixedparticipants->setInfo($this->lng->txt("participants_invitation_description"));
     $invited_users = $this->testOBJ->getInvitedUsers();
     if ($total && count($invited_users) == 0) {
         $fixedparticipants->setDisabled(true);
     }
     $form->addItem($fixedparticipants);
     // simultaneous users
     $simul = new ilTextInputGUI($this->lng->txt("tst_allowed_users"), "allowedUsers");
     $simul->setSize(3);
     $simul->setValue($this->testOBJ->getAllowedUsers() ? $this->testOBJ->getAllowedUsers() : '');
     $form->addItem($simul);
     // idle time
     $idle = new ilTextInputGUI($this->lng->txt("tst_allowed_users_time_gap"), "allowedUsersTimeGap");
     $idle->setSize(4);
     $idle->setSuffix($this->lng->txt("seconds"));
     $idle->setValue($this->testOBJ->getAllowedUsersTimeGap() ? $this->testOBJ->getAllowedUsersTimeGap() : '');
     $form->addItem($idle);
     // Edit ecs export settings
     include_once 'Modules/Test/classes/class.ilECSTestSettings.php';
     $ecs = new ilECSTestSettings($this->testOBJ);
     $ecs->addSettingsToForm($form, 'tst');
     // remove items when using template
     if ($this->settingsTemplate) {
         foreach ($this->settingsTemplate->getSettings() as $id => $item) {
             if ($item["hide"]) {
                 $form->removeItemByPostVar($id);
             }
         }
     }
     return $form;
 }
Example #19
0
 /**
  * Sends the mail with its object properties as MimeMail
  * It first tries to read the mail body, subject and sender address from posted named formular fields. 
  * If no field values found the defaults are used.
  * Placehoders will be replaced by the appropriate data.
  * @access	public
  * @param object ilUser
  */
 function send()
 {
     global $ilSetting;
     $user =& $this->getUser();
     if (!$user->getEmail()) {
         return false;
     }
     // determine language and get account mail data
     // fall back to default language if acccount mail data is not given for user language.
     $amail = $this->readAccountMail($user->getLanguage());
     if ($amail['body'] == '' || $amail['subject'] == '') {
         $amail = $this->readAccountMail($ilSetting->get('language'));
         $lang = $ilSetting->get('language');
     } else {
         $lang = $user->getLanguage();
     }
     // fallback if mail data is still not given
     if ($this->areLangVariablesUsedAsFallback() && ($amail['body'] == '' || $amail['subject'] == '')) {
         $lang = $user->getLanguage();
         $tmp_lang = new ilLanguage($lang);
         // mail subject
         $mail_subject = $tmp_lang->txt('reg_mail_subject');
         $timelimit = "";
         if (!$user->checkTimeLimit()) {
             $tmp_lang->loadLanguageModule("registration");
             // #6098
             $timelimit_from = new ilDateTime($user->getTimeLimitFrom(), IL_CAL_UNIX);
             $timelimit_until = new ilDateTime($user->getTimeLimitUntil(), IL_CAL_UNIX);
             $timelimit = ilDatePresentation::formatPeriod($timelimit_from, $timelimit_until);
             $timelimit = "\n" . sprintf($tmp_lang->txt('reg_mail_body_timelimit'), $timelimit) . "\n\n";
         }
         // mail body
         $mail_body = $tmp_lang->txt('reg_mail_body_salutation') . ' ' . $user->getFullname() . ",\n\n" . $tmp_lang->txt('reg_mail_body_text1') . "\n\n" . $tmp_lang->txt('reg_mail_body_text2') . "\n" . ILIAS_HTTP_PATH . '/login.php?client_id=' . CLIENT_ID . "\n";
         $mail_body .= $tmp_lang->txt('login') . ': ' . $user->getLogin() . "\n";
         $mail_body .= $tmp_lang->txt('passwd') . ': ' . $this->u_password . "\n";
         $mail_body .= "\n" . $timelimit;
         $mail_body .= $tmp_lang->txt('reg_mail_body_text3') . "\n\r";
         $mail_body .= $user->getProfileAsString($tmp_lang);
     } else {
         // replace placeholders
         $mail_subject = $this->replacePlaceholders($amail['subject'], $user, $amail, $lang);
         $mail_body = $this->replacePlaceholders($amail['body'], $user, $amail, $lang);
     }
     // send the mail
     include_once 'Services/Mail/classes/class.ilMimeMail.php';
     $mmail = new ilMimeMail();
     $mmail->autoCheck(false);
     $mmail->From($ilSetting->get('admin_email'));
     $mmail->Subject($mail_subject);
     $mmail->To($user->getEmail());
     $mmail->Body($mail_body);
     foreach ($this->attachments as $filename => $display_name) {
         $mmail->Attach($filename, "", "attachment", $display_name);
     }
     /*
     echo "<br><br><b>From</b>:".$ilSetting->get("admin_email");
     echo "<br><br><b>To</b>:".$user->getEmail();
     echo "<br><br><b>Subject</b>:".$mail_subject;
     echo "<br><br><b>Body</b>:".$mail_body;
     return true;*/
     $mmail->Send();
     return true;
 }
 private function initLanguage()
 {
     $this->lng->loadLanguageModule("tst");
     $this->lng->loadLanguageModule("assessment");
 }
Example #21
0
 function __sendProfileMail()
 {
     global $ilUser, $ilias;
     if ($_POST['send_mail'] != 'y') {
         return '';
     }
     if (!strlen($this->object->getEmail())) {
         return '';
     }
     // Choose language of user
     $usr_lang = new ilLanguage($this->object->getLanguage());
     $usr_lang->loadLanguageModule('crs');
     $usr_lang->loadLanguageModule('registration');
     include_once "Services/Mail/classes/class.ilMimeMail.php";
     $mmail = new ilMimeMail();
     $mmail->autoCheck(false);
     $mmail->From($ilUser->getEmail());
     $mmail->To($this->object->getEmail());
     // mail subject
     $subject = $usr_lang->txt("profile_changed");
     // mail body
     $body = $usr_lang->txt("reg_mail_body_salutation") . " " . $this->object->getFullname() . ",\n\n";
     $date = $this->object->getApproveDate();
     // Approve
     if (time() - strtotime($date) < 10) {
         $body .= $usr_lang->txt('reg_mail_body_approve') . "\n\n";
     } else {
         $body .= $usr_lang->txt('reg_mail_body_profile_changed') . "\n\n";
     }
     // Append login info only if password has been chacnged
     if ($_POST['passwd'] != '********') {
         $body .= $usr_lang->txt("reg_mail_body_text2") . "\n" . ILIAS_HTTP_PATH . "/login.php?client_id=" . $ilias->client_id . "\n" . $usr_lang->txt("login") . ": " . $this->object->getLogin() . "\n" . $usr_lang->txt("passwd") . ": " . $_POST['passwd'] . "\n\n";
     }
     $body .= $usr_lang->txt("reg_mail_body_text3") . "\n";
     $body .= $this->object->getProfileAsString($usr_lang);
     $mmail->Subject($subject);
     $mmail->Body($body);
     $mmail->Send();
     return "<br/>" . $this->lng->txt("mail_sent");
 }