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);
     }
 }
 /**
  * @param        $a_parent_obj
  * @param string $a_parent_cmd
  * @param string $template_context
  * @param int    $ref_id
  * @param bool   $is_moderator
  * @param string $overview_setting
  */
 public function __construct($a_parent_obj, $a_parent_cmd = '', $template_context = '', $ref_id = 0, $topicData = array(), $is_moderator = false, $overview_setting = '')
 {
     /**
      * @var $ilCtrl ilCtrl
      * @var $lng    ilLanguage
      * @var $tpl    ilTemplate
      */
     global $ilCtrl, $lng, $tpl;
     $this->lng = $lng;
     $this->ctrl = $ilCtrl;
     $this->setIsModerator($is_moderator);
     $this->setOverviewSetting($overview_setting);
     $this->setRefId($ref_id);
     $this->setTopicData($topicData);
     // Call this immediately in constructor
     $this->setId('il_frm_thread_table_' . $this->getRefId());
     $this->setPrefix('frm_threads');
     // Let the database do the work
     $this->setDefaultOrderDirection('DESC');
     $this->setDefaultOrderField('is_sticky');
     $this->setExternalSorting(true);
     $this->setExternalSegmentation(true);
     parent::__construct($a_parent_obj, $a_parent_cmd, $template_context);
     // Add global css for table styles
     $tpl->addCss('./Modules/Forum/css/forum_table.css');
     // Columns
     $this->addColumn('', 'check', '1px', true);
     $this->addColumn($this->lng->txt('forums_thread'), 'th_title');
     $this->addColumn($this->lng->txt('forums_created_by'), 'author');
     $this->addColumn($this->lng->txt('forums_articles'), 'num_posts');
     $this->addColumn($this->lng->txt('visits'), 'num_visit');
     $this->addColumn($this->lng->txt('forums_last_post'), 'lp_date');
     // Disable sorting
     $this->disable('sort');
     $this->setSelectAllCheckbox('thread_ids');
     // Default Form Action
     $this->setFormAction($this->ctrl->getFormAction($this->getParentObject(), 'showThreads'));
     // Row template
     $this->setRowTemplate('tpl.forums_threads_table.html', 'Modules/Forum');
     // Multi commands
     $this->addMultiCommand('', $this->lng->txt('please_choose'));
     if ($this->ilias->getSetting('forum_notification') == 1) {
         $this->addMultiCommand('enable_notifications', $this->lng->txt('forums_enable_notification'));
         $this->addMultiCommand('disable_notifications', $this->lng->txt('forums_disable_notification'));
     }
     if ($this->getIsModerator()) {
         $this->addMultiCommand('makesticky', $this->lng->txt('make_topics_sticky'));
         $this->addMultiCommand('unmakesticky', $this->lng->txt('make_topics_non_sticky'));
         $this->addMultiCommand('editThread', $this->lng->txt('frm_edit_title'));
         $this->addMultiCommand('close', $this->lng->txt('close_topics'));
         $this->addMultiCommand('reopen', $this->lng->txt('reopen_topics'));
         $this->addMultiCommand('move', $this->lng->txt('move'));
     }
     $this->addMultiCommand('html', $this->lng->txt('export_html'));
     if ($this->getIsModerator()) {
         $this->addMultiCommand('confirmDeleteThreads', $this->lng->txt('delete'));
     }
     $this->setShowRowsSelector(true);
     $this->setRowSelectorLabel($this->lng->txt('number_of_threads'));
 }
 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);
     }
 }
 /**
  * @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');
 }
 /**
  * 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'));
 }
 /**
  * Options array can contain the following key/value pairs
  * - show_filter : True if filtering data is possible
  * - columns : Array of columns to display
  * - definition_id: ID of a definition  -> shows certificates only from this definition
  * - user_id: ID of a user -> shows certificates only from the given user
  * - newest_version_only : True to display the newest versions of certificates only
  * - actions : Array of possible actions, currently possible: atm array('download')
  * - actions_multi: Array of possible multi-actions, atm: array('download_zip')
  *
  * @param $a_parent_obj
  * @param string $a_parent_cmd
  * @param array $options
  */
 public function __construct($a_parent_obj, $a_parent_cmd = "", array $options = array())
 {
     global $ilCtrl, $ilUser;
     $_options = array('show_filter' => true, 'columns' => self::$default_columns, 'definition_id' => 0, 'user_id' => 0, 'newest_version_only' => true, 'actions' => array('download'), 'actions_multi' => array('download_zip'), 'build_data' => true);
     $this->options = array_merge($_options, $options);
     $this->setPrefix('cert_');
     $this->setId($this->getOption('user_id') . '_' . $this->getOption('definition_id'));
     $this->columns = $this->getOption('columns');
     $this->pl = ilCertificatePlugin::getInstance();
     $this->ctrl = $ilCtrl;
     $this->user = $ilUser;
     $this->setShowRowsSelector(true);
     parent::__construct($a_parent_obj, $a_parent_cmd, "");
     $this->setRowTemplate('tpl.cert_row.html', $this->pl->getDirectory());
     $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
     $this->addColumns();
     $this->setExportFormats(array(self::EXPORT_EXCEL));
     if ($this->getOption('show_filter')) {
         $this->initFilter();
     }
     if ($this->getOption('build_data')) {
         $this->buildData();
     }
     if ($this->has_any_certs && count($this->getOption('actions_multi'))) {
         $this->setSelectAllCheckbox("cert_id[]");
         $this->addMultiCommand("downloadCertificates", $this->pl->txt('download_zip'));
     }
 }
 /**
  * @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();
 }
 /**
  * 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 ilUDFCheckGUI $parent_obj
  * @param string        $parent_cmd
  * @param string        $template_context
  */
 public function __construct(ilUDFCheckGUI $parent_obj, $parent_cmd = ilUDFCheckGUI::CMD_INDEX, $template_context = "")
 {
     /**
      * @var              $ilCtrl ilCtrl
      * @var ilToolbarGUI $ilToolbar
      */
     global $ilCtrl, $ilToolbar;
     $this->ctrl = $ilCtrl;
     $this->pl = ilUserDefaultsPlugin::getInstance();
     $this->toolbar = $ilToolbar;
     $this->setPrefix(self::USR_DEF_CONTENT);
     $this->setFormName(self::USR_DEF_CONTENT);
     $this->setId(self::USR_DEF_CONTENT);
     $this->setTitle($this->pl->txt('check_table_title'));
     parent::__construct($parent_obj, $parent_cmd, $template_context);
     $this->ctrl->saveParameter($parent_obj, $this->getNavParameter());
     $this->setEnableNumInfo(true);
     $this->setFormAction($this->ctrl->getFormAction($parent_obj));
     $this->addColumns();
     $this->setDefaultOrderField('title');
     $this->setExternalSorting(true);
     $this->setExternalSegmentation(true);
     $this->setRowTemplate('Customizing/global/plugins/Services/EventHandling/EventHook/UserDefaults/templates/default/tpl.settings_row.html');
     $this->parseData();
     $this->toolbar->addButton($this->pl->txt('check_back'), $this->ctrl->getLinkTargetByClass('ilUserSettingsGUI', ilUserSettingsGUI::CMD_INDEX));
     $this->toolbar->addButton($this->pl->txt('check_add'), $this->ctrl->getLinkTarget($parent_obj, ilUDFCheckGUI::CMD_ADD), '', '', '', '', 'submit emphsubmit');
 }
 public function build()
 {
     $this->setFormAction($this->ctrl->getFormAction($this->questionSetConfigGUI));
     if ($this->questionSetConfig->doesSelectableQuestionPoolsExist()) {
         $this->populateNewQuestionSelectionRuleInputs();
     }
 }
 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);
 }
 /**
  * @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();
 }
 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 $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();
 }
 /**
  * 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'));
 }
 public function __construct($parent_obj, $parent_cmd)
 {
     global $ilCtrl, $ilTabs, $lng;
     $this->ctrl = $ilCtrl;
     $this->tabs = $ilTabs;
     $this->lng = $lng;
     $this->setPrefix('orgu_types_table');
     $this->setId('orgu_types_table');
     parent::__construct($parent_obj, $parent_cmd);
     $this->setRowTemplate('tpl.types_row.html', 'Modules/OrgUnit');
     $this->initColumns();
     $this->addColumn($this->lng->txt('action'));
     $this->buildData();
     $this->setFormAction($this->ctrl->getFormAction($this->parent_obj));
 }
 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();
 }
 protected function initForm()
 {
     $this->setFormAction($this->ctrl->getFormAction($this->parent_gui));
     $this->setTitle($this->pl->txt('certificate_placeholders'));
     // Each placeholder can define values for each language defined in the type
     $languages = $this->definition->getType()->getLanguages();
     $label_lang = in_array($this->user->getLanguage(), $languages) ? $this->user->getLanguage() : $this->definition->getDefaultLanguage();
     /** @var $placeholder_value srCertificatePlaceholderValue */
     foreach ($this->definition->getPlaceholderValues() as $placeholder_value) {
         $section = new ilFormSectionHeaderGUI();
         $section->setTitle($placeholder_value->getPlaceholder()->getLabel($label_lang));
         $this->addItem($section);
         foreach ($languages as $lang) {
             $this->addItem($this->getInputField($placeholder_value, $lang));
         }
     }
     if ($signatures = $this->definition->getType()->getSignatures()) {
         $section = new ilFormSectionHeaderGUI();
         $section->setTitle($this->pl->txt('signature'));
         $this->addItem($section);
         $select_input = new ilSelectInputGUI($this->pl->txt('signature'), 'signature');
         $options = array(0 => '');
         foreach ($signatures as $signature) {
             $options[$signature->getId()] = $signature->getFirstName() . ' ' . $signature->getLastName();
         }
         $select_input->setOptions($options);
         $select_input->setValue($this->definition->getSignatureId());
         $this->addItem($select_input);
     }
     $this->addCommandButton('updatePlaceholders', $this->pl->txt('save'));
     return;
 }
 /**
  * @return ilPropertyFormGUI
  */
 protected function getEctsForm()
 {
     require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, 'saveEctsForm'));
     $form->addCommandButton('saveEctsForm', $this->lng->txt('save'));
     $form->setTitle($this->lng->txt('ects_output_of_ects_grades'));
     $allow_ects_marks = new ilCheckboxInputGUI($this->lng->txt('ects_allow_ects_grades'), 'ectcs_status');
     for ($i = ord('a'); $i <= ord('e'); $i++) {
         $mark = chr($i);
         $mark_step = new ilNumberInputGUI(chr($i - 32) . ' - ' . $this->lng->txt('ects_grade_' . $mark . '_short'), 'ects_grade_' . $mark);
         $mark_step->setSize(5);
         $mark_step->allowDecimals(true);
         $mark_step->setMinValue(0, true);
         $mark_step->setMaxValue(100, true);
         $mark_step->setSuffix($this->lng->txt('percentile'));
         $mark_step->setRequired(true);
         $allow_ects_marks->addSubItem($mark_step);
     }
     $use_ects_fx = new ilCheckboxInputGUI($this->lng->txt('use_ects_fx'), 'use_ects_fx');
     $threshold = new ilNumberInputGUI($this->lng->txt('ects_fx_threshold'), 'ects_fx_threshold');
     $threshold->setInfo($this->lng->txt('ects_fx_threshold_info'));
     $threshold->setSuffix($this->lng->txt('percentile'));
     $threshold->allowDecimals(true);
     $threshold->setSize(5);
     $threshold->setRequired(true);
     $use_ects_fx->addSubItem($threshold);
     $allow_ects_marks->addSubItem($use_ects_fx);
     $form->addItem($allow_ects_marks);
     return $form;
 }
 /**
  * @param $parent_gui
  * @param srCertificateCustomTypeSetting $setting
  */
 public function __construct($parent_gui, srCertificateCustomTypeSetting $setting)
 {
     global $tpl, $ilCtrl, $lng, $rbacreview, $ilUser;
     $this->parent_gui = $parent_gui;
     $this->tpl = $tpl;
     $this->ctrl = $ilCtrl;
     $this->lng = $lng;
     $this->rbac = $rbacreview;
     $this->user = $ilUser;
     $this->setting = $setting;
     $this->pl = ilCertificatePlugin::getInstance();
     $this->lng->loadLanguageModule('meta');
     $this->setFormAction($this->ctrl->getFormAction($parent_gui));
     $this->addCommandButton('saveCustomSetting', $this->lng->txt('save'));
     $this->initForm();
 }
 private function showPasswordFormCmd()
 {
     require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     require_once 'Services/Form/classes/class.ilPasswordInputGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->lng->txt("tst_password_form"));
     $form->setDescription($this->lng->txt("tst_password_introduction"));
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->addCommandButton(self::CMD_SAVE_ENTERED_PASSWORD, $this->lng->txt("submit"));
     $form->addCommandButton(self::CMD_BACK_TO_INFO_SCREEN, $this->lng->txt("cancel"));
     $inp = new ilPasswordInputGUI($this->lng->txt("tst_password"), 'password');
     $inp->setRequired(true);
     $inp->setRetype(false);
     $form->addItem($inp);
     $this->tpl->setVariable($this->parentGUI->getContentBlockName(), $this->ctrl->getHTML($form));
 }
 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;
 }
 /**
  * @param $a_parent_obj
  * @param string $a_parent_cmd
  * @param srCertificateType $type
  */
 public function __construct($a_parent_obj, $a_parent_cmd, srCertificateType $type)
 {
     global $ilCtrl;
     $this->type = $type;
     $this->setPrefix('cert_type_custom_settings');
     $this->setId($type->getId());
     parent::__construct($a_parent_obj, $a_parent_cmd);
     $this->pl = ilCertificatePlugin::getInstance();
     $this->ctrl = $ilCtrl;
     $this->setRowTemplate('tpl.type_custom_settings_row.html', $this->pl->getDirectory());
     $this->initColumns();
     $this->addColumn($this->pl->txt('actions'));
     $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
     $this->setTitle($this->pl->txt('custom_settings'));
     $this->buildData();
 }
 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;
 }
 /**
  * builds the question set config form and initialises the fields
  * with the config currently saved in database
  * 
  * @return ilPropertyFormGUI $form
  */
 private function buildForm()
 {
     $this->questionSetConfig->loadFromDb($this->testOBJ->getTestId());
     require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setId("tst_form_dynamic_question_set_config");
     $form->setTitle($this->lng->txt('tst_form_dynamic_question_set_config'));
     $form->setTableWidth("100%");
     $hiddenInputTaxSelectOptAsyncUrl = new ilHiddenInputGUI('taxSelectOptAsyncUrl');
     $hiddenInputTaxSelectOptAsyncUrl->setValue($this->ctrl->getLinkTarget($this, self::CMD_GET_TAXONOMY_OPTIONS_ASYNC, '', true));
     $form->addItem($hiddenInputTaxSelectOptAsyncUrl);
     if ($this->testOBJ->participantDataExist()) {
         $pool = new ilNonEditableValueGUI($this->lng->txt('tst_input_dynamic_question_set_source_questionpool'), 'source_qpl_title');
         $pool->setValue($this->questionSetConfig->getSourceQuestionPoolSummaryString($this->lng, $this->tree));
         $pool->setDisabled(true);
         $form->addItem($pool);
     } else {
         $poolInput = new ilSelectInputGUI($this->lng->txt('tst_input_dynamic_question_set_source_questionpool'), 'source_qpl_id');
         $poolInput->setOptions($this->buildQuestionPoolSelectInputOptionArray($this->testOBJ->getAvailableQuestionpools(true, false, false, true, true)));
         $poolInput->setValue($this->questionSetConfig->getSourceQuestionPoolId());
         $poolInput->setRequired(true);
         $form->addItem($poolInput);
     }
     $questionOderingInput = new ilRadioGroupInputGUI($this->lng->txt('tst_input_dynamic_question_set_question_ordering'), 'question_ordering');
     $questionOderingInput->setValue($this->questionSetConfig->getOrderingTaxonomyId() ? self::QUESTION_ORDERING_TYPE_TAXONOMY : self::QUESTION_ORDERING_TYPE_UPDATE_DATE);
     $optionOrderByDate = new ilRadioOption($this->lng->txt('tst_input_dynamic_question_set_question_ordering_by_date'), self::QUESTION_ORDERING_TYPE_UPDATE_DATE, $this->lng->txt('tst_inp_dyn_quest_set_quest_ordering_by_date_desc'));
     $questionOderingInput->addOption($optionOrderByDate);
     $optionOrderByTax = new ilRadioOption($this->lng->txt('tst_input_dynamic_question_set_question_ordering_by_tax'), self::QUESTION_ORDERING_TYPE_TAXONOMY, $this->lng->txt('tst_inp_dyn_quest_set_quest_ordering_by_tax_desc'));
     $orderTaxInput = new ilSelectInputGUI($this->lng->txt('tst_input_dynamic_question_set_ordering_tax'), 'ordering_tax');
     $orderTaxInput->setInfo($this->lng->txt('tst_input_dynamic_question_set_ordering_tax_description'));
     $orderTaxInput->setValue($this->questionSetConfig->getOrderingTaxonomyId());
     $orderTaxInput->setRequired(true);
     $orderTaxInput->setOptions($this->buildTaxonomySelectInputOptionArray($this->questionSetConfig->getSourceQuestionPoolId()));
     $optionOrderByTax->addSubItem($orderTaxInput);
     $questionOderingInput->addOption($optionOrderByTax);
     $form->addItem($questionOderingInput);
     $taxFilterInput = new ilCheckboxInputGUI($this->lng->txt('tst_input_dynamic_question_set_taxonomie_filter_enabled'), 'tax_filter_enabled');
     $taxFilterInput->setValue(1);
     $taxFilterInput->setChecked($this->questionSetConfig->isTaxonomyFilterEnabled());
     $form->addItem($taxFilterInput);
     $answStatusFilterInput = new ilCheckboxInputGUI($this->lng->txt('tst_input_dyn_quest_set_answer_status_filter_enabled'), 'answer_status_filter_enabled');
     $answStatusFilterInput->setValue(1);
     $answStatusFilterInput->setChecked($this->questionSetConfig->isAnswerStatusFilterEnabled());
     $form->addItem($answStatusFilterInput);
     $previousQuestionsListInput = new ilCheckboxInputGUI($this->lng->txt('tst_input_dyn_quest_set_prev_quest_list_enabled'), 'prev_quest_list_enabled');
     $previousQuestionsListInput->setValue(1);
     $previousQuestionsListInput->setChecked($this->questionSetConfig->isPreviousQuestionsListEnabled());
     $form->addItem($previousQuestionsListInput);
     if ($this->testOBJ->participantDataExist()) {
         $questionOderingInput->setDisabled(true);
         $taxFilterInput->setDisabled(true);
         $answStatusFilterInput->setDisabled(true);
         $previousQuestionsListInput->setDisabled(true);
     } else {
         $form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt('save'));
     }
     return $form;
 }
 public function build()
 {
     if ($this->isTestResultButtonEnabled()) {
         $link = ilLinkButton::getInstance();
         // always returns a new instance
         $link->setUrl($this->ctrl->getLinkTargetByClass('ilTestEvaluationGUI', 'outUserResultsOverview'));
         $link->setCaption($this->lng->txt("tst_show_results"), false);
         $this->addButtonInstance($link);
         $this->addSeparator();
     }
     $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);
 }
 /**
  * Initialize the form for editing advanced meta data
  *
  * @return ilPropertyFormGUI
  */
 protected function initAdvancedSettingsForm()
 {
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->addCommandButton('updateAdvancedSettings', $this->lng->txt('save'));
     $form->addCommandButton('editSettings', $this->lng->txt('cancel'));
     return $form;
 }
 public function confirmDelete()
 {
     $conf = new ilConfirmationGUI();
     $conf->setFormAction($this->ctrl->getFormAction($this));
     $conf->setHeaderText($this->pl->txt('msg_confirm_delete'));
     $conf->setConfirm($this->pl->txt('check_delete'), self::CMD_DELETE);
     $conf->setCancel($this->pl->txt('check_cancel'), self::CMD_INDEX);
     $this->tpl->setContent($conf->getHTML());
 }
 private function populatePreviewToolbar(ilTemplate $tpl)
 {
     require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewToolbarGUI.php';
     $toolbarGUI = new ilAssQuestionPreviewToolbarGUI($this->lng);
     $toolbarGUI->setFormAction($this->ctrl->getFormAction($this, self::CMD_SHOW));
     $toolbarGUI->setResetPreviewCmd(self::CMD_RESET);
     $toolbarGUI->build();
     $tpl->setVariable('PREVIEW_TOOLBAR', $this->ctrl->getHTML($toolbarGUI));
 }
 /**
  * @return ilToolbarGUI
  */
 private function buildSkillSelectorToolbarGUI()
 {
     require_once 'Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
     $skillSelectorToolbarGUI = new ilToolbarGUI();
     $skillSelectorToolbarGUI->setFormAction($this->ctrl->getFormAction($this));
     $skillSelectorToolbarGUI->addFormButton($this->lng->txt('qpl_save_skill_assigns_update'), self::CMD_UPDATE_SKILL_QUEST_ASSIGNS);
     $skillSelectorToolbarGUI->addFormButton($this->lng->txt('qpl_cancel_skill_assigns_update'), self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
     return $skillSelectorToolbarGUI;
 }