/**
  * @param $a_parent_obj
  * @param $a_parent_cmd
  */
 public function __construct($a_parent_obj, $a_parent_cmd)
 {
     /**
      * @var $ilCtrl ilCtrl
      */
     global $ilCtrl;
     $this->ctrl = $ilCtrl;
     // Call this immediately in constructor
     $this->setId('mail_attachments');
     $this->setDefaultOrderDirection('ASC');
     $this->setDefaultOrderField('filename');
     parent::__construct($a_parent_obj, $a_parent_cmd);
     $this->setTitle($this->lng->txt('attachment'));
     $this->setNoEntriesText($this->lng->txt('marked_entries'));
     $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, 'applyFilter'));
     $this->setSelectAllCheckbox('filename[]');
     $this->setRowTemplate('tpl.mail_attachment_row.html', 'Services/Mail');
     $this->addMultiCommand('saveAttachments', $this->lng->txt('adopt'));
     $this->addMultiCommand('deleteAttachments', $this->lng->txt('delete'));
     $this->addCommandButton('cancelSaveAttachments', $this->lng->txt('cancel'));
     $this->addColumn($this->lng->txt(''), '', '1px', true);
     $this->addColumn($this->lng->txt('mail_file_name'), 'filename');
     $this->addColumn($this->lng->txt('mail_file_size'), 'filesize');
     $this->addColumn($this->lng->txt('create_date'), 'filecreatedate');
 }
 /**
  * Modify GUI objects, before they generate ouput
  *
  * @param string $a_comp component
  * @param string $a_part string that identifies the part of the UI that is handled
  * @param string $a_par array of parameters (depend on $a_comp and $a_part)
  */
 function modifyGUI($a_comp, $a_part, $contextElements = array())
 {
     // currently only implemented for $ilTabsGUI
     // Zeigt an, in welchem Modul man sich gerade in ILIAS befindet
     /*
     		if ($part == "tabs") {
     			var_dump($this->ctrl->getCalHistory());
     		}
     		/**/
     // tabs hook
     // note that you currently do not get information in $a_comp
     // here. So you need to use general GET/POST information
     // like $_GET["baseClass"], $ilCtrl->getCmdClass/getCmd
     // to determine the context.
     //if ($a_part == "tabs")
     if ($a_part == "tabs" && $this->isINCourseGUI()) {
         // $a_par["tabs"] is ilTabsGUI object
         /** @var ilTabsGUI $tabs */
         $tabs = $contextElements["tabs"];
         $this->ctrl->saveParameterByClass('ilCourseEmailSubscriptionGUI', 'ref_id');
         // saveparameterbyclass behält Einstellungsvariablen (ref_id) auch bei neuem Link
         $tabs->addTab('courseSubscription', 'Mitglieder Einschreiben', $this->ctrl->getLinkTargetByClass(array('ilUIPluginRouterGUI', 'ilCourseEmailSubscriptionGUI'), 'show'));
         //$tabs->addTab('test', 'test', 'test');
         /*
         $tabs = $contextElements["tabs"];
         $this->ctrl->saveParameterByClass('ilUIExampleUIHookGUI', 'ref_id');
         $tabs->addTab('courseSubscription', 'Mitglieder Einschreiben', $this->ctrl->getLinkTargetByClass(array('ilUIPluginRouterGUI', 'ilUIExampleUIHookGUI'), 'show'));
         */
     }
 }
 /**
  * Init settings property form
  *
  * @access private
  */
 private function initForm()
 {
     $this->setFormAction($this->ctrl->getFormAction($this->parent_gui));
     $name = new ilTextInputGUI($this->lng->txt("bibl_library_name"), 'name');
     $name->setRequired(true);
     $name->setValue('');
     $this->addItem($name);
     $url = new ilTextInputGUI($this->lng->txt("bibl_library_url"), 'url');
     $url->setRequired(true);
     $url->setValue('');
     $this->addItem($url);
     $img = new ilTextInputGUI($this->lng->txt("bibl_library_img"), 'img');
     $img->setValue('');
     $this->addItem($img);
     $show_in_list = new ilCheckboxInputGUI($this->lng->txt("bibl_library_show_in_list"), 'show_in_list');
     $show_in_list->setValue(1);
     $this->addItem($show_in_list);
     switch ($this->action) {
         case 'create':
             $this->setTitle($this->lng->txt("bibl_settings_new"));
             $this->addCommandButton('create', $this->lng->txt('save'));
             break;
         case 'update':
             $this->addCommandButton('update', $this->lng->txt('save'));
             $this->fillForm();
             $this->setTitle($this->lng->txt("bibl_settings_edit"));
             break;
     }
     $this->addCommandButton('cancel', $this->lng->txt("cancel"));
 }
 /**
  * @param        $parent
  * @param string $cmd
  */
 public function __construct($parent, $cmd, $template_context = '', ilMarkSchemaAware $object = null)
 {
     /**
      * @var $ilCtrl ilCtrl
      */
     global $ilCtrl;
     $this->object = $object;
     $this->ctrl = $ilCtrl;
     $this->is_editable = $this->object->canEditMarks();
     $this->setId('mark_schema_gui_' . $this->object->getMarkSchemaForeignId());
     parent::__construct($parent, $cmd);
     $this->setFormAction($this->ctrl->getFormAction($this->getParentObject(), $cmd));
     $this->setRowTemplate('tpl.il_as_tst_mark_schema_row.html', 'Modules/Test');
     $this->setNoEntriesText($this->lng->txt('tst_no_marks_defined'));
     if ($this->object->canEditMarks()) {
         $this->addCommandButton('addMarkStep', $this->lng->txt('tst_mark_create_new_mark_step'));
         $this->addCommandButton('saveMarks', $this->lng->txt('save'));
         $this->addMultiCommand('deleteMarkSteps', $this->lng->txt('delete'));
         $this->setSelectAllCheckbox('marks[]');
     } else {
         $this->disable('select_all');
     }
     $this->setLimit(PHP_INT_MAX);
     $this->initColumns();
     $this->initData();
 }
 public function build(ilTestRandomQuestionSetSourcePoolDefinition $sourcePool, $availableTaxonomyIds)
 {
     $this->setFormAction($this->ctrl->getFormAction($this->questionSetConfigGUI));
     $this->setTitle($this->lng->txt('tst_rnd_quest_set_cfg_pool_form'));
     $this->setId('tstRndQuestSetCfgPoolForm');
     $this->addCommandButton($this->getSaveCommand(), $this->lng->txt('save_and_back'));
     if (null !== $this->getSaveAndNewCommand()) {
         $this->addCommandButton($this->getSaveAndNewCommand(), $this->lng->txt('tst_save_and_create_new_rule'));
     }
     $this->addCommandButton(ilTestRandomQuestionSetConfigGUI::CMD_SHOW_SRC_POOL_DEF_LIST, $this->lng->txt('cancel'));
     $hiddenDefId = new ilHiddenInputGUI('src_pool_def_id');
     $hiddenDefId->setValue($sourcePool->getId());
     $this->addItem($hiddenDefId);
     $hiddenPoolId = new ilHiddenInputGUI('quest_pool_id');
     $hiddenPoolId->setValue($sourcePool->getPoolId());
     $this->addItem($hiddenPoolId);
     $nonEditablePoolLabel = new ilNonEditableValueGUI($this->lng->txt('tst_inp_source_pool_label'), 'quest_pool_label');
     $nonEditablePoolLabel->setValue($sourcePool->getPoolInfoLabel($this->lng));
     $this->addItem($nonEditablePoolLabel);
     if (count($availableTaxonomyIds)) {
         $taxRadio = new ilRadioGroupInputGUI($this->lng->txt('tst_inp_source_pool_filter_tax'), 'filter_tax');
         $taxRadio->setRequired(true);
         $taxRadio->addOption(new ilRadioOption($this->lng->txt('tst_inp_source_pool_no_tax_filter'), 0));
         $taxRadio->setValue(0);
         require_once 'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
         foreach ($availableTaxonomyIds as $taxId) {
             $taxonomy = new ilObjTaxonomy($taxId);
             $label = sprintf($this->lng->txt('tst_inp_source_pool_filter_tax_x'), $taxonomy->getTitle());
             $taxRadioOption = new ilRadioOption($label, $taxId);
             $taxRadio->addOption($taxRadioOption);
             $taxSelect = new ilTaxSelectInputGUI($taxId, "filter_tax_{$taxId}", false);
             $taxSelect->setRequired(true);
             $taxRadioOption->addSubItem($taxSelect);
             if ($taxId == $sourcePool->getOriginalFilterTaxId()) {
                 $taxRadio->setValue($sourcePool->getOriginalFilterTaxId());
                 $taxSelect->setValue($sourcePool->getOriginalFilterTaxNodeId());
             }
         }
         $this->addItem($taxRadio);
     } else {
         $hiddenNoTax = new ilHiddenInputGUI('filter_tax');
         $hiddenNoTax->setValue(0);
         $this->addItem($hiddenNoTax);
         $nonEditableNoTax = new ilNonEditableValueGUI($this->lng->txt('tst_inp_source_pool_filter_tax'), 'no_tax_label');
         $nonEditableNoTax->setValue($this->lng->txt('tst_inp_no_available_tax_hint'));
         $this->addItem($nonEditableNoTax);
     }
     if ($this->questionSetConfig->isQuestionAmountConfigurationModePerPool()) {
         $questionAmountPerSourcePool = new ilNumberInputGUI($this->lng->txt('tst_inp_quest_amount_per_source_pool'), 'question_amount_per_pool');
         $questionAmountPerSourcePool->setRequired(true);
         $questionAmountPerSourcePool->allowDecimals(false);
         $questionAmountPerSourcePool->setMinValue(0);
         $questionAmountPerSourcePool->setMinvalueShouldBeGreater(true);
         $questionAmountPerSourcePool->setSize(4);
         if ($sourcePool->getQuestionAmount()) {
             $questionAmountPerSourcePool->setValue($sourcePool->getQuestionAmount());
         }
         $this->addItem($questionAmountPerSourcePool);
     }
 }
 public function build()
 {
     $this->setFormAction($this->ctrl->getFormAction($this->questionSetConfigGUI));
     if ($this->questionSetConfig->doesSelectableQuestionPoolsExist()) {
         $this->populateNewQuestionSelectionRuleInputs();
     }
 }
 /**
  * Add all fields to the form
  */
 protected function initForm()
 {
     $this->setFormAction($this->ctrl->getFormAction($this->parent_gui));
     $this->setTitle($this->lng->txt('orgu_settings'));
     $item = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $item->setRequired(true);
     $item->setValue($this->obj_orgu->getTitle());
     $this->addItem($item);
     $item = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
     $item->setValue($this->obj_orgu->getDescription());
     $this->addItem($item);
     $item = new ilFormSectionHeaderGUI();
     $item->setTitle($this->lng->txt('orgu_type'));
     $this->addItem($item);
     $types = ilOrgUnitType::getAllTypes();
     $options = array(0 => '');
     /** @var ilOrgUnitType $type */
     foreach ($types as $type) {
         $options[$type->getId()] = $type->getTitle();
     }
     asort($options);
     $item = new ilSelectInputGUI($this->lng->txt('orgu_type'), 'orgu_type');
     $item->setOptions($options);
     $item->setValue($this->obj_orgu->getOrgUnitTypeId());
     $this->addItem($item);
     $item = new ilFormSectionHeaderGUI();
     $item->setTitle($this->lng->txt('ext_id'));
     $this->addItem($item);
     $item = new ilTextInputGUI($this->lng->txt('ext_id'), 'ext_id');
     $item->setValue($this->obj_orgu->getImportId());
     $this->addItem($item);
     $this->addCommandButton('updateSettings', $this->lng->txt('save'));
 }
 /**
  * @param array $a_set
  */
 public function fillRow($a_set)
 {
     $ilUDFCheck = ilUDFCheck::find($a_set['id']);
     $ilUDFCheckGUI = new ilUDFCheckGUI($this->parent_obj);
     foreach ($this->getSelectableColumns() as $k => $v) {
         if ($k == 'actions') {
             $this->ctrl->setParameter($this->parent_obj, ilUDFCheckGUI::IDENTIFIER, $ilUDFCheck->getId());
             $this->ctrl->setParameter($ilUDFCheckGUI, ilUDFCheckGUI::IDENTIFIER, $ilUDFCheck->getId());
             $current_selection_list = new ilAdvancedSelectionListGUI();
             $current_selection_list->setListTitle($this->pl->txt('check_actions'));
             $current_selection_list->setId('check_actions' . $ilUDFCheck->getId());
             $current_selection_list->setUseImages(false);
             $current_selection_list->addItem($this->pl->txt('check_edit'), 'check_edit', $this->ctrl->getLinkTarget($this->parent_obj, ilUserSettingsGUI::CMD_EDIT));
             $current_selection_list->addItem($this->pl->txt('check_delete'), 'check_delete', $this->ctrl->getLinkTarget($this->parent_obj, ilUserSettingsGUI::CMD_CONFIRM_DELETE));
             $this->tpl->setCurrentBlock('td');
             $this->tpl->setVariable('VALUE', $current_selection_list->getHTML());
             $this->tpl->parseCurrentBlock();
             continue;
         }
         if ($this->isColumnSelected($k)) {
             if ($a_set[$k]) {
                 $this->tpl->setCurrentBlock('td');
                 $this->tpl->setVariable('VALUE', is_array($a_set[$k]) ? implode(", ", $a_set[$k]) : $a_set[$k]);
                 $this->tpl->parseCurrentBlock();
             } else {
                 $this->tpl->setCurrentBlock('td');
                 $this->tpl->setVariable('VALUE', ' ');
                 $this->tpl->parseCurrentBlock();
             }
         }
     }
 }
 /**
  * @return boolean
  */
 public function adjust()
 {
     if (defined('IL_CERT_SSO')) {
         return false;
     } else {
         if (!ilContext::supportsRedirects()) {
             return false;
         } else {
             if ($this->ctrl->isAsynch()) {
                 return false;
             } else {
                 if (in_array(basename($_SERVER['PHP_SELF']), array('logout.php'))) {
                     return false;
                 } else {
                     if (!$this->user->getId() || $this->user->isAnonymous()) {
                         return false;
                     }
                 }
             }
         }
     }
     foreach ($this->cases as $case) {
         if ($case->isInFulfillment()) {
             return false;
         }
         if ($case->shouldAdjustRequest()) {
             if ($case->shouldStoreRequestTarget()) {
                 $this->storeRequest();
             }
             $case->adjust();
             return true;
         }
     }
     return false;
 }
 public function build()
 {
     $this->setFormAction($this->ctrl->getFormAction($this->questionSetConfigGUI));
     $this->setTitle($this->lng->txt('tst_rnd_quest_set_cfg_general_form'));
     $this->setId('tstRndQuestSetCfgGeneralForm');
     $this->addCommandButton(ilTestRandomQuestionSetConfigGUI::CMD_SAVE_GENERAL_CONFIG_FORM, $this->lng->txt('save'));
     // Require Pools with Homogeneous Scored Questions
     $requirePoolsQuestionsHomoScored = new ilCheckboxInputGUI($this->lng->txt('tst_inp_all_quest_points_equal_per_pool'), 'quest_points_equal_per_pool');
     $requirePoolsQuestionsHomoScored->setInfo($this->lng->txt('tst_inp_all_quest_points_equal_per_pool_desc'));
     $requirePoolsQuestionsHomoScored->setChecked($this->questionSetConfig->arePoolsWithHomogeneousScoredQuestionsRequired());
     $this->addItem($requirePoolsQuestionsHomoScored);
     // question amount config mode (per test / per pool)
     $questionAmountConfigMode = new ilRadioGroupInputGUI($this->lng->txt('tst_inp_quest_amount_cfg_mode'), 'quest_amount_cfg_mode');
     $questionAmountConfigMode->setValue($this->fetchValidQuestionAmountConfigModeWithFallbackModePerTest($this->questionSetConfig));
     $questionAmountConfigModePerTest = new ilRadioOption($this->lng->txt('tst_inp_quest_amount_cfg_mode_test'), ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_TEST);
     $questionAmountConfigMode->addOption($questionAmountConfigModePerTest);
     $questionAmountConfigModePerPool = new ilRadioOption($this->lng->txt('tst_inp_quest_amount_cfg_mode_pool'), ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_POOL);
     $questionAmountConfigMode->addOption($questionAmountConfigModePerPool);
     $questionAmountConfigMode->setRequired(true);
     $this->addItem($questionAmountConfigMode);
     // question amount per test
     $questionAmountPerTest = new ilNumberInputGUI($this->lng->txt('tst_inp_quest_amount_per_test'), 'quest_amount_per_test');
     $questionAmountPerTest->setRequired(true);
     $questionAmountPerTest->setMinValue(0);
     $questionAmountPerTest->allowDecimals(false);
     $questionAmountPerTest->setMinvalueShouldBeGreater(true);
     $questionAmountPerTest->setSize(4);
     $questionAmountPerTest->setValue($this->questionSetConfig->getQuestionAmountPerTest());
     $questionAmountConfigModePerTest->addSubItem($questionAmountPerTest);
     if ($this->testOBJ->participantDataExist()) {
         $requirePoolsQuestionsHomoScored->setDisabled(true);
         $questionAmountConfigMode->setDisabled(true);
         $questionAmountPerTest->setDisabled(true);
     }
 }
 public function build()
 {
     $this->setFormAction($this->ctrl->getFormAction($this->parentGUI));
     $select = new ilSelectInputGUI($this->lng->txt("tst_analysis"), self::SKILL_PROFILE_PARAM);
     $select->setOptions($this->buildEvaluationModeOptionsArray());
     $select->setValue($this->getSelectedEvaluationMode());
     $this->addInputItem($select, true);
     $this->addFormButton($this->lng->txt("select"), $this->parentCMD);
 }
 private function showCmd()
 {
     $selectedSkillProfile = ilTestSkillEvaluationToolbarGUI::fetchSkillProfileParam($_POST);
     $testSession = $this->testSessionFactory->getSession();
     $this->skillEvaluation->init()->evaluate($testSession->getActiveId(), $testSession->getLastFinishedPass(), $testSession->getUserId());
     $evaluationToolbarGUI = $this->buildEvaluationToolbarGUI($testSession->getUserId(), $selectedSkillProfile);
     $personalSkillsGUI = $this->buildPersonalSkillsGUI($testSession->getUserId(), $selectedSkillProfile);
     $this->tpl->setContent($this->ctrl->getHTML($evaluationToolbarGUI) . $this->ctrl->getHTML($personalSkillsGUI));
 }
 /**
  * Constructor
  * 
  * @access public
  * @param assQuestion $questionOBJ
  * @param ilCtrl $ctrl
  * @param ilTabsGUI $tabs
  * @param ilLanguage $lng
  */
 public function __construct(assQuestion $questionOBJ, ilCtrl $ctrl, ilTabsGUI $tabs, ilLanguage $lng)
 {
     $this->questionOBJ = $questionOBJ;
     $this->ctrl = $ctrl;
     $this->tabs = $tabs;
     $this->lng = $lng;
     $this->tabs->clearTargets();
     $this->lng->loadLanguageModule('content');
 }
 public function manageTabs($activeSubTabId)
 {
     $link = $this->ctrl->getLinkTargetByClass('iltestskillquestionassignmentsgui', ilTestSkillQuestionAssignmentsGUI::CMD_SHOW_SKILL_QUEST_ASSIGNS);
     $this->tabs->addSubTab('iltestskillquestionassignmentsgui', $this->lng->txt('tst_skl_sub_tab_quest_assign'), $link);
     $link = $this->ctrl->getLinkTargetByClass('iltestskilllevelthresholdsgui', ilTestSkillLevelThresholdsGUI::CMD_SHOW_SKILL_THRESHOLDS);
     $this->tabs->addSubTab('iltestskilllevelthresholdsgui', $this->lng->txt('tst_skl_sub_tab_thresholds'), $link);
     $this->tabs->activateTab('tst_tab_competences');
     $this->tabs->activateSubTab($activeSubTabId);
 }
 public function build()
 {
     $availablePools = $this->testOBJ->getAvailableQuestionpools(true, $this->questionSetConfig->arePoolsWithHomogeneousScoredQuestionsRequired(), false, true, true);
     require_once 'Services/Form/classes/class.ilSelectInputGUI.php';
     $poolSelection = new ilSelectInputGUI(null, 'quest_pool_id');
     $poolSelection->setOptions($this->buildSourcePoolSelectOptionsArray($availablePools));
     $this->addInputItem($poolSelection, true);
     $this->setFormAction($this->ctrl->getFormAction($this->questionSetConfigGUI));
     $this->addFormButton($this->lng->txt('tst_rnd_quest_set_tb_add_pool_btn'), ilTestRandomQuestionSetConfigGUI::CMD_SHOW_CREATE_SRC_POOL_DEF_FORM);
 }
 /**
  * @param ilCertificateConfigGUI $parent_gui
  */
 public function __construct(ilCertificateConfigGUI $parent_gui)
 {
     global $ilCtrl, $lng;
     $this->parent_gui = $parent_gui;
     $this->ctrl = $ilCtrl;
     $this->lng = $lng;
     $this->pl = ilCertificatePlugin::getInstance();
     $this->setFormAction($this->ctrl->getFormAction($this->parent_gui));
     $this->initForm();
 }
 /**
  * @param $parent_gui
  */
 public function __construct($parent_gui)
 {
     global $ilCtrl, $lng;
     $this->parent_gui = $parent_gui;
     $this->ctrl = $ilCtrl;
     $this->lng = $lng;
     $this->ctrl->saveParameter($parent_gui, 'clip_ext_id');
     $this->setFormAction($this->ctrl->getFormAction($parent_gui));
     $this->initForm();
 }
 /**
  * Save config
  */
 public function save()
 {
     $form = new ilCertificateConfigFormGUI($this);
     if ($form->saveObject()) {
         ilUtil::sendSuccess($this->pl->txt('msg_save_config'), true);
         $this->ctrl->redirect($this, 'configure');
     } else {
         $form->setValuesByPost();
         $this->tpl->setContent($form->getHTML());
     }
 }
 private function showSkillThresholdsCmd()
 {
     $table = $this->buildTableGUI();
     $skillLevelThresholdList = $this->buildSkillLevelThresholdList();
     $skillLevelThresholdList->loadFromDb();
     $table->setSkillLevelThresholdList($skillLevelThresholdList);
     $assignmentList = $this->buildSkillQuestionAssignmentList();
     $assignmentList->loadFromDb();
     $table->setData($assignmentList->getUniqueAssignedSkills());
     $this->tpl->setContent($this->ctrl->getHTML($table));
 }
 /**
  * Add all fields to the form
  */
 protected function initForm()
 {
     $this->setFormAction($this->ctrl->getFormAction($this->parent_gui));
     $this->setTitle($this->lng->txt('orgu_type_custom_icon'));
     $item = new ilImageFileInputGUI($this->lng->txt('icon') . ' 32x32 px', 'icon');
     $item->setSuffixes(array('svg'));
     $item->setInfo($this->lng->txt('orgu_type_custom_icon_info'));
     if (is_file($this->type->getIconPath(true))) {
         $item->setImage($this->type->getIconPath(true));
     }
     $this->addItem($item);
     $this->addCommandButton('updateCustomIcons', $this->lng->txt('save'));
 }
 /**
  * Get administration tabs
  * @param ilTabsGUI $tabs_gui
  */
 public function getAdminTabs(ilTabsGUI $tabs_gui)
 {
     /**
      * @var $rbacsystem ilRbacSystem
      */
     global $rbacsystem;
     if ($rbacsystem->checkAccess('read', $this->object->getRefId())) {
         $tabs_gui->addTarget('overview', $this->ctrl->getLinkTarget($this, 'overview'));
     }
     if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
         $tabs_gui->addTarget('perm_settings', $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilpermissiongui'), 'perm'), array('perm', 'info', 'owner'), 'ilpermissiongui');
     }
 }
 public function __construct($parentOBJ, $parentCmd, ilCtrl $ctrl, ilLanguage $lng)
 {
     parent::__construct($parentOBJ, $parentCmd);
     $this->lng = $lng;
     $this->ctrl = $ctrl;
     $this->setStyle('table', 'fullwidth');
     $this->setRowTemplate("tpl.tst_skl_thresholds_row.html", "Modules/Test");
     $this->enable('header');
     $this->disable('sort');
     $this->disable('select_all');
     $this->initColumns();
     $this->setFormAction($ctrl->getFormAction($parentOBJ));
     $this->addCommandButton(ilTestSkillLevelThresholdsGUI::CMD_SAVE_SKILL_THRESHOLDS, $this->lng->txt('tst_save_thresholds'));
 }
 /**
  * forward method
  */
 public function forward()
 {
     $this->tabs->setTabActive('settings');
     $this->lng->loadLanguageModule('tax');
     require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
     $questionList = new ilAssQuestionList($this->db, $this->lng, $this->pluginAdmin, $this->poolOBJ->getId());
     $questionList->load();
     require_once 'Services/Taxonomy/classes/class.ilObjTaxonomyGUI.php';
     $taxGUI = new ilObjTaxonomyGUI();
     $taxGUI->setAssignedObject($this->poolOBJ->getId());
     $taxGUI->setMultiple(true);
     $taxGUI->activateAssignedItemSorting($questionList, 'qpl', $this->poolOBJ->getId(), 'quest');
     $this->ctrl->forwardCommand($taxGUI);
 }
 /**
  * Pass data to row template
  *
  * @param array $set
  */
 public function fillRow($set)
 {
     $this->tpl->setVariable('TITLE', $set['title']);
     $this->tpl->setVariable('DESCRIPTION', $set['description']);
     $this->tpl->setVariable('DEFAULT_LANG', $set['default_language']);
     $this->tpl->setVariable('ICON', $set['icon']);
     $this->ctrl->setParameterByClass("ilorgunittypegui", "type_id", $set['id']);
     $selection = new ilAdvancedSelectionListGUI();
     $selection->setListTitle($this->lng->txt('Actions'));
     $selection->setId('action_orgu_type' . $set['id']);
     $selection->addItem($this->lng->txt('edit'), 'edit', $this->ctrl->getLinkTargetByClass('ilorgunittypegui', 'edit'));
     $selection->addItem($this->lng->txt('delete'), 'delete', $this->ctrl->getLinkTargetByClass('ilorgunittypegui', 'delete'));
     $this->tpl->setVariable('ACTIONS', $selection->getHTML());
 }
 public function executeCommand()
 {
     if ($this->isAccessDenied()) {
         $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
     }
     $nextClass = $this->ctrl->getNextClass();
     $this->manageTabs($nextClass);
     switch ($nextClass) {
         case 'ilassquestionskillassignmentsgui':
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
             $questionList = new ilAssQuestionList($this->db, $this->lng, $this->pluginAdmin);
             $questionList->setParentObjId($this->poolOBJ->getId());
             $questionList->setQuestionInstanceTypeFilter(ilAssQuestionList::QUESTION_INSTANCE_TYPE_ORIGINALS);
             $questionList->load();
             $gui = new ilAssQuestionSkillAssignmentsGUI($this->ctrl, $this->access, $this->tpl, $this->lng, $this->db);
             $gui->setAssignmentEditingEnabled(true);
             $gui->setQuestionContainerId($this->poolOBJ->getId());
             $gui->setQuestionList($questionList);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilassquestionskillusagestablegui':
             $gui = new ilAssQuestionSkillUsagesTableGUI($this->ctrl, $this->tpl, $this->lng, $this->db, $this->poolOBJ->getId());
             $this->ctrl->forwardCommand($gui);
             break;
     }
 }
 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->setTitle($this->lng->txt('qpl_form_general_settings'));
     $form->setId('properties');
     // online
     $online = new ilCheckboxInputGUI($this->lng->txt('qpl_settings_general_form_property_online'), 'online');
     $online->setInfo($this->lng->txt('qpl_settings_general_form_property_online_description'));
     $online->setChecked($this->poolOBJ->getOnline());
     $form->addItem($online);
     // show taxonomies
     $showTax = new ilCheckboxInputGUI($this->lng->txt('qpl_settings_general_form_property_show_taxonomies'), 'show_taxonomies');
     $showTax->setInfo($this->lng->txt('qpl_settings_general_form_prop_show_tax_desc'));
     $showTax->setChecked($this->poolOBJ->getShowTaxonomies());
     $form->addItem($showTax);
     $taxSelectOptions = $this->getTaxonomySelectInputOptions();
     // pool navigation taxonomy
     $navTax = new ilSelectInputGUI($this->lng->txt('qpl_settings_general_form_property_nav_taxonomy'), 'nav_taxonomy');
     $navTax->setInfo($this->lng->txt('qpl_settings_general_form_property_nav_taxonomy_description'));
     $navTax->setValue($this->poolOBJ->getNavTaxonomyId());
     $navTax->setOptions($taxSelectOptions);
     $showTax->addSubItem($navTax);
     // skill service activation
     if (ilObjQuestionPool::isSkillManagementGloballyActivated()) {
         $skillService = new ilCheckboxInputGUI($this->lng->txt('tst_activate_skill_service'), 'skill_service');
         $skillService->setChecked($this->poolOBJ->isSkillServiceEnabled());
         $form->addItem($skillService);
     }
     return $form;
 }
 public function startImport()
 {
     $form = $this->initForm("startImport");
     if (!$form->checkInput()) {
         $this->tpl->setContent($form->getHTML());
     } else {
         $file = $form->getInput("import_file");
         $importer = new ilOrgUnitSimpleImport();
         try {
             $file_path = $file["tmp_name"];
             $file_type = pathinfo($file["name"], PATHINFO_EXTENSION);
             $file_name = pathinfo($file["name"], PATHINFO_FILENAME);
             if ($file_type == "zip") {
                 $extract_path = $file_path . '_extracted/';
                 $extracted_file = $extract_path . $file_name . '/manifest.xml';
                 $zip = new ZipArchive();
                 $res = $zip->open($file_path);
                 if ($res === true) {
                     $zip->extractTo($extract_path);
                     $zip->close();
                     if (file_exists($extracted_file)) {
                         $file_path = $extracted_file;
                     }
                 }
             }
             $importer->simpleImport($file_path);
         } catch (Exception $e) {
             $this->ilLog->write($e->getMessage() . " - " . $e->getTraceAsString());
             ilUtil::sendFailure($this->lng->txt("import_failed"), true);
             $this->ctrl->redirect($this, "render");
         }
         $this->displayImportResults($importer);
     }
 }
 public function __construct($parentOBJ, $parentCmd, ilCtrl $ctrl, ilLanguage $lng)
 {
     parent::__construct($parentOBJ, $parentCmd);
     $this->lng = $lng;
     $this->ctrl = $ctrl;
     $this->setId('assQstSkl');
     $this->getPrefix('assQstSkl');
     $this->setStyle('table', 'fullwidth');
     $this->setRowTemplate("tpl.tst_skl_qst_assignment_row.html", "Modules/Test");
     $this->enable('header');
     $this->disable('sort');
     $this->disable('select_all');
     $this->initColumns();
     $this->setFormAction($ctrl->getFormAction($parentOBJ));
     $this->addCommandButton(ilTestSkillQuestionAssignmentsGUI::CMD_SAVE_SKILL_POINTS, $this->lng->txt('tst_save_comp_points'));
 }
 function __showRolesTable($a_result_set, $a_from = "")
 {
     if (!$this->ilAccess->checkAccess("cat_administrate_users", "", $_GET["ref_id"])) {
         ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
         $this->ctrl->redirect($this, "");
     }
     $tbl =& $this->parent_gui->__initTableGUI();
     $tpl =& $tbl->getTemplateObject();
     // SET FORMAACTION
     $tpl->setCurrentBlock("tbl_form_header");
     $this->ctrl->setParameter($this, 'obj_id', $_GET['obj_id']);
     $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
     $tpl->parseCurrentBlock();
     // SET FOOTER BUTTONS
     $tpl->setVariable("COLUMN_COUNTS", 4);
     $tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.svg"));
     $tpl->setCurrentBlock("tbl_action_button");
     $tpl->setVariable("BTN_NAME", "assignSave");
     $tpl->setVariable("BTN_VALUE", $this->lng->txt("change_assignment"));
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("tbl_action_row");
     $tpl->setVariable("TPLPATH", $this->tpl->tplPath);
     $tpl->parseCurrentBlock();
     $tmp_obj =& ilObjectFactory::getInstanceByObjId($_GET['obj_id']);
     $title = $this->lng->txt('role_assignment') . ' (' . $tmp_obj->getFullname() . ')';
     $tbl->setTitle($title, "icon_role.svg", $this->lng->txt("role_assignment"));
     $tbl->setHeaderNames(array('', $this->lng->txt("title"), $this->lng->txt('description'), $this->lng->txt("type")));
     $tbl->setHeaderVars(array("", "title", "description", "type"), array("ref_id" => $this->object->getRefId(), "cmd" => "assignRoles", "obj_id" => $_GET['obj_id'], "cmdClass" => "ilobjcategorygui", "cmdNode" => $_GET["cmdNode"]));
     $tbl->setColumnWidth(array("4%", "35%", "45%", "16%"));
     $this->set_unlimited = true;
     $this->parent_gui->__setTableGUIBasicData($tbl, $a_result_set, $a_from, true);
     $tbl->render();
     $this->tpl->setVariable("ROLES_TABLE", $tbl->tpl->get());
     return true;
 }
 public function showAttachments()
 {
     /**
      * @var $ilToolbar ilToolbarGUI
      */
     global $ilToolbar;
     $this->tpl->setTitle($this->lng->txt('mail'));
     require_once 'Services/Form/classes/class.ilFileInputGUI.php';
     $attachment = new ilFileInputGUI($this->lng->txt('upload'), 'userfile');
     $attachment->setRequired(true);
     $attachment->setSize(20);
     $ilToolbar->setFormAction($this->ctrl->getFormAction($this, 'uploadFile'), true);
     $ilToolbar->addInputItem($attachment);
     $ilToolbar->addFormButton($this->lng->txt('upload'), 'uploadFile');
     require_once 'Services/Mail/classes/class.ilMailAttachmentTableGUI.php';
     $table = new ilMailAttachmentTableGUI($this, 'showAttachments');
     $mailData = $this->umail->getSavedData();
     $files = $this->mfile->getUserFilesData();
     $data = array();
     $counter = 0;
     foreach ($files as $file) {
         $checked = false;
         if (is_array($mailData['attachments']) && in_array($file['name'], $mailData['attachments'])) {
             $checked = true;
         }
         $data[$counter] = array('checked' => $checked, 'filename' => $file['name'], 'filesize' => (int) $file['size'], 'filecreatedate' => (int) $file['ctime']);
         ++$counter;
     }
     $table->setData($data);
     $this->tpl->setContent($table->getHtml());
     $this->tpl->show();
 }