/** * 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')); */ } }
/** * @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 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 manageTabs($activeSubTabId) { $link = $this->ctrl->getLinkTargetByClass('ilAssQuestionSkillAssignmentsGUI', ilAssQuestionSkillAssignmentsGUI::CMD_SHOW_SKILL_QUEST_ASSIGNS); $this->tabs->addSubTab('ilassquestionskillassignmentsgui', $this->lng->txt('qpl_skl_sub_tab_quest_assign'), $link); $link = $this->ctrl->getLinkTargetByClass('ilAssQuestionSkillUsagesTableGUI', ilAssQuestionSkillUsagesTableGUI::CMD_SHOW); $this->tabs->addSubTab('ilassquestionskillusagestablegui', $this->lng->txt('qpl_skl_sub_tab_usages'), $link); $this->tabs->activateTab('qpl_tab_competences'); $this->tabs->activateSubTab($activeSubTabId); }
/** * Build action menu * * @param array $a_set * @return ilAdvancedSelectionListGUI */ protected function buildActionMenu(array $a_set) { $list = new ilAdvancedSelectionListGUI(); $list->setId($a_set['id']); $list->setListTitle($this->pl->txt('actions')); $this->ctrl->setParameterByClass('srcertificatetypegui', 'type_id', $this->type->getId()); $this->ctrl->setParameterByClass('srcertificatetypegui', 'custom_setting_id', $a_set['id']); $list->addItem($this->lng->txt('edit'), 'edit', $this->ctrl->getLinkTargetByClass('srcertificatetypegui', 'editCustomSetting')); $list->addItem($this->lng->txt('delete'), 'delete', $this->ctrl->getLinkTargetByClass('srcertificatetypegui', 'confirmDeleteCustomSetting')); $this->ctrl->clearParametersByClass('srcertificatetypegui'); return $list; }
/** * 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'); } }
/** * 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()); }
/** * @param array $a_set */ protected function fillRow(array $a_set) { // For checkboxes in first column if (count($this->getOption('actions_multi')) && $a_set['status'] == 3) { $this->tpl->setCurrentBlock('CHECKBOXES'); $this->tpl->setVariable('VALUE', $a_set['id']); $this->tpl->parseCurrentBlock(); } else { $this->tpl->setCurrentBlock('COL'); $this->tpl->setVariable('VALUE', ''); $this->tpl->parseCurrentBlock(); } $utc = ilCertificateConfig::get('time_format_utc'); $date_function = $utc ? 'gmdate' : 'date'; foreach ($this->columns as $k => $column) { $value = is_null($a_set[$column]) ? '' : $a_set[$column]; if ($this->isColumnSelected($column)) { // Format dates if (in_array($column, array('valid_from', 'valid_to')) && $value != '') { $time = strtotime($value); $time = $utc ? $time + srCertificate::TIME_ZONE_CORRECTION : $time; switch ($this->user->getDateFormat()) { case ilCalendarSettings::DATE_FORMAT_DMY: $value = $date_function('d.m.Y', $time); break; case ilCalendarSettings::DATE_FORMAT_MDY: $value = $date_function('m/d/Y', $time); break; } } elseif (in_array($column, array('valid_from', 'valid_to')) && $value == '') { $value = $this->pl->txt('unlimited'); } if ($column == 'status') { $value = $this->pl->txt("cert_status_" . (int) $value); } // Set value $this->tpl->setCurrentBlock('COL'); $this->tpl->setVariable('VALUE', $value); $this->tpl->parseCurrentBlock(); } } // Actions if (count($this->getOption('actions'))) { if ($this->hasAction($a_set)) { $this->ctrl->setParameterByClass(get_class($this->parent_obj), 'cert_id', $a_set['id']); $this->ctrl->setParameterByClass(get_class($this->parent_obj), 'status', $a_set['status']); $async_url = $this->ctrl->getLinkTargetByClass(array(ilCertificatePlugin::getBaseClass(), get_class($this->parent_obj)), 'buildActions', '', true); $actions = new ilAdvancedSelectionListGUI(); $actions->setId('action_list_' . $a_set['id']); $actions->setAsynchUrl($async_url); $actions->setAsynch(true); $actions->setListTitle($this->pl->txt('actions')); } else { $actions = ' '; } $this->tpl->setCurrentBlock('ACTIONS'); $this->tpl->setVariable('ACTIONS', is_string($actions) ? $actions : $actions->getHTML()); $this->tpl->parseCurrentBlock(); } }
/** * list fields */ public function listFields() { // Show tables require_once "./Modules/DataCollection/classes/class.ilDataCollectionTable.php"; $tables = $this->parent_obj->object->getTables(); foreach ($tables as $table) { $options[$table->getId()] = $table->getTitle(); } include_once './Services/Form/classes/class.ilSelectInputGUI.php'; $table_selection = new ilSelectInputGUI('', 'table_id'); $table_selection->setOptions($options); $table_selection->setValue($this->table_id); $this->toolbar->setFormAction($this->ctrl->getFormActionByClass("ilDataCollectionFieldListGUI", "doTableSwitch")); $this->toolbar->addText($this->lng->txt("dcl_table")); $this->toolbar->addInputItem($table_selection); $this->toolbar->addFormButton($this->lng->txt('change'), 'doTableSwitch'); $this->toolbar->addSeparator(); $this->toolbar->addButton($this->lng->txt("dcl_add_new_table"), $this->ctrl->getLinkTargetByClass("ildatacollectiontableeditgui", "create")); $this->toolbar->addSeparator(); $this->ctrl->setParameterByClass("ildatacollectiontableeditgui", "table_id", $this->table_id); $this->toolbar->addButton($this->lng->txt("dcl_table_settings"), $this->ctrl->getLinkTargetByClass("ildatacollectiontableeditgui", "edit")); $this->toolbar->addButton($this->lng->txt("dcl_delete_table"), $this->ctrl->getLinkTargetByClass("ildatacollectiontableeditgui", "confirmDelete")); $this->toolbar->addButton($this->lng->txt("dcl_add_new_field"), $this->ctrl->getLinkTargetByClass("ildatacollectionfieldeditgui", "create")); // requested not to implement this way... // $tpl->addJavaScript("Modules/DataCollection/js/fastTableSwitcher.js"); require_once './Modules/DataCollection/classes/class.ilDataCollectionFieldListTableGUI.php'; $list = new ilDataCollectionFieldListTableGUI($this, $this->ctrl->getCmd(), $this->table_id); $this->tpl->setContent($list->getHTML()); }
/** * @param $active_tab_id */ protected function setSubTabsSettings($active_tab_id) { $next_class = $this->ctrl->getNextClass($this); $cmd = $this->ctrl->getCmd(); $this->tabs_gui->addSubTab('edit_settings', $this->lng->txt('settings'), $this->ctrl->getLinkTarget($this, 'editSettings')); $this->tabs_gui->addSubTab("edit_translations", $this->lng->txt("obj_multilinguality"), $this->ctrl->getLinkTargetByClass("iltranslationgui", "editTranslations")); $ilOrgUnitType = $this->object->getOrgUnitType(); if ($ilOrgUnitType instanceof ilOrgUnitType) { if (count($ilOrgUnitType->getAssignedAdvancedMDRecords(true))) { $this->tabs_gui->addSubTab('edit_advanced_settings', $this->lng->txt('orgu_adv_settings'), $this->ctrl->getLinkTarget($this, 'editAdvancedSettings')); } } $this->tabs_gui->setSubTabActive($active_tab_id); switch ($next_class) { case 'iltranslationgui': $this->tabs_gui->setSubTabActive("edit_translations"); break; case '': switch ($cmd) { case 'editSettings': $this->tabs_gui->setSubTabActive('edit_settings'); break; case 'editAdvancedSettings': case 'updateAdvancedSettings': $this->tabs_gui->setSubTabActive('edit_advanced_settings'); break; } break; } return; }
public function build() { $this->setId('tst_results_toolbar'); if ($this->isSkillResultButtonEnabled()) { require_once 'Modules/Test/classes/class.ilTestSkillEvaluationGUI.php'; $link = ilLinkButton::getInstance(); // always returns a new instance $link->setUrl($this->ctrl->getLinkTargetByClass('ilTestSkillEvaluationGUI', ilTestSkillEvaluationGUI::CMD_SHOW)); $link->setCaption($this->lng->txt("tst_show_comp_results"), false); $this->addButtonInstance($link); $this->addSeparator(); } $this->addButton($this->lng->txt('print'), 'javascript:window.print();'); if (strlen($this->getPdfExportLinkTarget())) { require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php'; $link = ilLinkButton::getInstance(); // always returns a new instance $link->setUrl($this->getPdfExportLinkTarget()); $link->setCaption($this->getPdfExportLabel(), false); $link->setOmitPreventDoubleSubmission(true); $this->addButtonInstance($link); } if (strlen($this->getCertificateLinkTarget())) { $this->addButton($this->lng->txt('certificate'), $this->getCertificateLinkTarget()); } if (strlen($this->getShowBestSolutionsLinkTarget())) { $this->addSeparator(); $this->addButton($this->lng->txt('tst_btn_show_best_solutions'), $this->getShowBestSolutionsLinkTarget()); } elseif (strlen($this->getHideBestSolutionsLinkTarget())) { $this->addSeparator(); $this->addButton($this->lng->txt('tst_btn_hide_best_solutions'), $this->getHideBestSolutionsLinkTarget()); } if (count($this->getParticipantSelectorOptions())) { $this->addSeparator(); require_once 'Services/Form/classes/class.ilSelectInputGUI.php'; $sel = new ilSelectInputGUI('', 'active_id'); $sel->setOptions($this->getParticipantSelectorOptionsWithHintOption()); $this->addInputItem($sel); $link = ilLinkButton::getInstance(); // always returns a new instance $link->setUrl('#'); $link->setId('ilTestResultParticipantJumper'); $link->setCaption($this->lng->txt('tst_res_jump_to_participant_btn'), false); $this->addButtonInstance($link); $this->tpl->addJavaScript('Modules/Test/js/ilTestResultParticipantSelector.js'); } }
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); }
/** * Show table with settings */ public function showSettings() { $this->toolbar->addButton($this->pl->txt('add_new_custom_setting'), $this->ctrl->getLinkTargetByClass('srcertificatetypegui', 'addCustomSetting')); $table = new srCertificateTypeSettingsTableGUI($this, 'showSettings', $this->type); $table_custom_settings = new srCertificateTypeCustomSettingsTableGUI($this, 'showSettings', $this->type); $spacer = '<div style="height: 30px;"></div>'; $this->tpl->setContent($table->getHTML() . $spacer . $table_custom_settings->getHTML()); }
/** * returns a link to page object editor for page object * with given type and id * * @final * @access private * @param type $pageObjectType * @param type $pageObjectId * @return string $pageObjectEditingLink */ private final function getPageObjectEditingLink($pageObjectType, $pageObjectId) { $cl = $this->getClassNameByType($pageObjectType, true); $this->ctrl->setParameterByClass($cl, 'feedback_type', $pageObjectType); $this->ctrl->setParameterByClass($cl, 'feedback_id', $pageObjectId); $linkHREF = $this->ctrl->getLinkTargetByClass($cl, 'edit'); $linkTEXT = $this->lng->txt('tst_question_feedback_edit_page'); return "<a href='{$linkHREF}'>{$linkTEXT}</a>"; }
private function manageTabs($cmd) { $this->tabs->clearTargets(); $this->tabs->setBackTarget($this->lng->txt('tst_results_back_introduction'), $this->ctrl->getLinkTargetByClass('ilObjTestGUI', 'infoScreen')); if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) { require_once 'Services/Link/classes/class.ilLink.php'; $courseLink = ilLink::_getLink($this->getObjectiveOrientedContainer()->getRefId()); $this->tabs->setBack2Target($this->lng->txt('back_to_objective_container'), $courseLink); } }
/** * @param $a_comp * @param $a_part * @param array $a_par */ public function modifyGUI($a_comp, $a_part, $a_par = array()) { /** * @var $ilTabsGUI ilTabsGUI */ if ($a_part == 'tabs' && isset($_GET['ref_id']) && self::$ref_is_crs !== false) { // ATM only display certificate tab in courses if (self::$ref_is_crs === null && ilObject::_lookupType((int) $_GET['ref_id'], true) != 'crs' || $_GET['admin_mode']) { self::$ref_is_crs = false; return; } self::$ref_is_crs = true; // User needs write access to course to see the tab 'certificate' if ($this->access->checkAccess('write', '', (int) $_GET['ref_id'])) { $ilTabsGUI = $a_par['tabs']; $this->ctrl->setParameterByClass('srCertificateDefinitionGUI', 'ref_id', $_GET['ref_id']); $link = $this->ctrl->getLinkTargetByClass(array(ilCertificatePlugin::getBaseClass(), 'srCertificateDefinitionGUI')); $ilTabsGUI->addTarget('certificate', $link, 'show', 'srCertificateDefinitionGUI'); } } }
/** * Set Course title and icon in header * */ protected function initHeader() { $lgui = ilObjectListGUIFactory::_getListGUIByType($this->crs->getType()); $this->tpl->setTitle($this->crs->getTitle()); $this->tpl->setDescription($this->crs->getDescription()); if ($this->crs->getOfflineStatus()) { $this->tpl->setAlertProperties($lgui->getAlertProperties()); } $this->tpl->setTitleIcon(ilUtil::getTypeIconPath('crs', $this->crs->getId(), 'big')); $this->ctrl->setParameterByClass('ilrepositorygui', 'ref_id', $this->ref_id); $this->tabs->setBackTarget($this->pl->txt('back_to_course'), $this->ctrl->getLinkTargetByClass('ilrepositorygui')); }
/** * Creates Toolbar entries */ function addToolbar() { global $ilToolbar; $ilToolbar->setFormAction($this->ilCtrl->getFormAction($this, "perminfo")); $ilToolbar->addText($this->lng->txt('user')); include_once "./Services/Form/classes/class.ilTextInputGUI.php"; $login = new ilTextInputGUI($this->lng->txt("username"), "user_login"); $login->setDataSource($this->ilCtrl->getLinkTargetByClass(array(get_class($this), 'ilRepositorySearchGUI'), 'doUserAutoComplete', '', true)); $login->setSize(15); $login->setValue($this->user->getLogin()); $ilToolbar->addInputItem($login); $ilToolbar->addFormButton($this->lng->txt("info_change_user_view"), "perminfo"); //$ilToolbar->addText($lng->txt("info_enter_login_or_id")); }
private function setSubTabsSettings() { $next_class = $this->ctrl->getNextClass($this); $this->tabs_gui->addSubTab("edit_translations", $this->lng->txt("edit_translations"), $this->ctrl->getLinkTargetByClass("iltranslationgui", "editTranslations")); $this->tabs_gui->addSubTab("edit_ext_id", $this->lng->txt("edit_ext_id"), $this->ctrl->getLinkTargetByClass("ilextidgui", "edit")); switch ($next_class) { case 'iltranslationgui': $this->tabs_gui->setSubTabActive("edit_translations"); break; case 'ilextidgui': $this->tabs_gui->setSubTabActive("edit_ext_id"); break; } return; }
/** * @param $ilLocator */ protected function buildHeader($ilLocator) { $this->tpl->setTitle($this->courseObject->getTitle()); // Der Titel des Kurses $this->tpl->setDescription($this->courseObject->getDescription()); // Die Beschreibung des Kurses $this->tpl->setTitleIcon(ilObject::_getIcon($this->courseObject->getId(), 'big')); // Das Bild soll des Kurses // Wir fügen einen Zurückknopf ein. Dieser soll die Members des Kurses anzeigen $this->ctrl->saveParameterByClass('ilObjCourseGUI', 'ref_id'); //Wir müssen die ref_id speichern, damit der Link zum richtigen Kurs zeigt $this->tabs->setBackTarget('Zurück', $this->ctrl->getLinkTargetByClass(array('ilRepositoryGUI', 'ilObjCourseGUI'), 'members')); // Wir fügen in den folgenden zwei Zeilen den Locator hinzu. (Breadcrumbs über dem Titel). $ilLocator->addRepositoryItems($this->courseObject->getRefId()); $this->tpl->setLocator($ilLocator->getHTML()); }
/** * @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('settings', $this->ctrl->getLinkTarget($this, 'settings'), array('saveSettings', 'settings', '', 'view'), '', ''); } if ($rbacsystem->checkAccess('read', $this->object->getRefId())) { $tabs_gui->addTarget('tos_agreement_by_lng', $this->ctrl->getLinkTarget($this, 'showAgreementByLanguage'), array('reset', 'confirmReset', 'showAgreementByLanguage', 'resetAgreementByLanguageFilter', 'applyAgreementByLanguageFilter'), '', ''); } if ($rbacsystem->checkAccess('read', $this->object->getRefId()) && $rbacsystem->checkAccess('read', USER_FOLDER_ID)) { $tabs_gui->addTarget('tos_acceptance_history', $this->ctrl->getLinkTarget($this, 'showAcceptanceHistory'), array('showAcceptanceHistory', 'resetAcceptanceHistoryFilter', 'applyAcceptanceHistoryFilter'), '', ''); } 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'); } }
/** * @param $a_set */ protected function addActionsToRow($a_set) { if ($this->getActions()) { $alist = new ilAdvancedSelectionListGUI(); $alist->setId(self::domid_encode($a_set[$this->getFields()->getPrimaryField()->getName()])); $alist->setListTitle($this->txt('actions', false)); foreach ($this->getActionsAsArray() as $action) { /** * @var arIndexTableAction $action */ $access = true; if ($action->getAccess()) { $access = $this->access->checkAccess($action->getAccess(), '', $_GET['ref_id']); } if ($access) { $alist->addItem($action->getTitle(), $action->getId(), $this->ctrl->getLinkTargetByClass($action->getTargetClass(), $action->getTargetCmd())); } } $this->tpl->setVariable('ACTION', $alist->getHTML()); } }
function index($show_delete = false) { global $ilUser, $rbacreview, $rbacsystem; $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.cat_admin_users.html', "Modules/Category"); if (count($rbacreview->getGlobalAssignableRoles()) or in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles($ilUser->getId()))) { $this->toolbar->addButton($this->lng->txt('add_user'), $this->ctrl->getLinkTargetByClass('ilobjusergui', 'create')); $this->toolbar->addButton($this->lng->txt('import_users'), $this->ctrl->getLinkTargetByClass('ilobjuserfoldergui', 'importUserForm')); } else { ilUtil::sendInfo($this->lng->txt('no_roles_user_can_be_assigned_to')); } if ($show_delete) { $this->tpl->setCurrentBlock("confirm_delete"); $this->tpl->setVariable("CONFIRM_FORMACTION", $this->ctrl->getFormAction($this)); $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt('cancel')); $this->tpl->setVariable("CONFIRM_CMD", 'performDeleteUsers'); $this->tpl->setVariable("TXT_CONFIRM", $this->lng->txt('delete')); $this->tpl->parseCurrentBlock(); } $table = new ilUserTableGUI($this, 'index', ilUserTableGUI::MODE_LOCAL_USER); $this->tpl->setVariable('USERS_TABLE', $table->getHTML()); return true; }
/** * Returns the pass overview for a given active ID * * @return string HTML code of the pass overview * @access public * * @deprecated */ public function getPassOverview(ilTestSession $testSession, $targetclass = "", $targetcommand = "", $short = FALSE, $hide_details = FALSE) { $active_id = $testSession->getActiveId(); require_once 'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php'; require_once 'Modules/Test/classes/tables/class.ilTestPassOverviewTableGUI.php'; $table = new ilTestPassOverviewTableGUI($this, '', $short ? ilTestPassOverviewTableGUI::CONTEXT_SHORT : ilTestPassOverviewTableGUI::CONTEXT_LONG, isset($_GET['pdf']) && $_GET['pdf'] == 1); $considerHiddenQuestions = true; if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) { $considerHiddenQuestions = false; $table->setObjectiveOrientedPresentationEnabled(true); require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php'; $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession); } $table->init(); $data = array(); $counted_pass = $this->object->_getResultPass($active_id); $reached_pass = $this->object->_getPass($active_id); require_once 'Modules/Test/classes/class.ilTestPassesSelector.php'; $testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this->object); $testPassesSelector->setActiveId($active_id); $lastFinishedPass = $this->testSessionFactory->getSession($active_id)->getLastFinishedPass(); $testPassesSelector->setLastFinishedPass($lastFinishedPass); foreach ($testPassesSelector->getReportablePasses() as $pass) { $row = array(); $considerOptionalQuestions = true; if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) { $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass); $testSequence->loadFromDb(); $testSequence->loadQuestions(); if ($this->object->isRandomTest() && !$testSequence->isAnsweringOptionalQuestionsConfirmed()) { $considerOptionalQuestions = false; } $testSequence->setConsiderHiddenQuestionsEnabled($considerHiddenQuestions); $testSequence->setConsiderOptionalQuestionsEnabled($considerOptionalQuestions); $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence); $objectivesList->loadObjectivesTitles(); $row['objectives'] = $objectivesList->getUniqueObjectivesStringForQuestions($testSequence->getUserSequenceQuestions()); } if (!$short) { $result_array =& $this->object->getTestResult($active_id, $pass, false, $considerHiddenQuestions, $considerOptionalQuestions); if (!$result_array['pass']['total_max_points']) { $percentage = 0; } else { $percentage = $result_array['pass']['total_reached_points'] / $result_array['pass']['total_max_points'] * 100; } $total_max = $result_array['pass']['total_max_points']; $total_reached = $result_array['pass']['total_reached_points']; $total_requested_hints = $result_array['pass']['total_requested_hints']; } if (!$hide_details) { if (strlen($targetclass) && strlen($targetcommand)) { $this->ctrl->setParameterByClass($targetclass, 'active_id', $active_id); $this->ctrl->setParameterByClass($targetclass, 'pass', $pass); $aslgui = new ilAdvancedSelectionListGUI(); $aslgui->setListTitle($this->lng->txt('actions')); $aslgui->setId($pass); $aslgui->addItem($this->lng->txt('tst_pass_details'), 'tst_pass_details', $this->ctrl->getLinkTargetByClass($targetclass, $targetcommand)); if ($this->object->isPassDeletionAllowed() && $pass != $counted_pass) { $aslgui->addItem($this->lng->txt('delete'), 'tst_pass_delete', $this->ctrl->getLinkTargetByClass($targetclass, 'confirmDeletePass')); } $row['pass_details'] = $aslgui->getHTML(); } } if (!$short) { if ($pass == $counted_pass) { $row['scored'] = '⊗'; } else { $row['scored'] = ''; } } $row['pass'] = $pass + 1; $row['date'] = $this->object->getPassFinishDate($active_id, $pass); if (!$short) { $row['answered'] = $result_array['pass']['num_workedthrough'] . ' ' . strtolower($this->lng->txt('of')) . ' ' . (count($result_array) - 2); if ($this->object->isOfferingQuestionHintsEnabled()) { $row['hints'] = $total_requested_hints; } $row['reached'] = $total_reached . ' ' . strtolower($this->lng->txt('of')) . ' ' . $total_max; $row['percentage'] = $percentage; } $data[] = $row; } $table->setData($data); return $table->getHTML(); }
private function manageTabs($cmd) { $this->tabs->clearTargets(); $this->tabs->setBackTarget($this->lng->txt('tst_results_back_introduction'), $this->ctrl->getLinkTargetByClass('ilObjTestGUI', 'infoScreen')); }
/** * Returns the pass overview for a given active ID * * @return string HTML code of the pass overview * @access public * * @deprecated */ public function getPassOverview($active_id, $targetclass = "", $targetcommand = "", $short = FALSE, $hide_details = FALSE) { require_once 'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php'; require_once 'Modules/Test/classes/tables/class.ilTestPassOverviewTableGUI.php'; $table = new ilTestPassOverviewTableGUI($this, '', $short ? ilTestPassOverviewTableGUI::CONTEXT_SHORT : ilTestPassOverviewTableGUI::CONTEXT_LONG, isset($_GET['pdf']) && $_GET['pdf'] == 1); $data = array(); $counted_pass = $this->object->_getResultPass($active_id); $reached_pass = $this->object->_getPass($active_id); require_once 'Modules/Test/classes/class.ilTestPassesSelector.php'; $testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this->object); $testPassesSelector->setActiveId($active_id); $lastFinishedPass = $this->testSessionFactory->getSession($active_id)->getLastFinishedPass(); $testPassesSelector->setLastFinishedPass($lastFinishedPass); foreach ($testPassesSelector->getReportablePasses() as $pass) { $row = array(); if (!$short) { $result_array =& $this->object->getTestResult($active_id, $pass); if (!$result_array['pass']['total_max_points']) { $percentage = 0; } else { $percentage = $result_array['pass']['total_reached_points'] / $result_array['pass']['total_max_points'] * 100; } $total_max = $result_array['pass']['total_max_points']; $total_reached = $result_array['pass']['total_reached_points']; $total_requested_hints = $result_array['pass']['total_requested_hints']; } if (!$hide_details) { if (strlen($targetclass) && strlen($targetcommand)) { $this->ctrl->setParameterByClass($targetclass, 'active_id', $active_id); $this->ctrl->setParameterByClass($targetclass, 'pass', $pass); $aslgui = new ilAdvancedSelectionListGUI(); $aslgui->setListTitle($this->lng->txt('actions')); $aslgui->setId($pass); $aslgui->addItem($this->lng->txt('tst_pass_details'), 'tst_pass_details', $this->ctrl->getLinkTargetByClass($targetclass, $targetcommand)); if ($this->object->isPassDeletionAllowed() && $pass != $counted_pass) { $aslgui->addItem($this->lng->txt('delete'), 'tst_pass_delete', $this->ctrl->getLinkTargetByClass($targetclass, 'confirmDeletePass')); $delete_entry = true; } if ($delete_entry == true) { $row['pass_details'] = $aslgui->getHTML(); } else { $row['pass_details'] = '<a href="' . $this->ctrl->getLinkTargetByClass($targetclass, $targetcommand) . '">' . $this->lng->txt('tst_pass_details') . '</a>'; } } } if (!$short) { if ($pass == $counted_pass) { $row['scored'] = '⊗'; } else { $row['scored'] = ''; } } $row['pass'] = $pass + 1; $row['date'] = $this->object->getPassFinishDate($active_id, $pass); if (!$short) { $row['answered'] = $result_array['pass']['num_workedthrough'] . ' ' . strtolower($this->lng->txt('of')) . ' ' . (count($result_array) - 2); if ($this->object->isOfferingQuestionHintsEnabled()) { $row['hints'] = $total_requested_hints; } $row['reached'] = $total_reached . ' ' . strtolower($this->lng->txt('of')) . ' ' . $total_max; $row['percentage'] = $percentage; } $data[] = $row; } $table->setData($data); return $table->getHTML(); }
/** * @param ilForumTopic $thread */ public function fillRow(ilForumTopic $thread) { /** * @var $ilUser ilObjUser */ global $ilUser; $this->ctrl->setParameter($this->getParentObject(), 'thr_pk', $thread->getId()); if ('mergeThreads' == $this->parent_cmd) { $checked = $this->max_count == 1 || isset($_POST['thread_ids']) && in_array($thread->getId(), $_POST['thread_ids']); $this->tpl->setVariable('VAL_CHECK', ilUtil::formRadioButton($checked, 'thread_ids[]', $thread->getId())); } else { if ('showThreads' == $this->parent_cmd) { $this->tpl->setVariable('VAL_CHECK', ilUtil::formCheckbox(isset($_POST['thread_ids']) && in_array($thread->getId(), $_POST['thread_ids']) ? true : false, 'thread_ids[]', $thread->getId())); } else { if ($thread->isSticky()) { $this->tpl->setVariable('VAL_SORTING_NAME', 'thread_sorting[' . $thread->getId() . ']'); $this->tpl->setVariable('VAL_SORTING', (int) $this->position * 10); } else { $this->tpl->setVariable('VAL_CHECK', ''); } $this->position++; } } $subject = ''; if ($thread->isSticky()) { $subject .= '<span class="light">[' . $this->lng->txt('sticky') . ']</span> '; } if ($thread->isClosed()) { $subject .= '<span class="light">[' . $this->lng->txt('topic_close') . ']</span> '; } if (!$ilUser->isAnonymous() && $this->ilias->getSetting('forum_notification') != 0 && $thread->getUserNotificationEnabled()) { $subject .= '<span class="light">[' . $this->lng->txt('forums_notification_enabled') . ']</span> '; } $num_posts = $thread->getNumPosts(); $num_unread = $thread->getNumUnreadPosts(); $num_new = $thread->getNumNewPosts(); if ($num_posts > 0) { $subject = '<div><a href="' . $this->ctrl->getLinkTarget($this->getParentObject(), 'viewThread') . '">' . $thread->getSubject() . '</a></div>' . $subject; } else { $subject = $thread->getSubject() . $subject; } $this->tpl->setVariable('VAL_SUBJECT', $subject); // Author $this->ctrl->setParameter($this->getParentObject(), 'backurl', urlencode($this->ctrl->getLinkTargetByClass("ilrepositorygui", ""))); $this->ctrl->setParameter($this->getParentObject(), 'user', $thread->getUserId()); $authorinfo = new ilForumAuthorInformation($thread->getUserId(), $thread->getUserAlias(), $thread->getImportName(), array('class' => 'il_ItemProperty', 'href' => $this->ctrl->getLinkTarget($this->getParentObject(), 'showUser'))); $this->tpl->setVariable('VAL_AUTHOR', $authorinfo->getLinkedAuthorName()); $topicStats = $num_posts; if (!$ilUser->isAnonymous()) { if ($num_unread > 0) { $topicStats .= '<br /><span class="alert ilWhiteSpaceNowrap">' . $this->lng->txt('unread') . ': ' . $num_unread . '</span>'; } if ($num_new > 0 && $this->getOverviewSetting() == 0) { $topicStats .= '<br /><span class="alert ilWhiteSpaceNowrap">' . $this->lng->txt('new') . ': ' . $num_new . '</span>'; } } $this->tpl->setVariable('VAL_ARTICLE_STATS', $topicStats); $this->tpl->setVariable('VAL_NUM_VISIT', $thread->getVisits()); // Last posting if ($num_posts > 0) { if ($this->getIsModerator()) { $objLastPost = $thread->getLastPost(); } else { $objLastPost = $thread->getLastActivePost(); } if (is_object($objLastPost)) { $authorinfo = new ilForumAuthorInformation($objLastPost->getUserId(), $objLastPost->getUserAlias(), $objLastPost->getImportName(), array('href' => $this->ctrl->getLinkTarget($this->getParentObject(), 'viewThread') . '#' . $objLastPost->getId())); $this->tpl->setVariable('VAL_LP_DATE', '<div class="ilWhiteSpaceNowrap">' . ilDatePresentation::formatDate(new ilDateTime($objLastPost->getCreateDate(), IL_CAL_DATETIME)) . '</div>' . '<div class="ilWhiteSpaceNowrap">' . $this->lng->txt('from') . ' ' . $authorinfo->getLinkedAuthorName() . '</div>'); } } // Row style $css_row = $this->css_row; if ($thread->isSticky()) { $css_row = $css_row == 'tblrow1' ? 'tblstickyrow1' : 'tblstickyrow2'; } $this->tpl->setVariable('CSS_ROW', $css_row); $this->ctrl->setParameter($this->getParentObject(), 'thr_pk', ''); $this->ctrl->setParameter($this->getParentObject(), 'user', ''); $this->ctrl->setParameter($this->getParentObject(), 'backurl', ''); }
/** * Returns the pass details overview for a given active ID and pass * * @param array $result_array An array containing the results of the users test pass (generated by ilObjTest::getTestResult) * @param integer $active_id Active ID of the active user * @param integer $pass Test pass * @param string $targetclass The name of the ILIAS class for the "pass details" URL (optional) * @param string $targetcommand The name of the ILIAS command for the "pass details" URL (optional) * @param string $targetcommanddetails The name of the ILIAS command which should be called for the details of an answer (optional) * @param boolean $standard_header TRUE if the table headers should be plain text, FALSE if the table headers should be URL's for sortable columns * @return string HTML code of the pass details overview * @access public */ function getPassDetailsOverview($result_array, $active_id, $pass, $targetclass = "", $targetcommandsort = "", $targetcommanddetails = "", $standard_header = TRUE) { global $ilUser; $testresults = $result_array["pass"]; unset($result_array["test"]); $user_id = $this->object->_getUserIdFromActiveId($active_id); $sort = $_GET["sort"] ? $_GET["sort"] : "nr"; $sortorder = $_GET["sortorder"] ? $_GET["sortorder"] : "asc"; if (!$standard_header) { // change sortorder of result array usort($result_array, "sortResults"); } $color_class = array("tblrow1top", "tblrow2top"); $counter = 0; $template = new ilTemplate("tpl.il_as_tst_pass_details_overview.html", TRUE, TRUE, "Modules/Test"); $this->ctrl->setParameterByClass($targetclass, "pass", "{$pass}"); if (!$testresults["total_max_points"]) { $percentage = 0; } else { $percentage = $testresults["total_reached_points"] / $testresults["total_max_points"] * 100; } $total_max = $testresults["total_max_points"]; $total_reached = $testresults["total_reached_points"]; $totalRequestedHints = $testresults["total_requested_hints"]; $img_title_percent = ""; $img_title_nr = ""; $hasSuggestedSolutions = FALSE; if ($this->object->getShowSolutionSuggested()) { foreach ($result_array as $key => $value) { if (strlen($value["solution"])) { $hasSuggestedSolutions = TRUE; } } } foreach ($result_array as $key => $value) { if (preg_match("/\\d+/", $key)) { if (strlen($targetclass) && strlen($targetcommanddetails)) { $template->setCurrentBlock("linked_title"); $template->setVariable("COLOR_CLASS", $color_class[$counter % 2]); $template->setVariable("VALUE_QUESTION_TITLE", $value["title"]); $this->ctrl->setParameterByClass($targetclass, "evaluation", $value["qid"]); $this->ctrl->setParameterByClass($targetclass, "active_id", $active_id); $template->setVariable("URL_QUESTION_TITLE", $this->ctrl->getLinkTargetByClass($targetclass, $targetcommanddetails)); $template->parseCurrentBlock(); } else { $template->setCurrentBlock("plain_title"); $template->setVariable("VALUE_QUESTION_TITLE", $value["title"]); $template->setVariable("COLOR_CLASS", $color_class[$counter % 2]); $template->parseCurrentBlock(); } if ($hasSuggestedSolutions) { $template->setCurrentBlock("question_suggested_solution"); $template->setVariable("COLOR_CLASS", $color_class[$counter % 2]); $template->setVariable("SOLUTION_HINT", $this->object->prepareTextareaOutput($value["solution"], true)); $template->parseCurrentBlock(); } $template->setCurrentBlock("question"); $template->setVariable("COLOR_CLASS", $color_class[$counter % 2]); $template->setVariable("VALUE_QUESTION_COUNTER", $value["nr"]); $template->setVariable("VALUE_MAX_POINTS", $value["max"]); $template->setVariable("VALUE_REACHED_POINTS", $value["reached"]); if ($this->object->isOfferingQuestionHintsEnabled()) { $template->setVariable("VALUE_HINT_COUNT", $value["requested_hints"]); } $template->setVariable("VALUE_PERCENT_SOLVED", $value["percent"]); $template->parseCurrentBlock(); $counter++; } } if ($hasSuggestedSolutions) { $template->touchBlock("footer_suggested_solution"); } $template->setCurrentBlock("footer"); $template->setVariable("VALUE_QUESTION_COUNTER", "<strong>" . $this->lng->txt("total") . "</strong>"); $template->setVariable("VALUE_QUESTION_TITLE", ""); $template->setVariable("VALUE_MAX_POINTS", "<strong>{$total_max}</strong>"); $template->setVariable("VALUE_REACHED_POINTS", "<strong>{$total_reached}</strong>"); if ($this->object->isOfferingQuestionHintsEnabled()) { $template->setVariable("VALUE_TOTAL_HINT_COUNT", "<strong>{$totalRequestedHints}</strong>"); } $template->setVariable("VALUE_PERCENT_SOLVED", "<strong>" . sprintf("%2.2f", $percentage) . " %" . "</strong>"); $template->parseCurrentBlock(); if ($standard_header) { if ($hasSuggestedSolutions) { $template->setCurrentBlock("standard_header_suggested_solution"); $template->setVariable("SOLUTION_HINT_HEADER", $this->lng->txt("solution_hint")); $template->parseCurrentBlock(); } $template->setCurrentBlock("standard_header"); $template->setVariable("QUESTION_COUNTER", $this->lng->txt("tst_question_no")); $template->setVariable("PERCENT_SOLVED", $this->lng->txt("tst_percent_solved")); $template->setVariable("QUESTION_TITLE", $this->lng->txt("tst_question_title")); $template->setVariable("MAX_POINTS", $this->lng->txt("tst_maximum_points")); $template->setVariable("REACHED_POINTS", $this->lng->txt("tst_reached_points")); if ($this->object->isOfferingQuestionHintsEnabled()) { $template->setVariable("HINT_COUNT", $this->lng->txt("tst_question_hints_requested_hint_count_header")); } $template->parseCurrentBlock(); } else { if ($hasSuggestedSolutions) { $template->setCurrentBlock("linked_header_suggested_solution"); if (strcmp($sort, "solution") == 0) { $this->ctrl->setParameterByClass($targetclass, "sortorder", !strcmp($sortorder, "asc") ? "desc" : "asc"); } else { $this->ctrl->setParameterByClass($targetclass, "sortorder", "asc"); } $this->ctrl->setParameterByClass($targetclass, "sort", "solution"); $template->setVariable("URL_SOLUTION_HINT_HEADER", $this->ctrl->getLinkTargetByClass($targetclass, $targetcommandsort)); $template->setVariable("SOLUTION_HINT_HEADER", $this->lng->txt("solution_hint")); if (strcmp($sort, "solution") == 0) { $image = new ilTemplate("tpl.image.html", TRUE, TRUE, "Modules/Test"); $image->setVariable("IMAGE_SOURCE", ilUtil::getImagePath($sortorder . "_order.png")); $image->setVariable("IMAGE_ALT", $this->lng->txt("change_sort_direction")); $image->setVariable("IMAGE_TITLE", $this->lng->txt("change_sort_direction")); $template->setVariable("IMAGE_SOLUTION_HINT_HEADER", $image->get()); } $template->parseCurrentBlock(); } $template->setCurrentBlock("linked_header"); $this->ctrl->setParameterByClass($targetclass, "sort", "nr"); if (strcmp($sort, "nr") == 0) { $this->ctrl->setParameterByClass($targetclass, "sortorder", !strcmp($sortorder, "asc") ? "desc" : "asc"); } else { $this->ctrl->setParameterByClass($targetclass, "sortorder", "asc"); } $template->setVariable("URL_QUESTION_COUNTER", $this->ctrl->getLinkTargetByClass($targetclass, $targetcommandsort)); $template->setVariable("QUESTION_COUNTER", $this->lng->txt("tst_question_no")); if (strcmp($sort, "nr") == 0) { $image = new ilTemplate("tpl.image.html", TRUE, TRUE, "Modules/Test"); $image->setVariable("IMAGE_SOURCE", ilUtil::getImagePath($sortorder . "_order.png")); $image->setVariable("IMAGE_ALT", $this->lng->txt("change_sort_direction")); $image->setVariable("IMAGE_TITLE", $this->lng->txt("change_sort_direction")); $template->setVariable("IMAGE_QUESTION_COUNTER", $image->get()); } $this->ctrl->setParameterByClass($targetclass, "sort", "percent"); if (strcmp($sort, "percent") == 0) { $this->ctrl->setParameterByClass($targetclass, "sortorder", !strcmp($sortorder, "asc") ? "desc" : "asc"); } else { $this->ctrl->setParameterByClass($targetclass, "sortorder", "asc"); } $template->setVariable("URL_PERCENT_SOLVED", $this->ctrl->getLinkTargetByClass($targetclass, $targetcommandsort)); $template->setVariable("PERCENT_SOLVED", $this->lng->txt("tst_percent_solved")); if (strcmp($sort, "percent") == 0) { $image = new ilTemplate("tpl.image.html", TRUE, TRUE, "Modules/Test"); $image->setVariable("IMAGE_SOURCE", ilUtil::getImagePath($sortorder . "_order.png")); $image->setVariable("IMAGE_ALT", $this->lng->txt("change_sort_direction")); $image->setVariable("IMAGE_TITLE", $this->lng->txt("change_sort_direction")); $template->setVariable("IMAGE_PERCENT_SOLVED", $image->get()); } $this->ctrl->setParameterByClass($targetclass, "sort", "title"); if (strcmp($sort, "title") == 0) { $this->ctrl->setParameterByClass($targetclass, "sortorder", !strcmp($sortorder, "asc") ? "desc" : "asc"); } else { $this->ctrl->setParameterByClass($targetclass, "sortorder", "asc"); } $template->setVariable("URL_QUESTION_TITLE", $this->ctrl->getLinkTargetByClass($targetclass, $targetcommandsort)); $template->setVariable("QUESTION_TITLE", $this->lng->txt("tst_question_title")); if (strcmp($sort, "title") == 0) { $image = new ilTemplate("tpl.image.html", TRUE, TRUE, "Modules/Test"); $image->setVariable("IMAGE_SOURCE", ilUtil::getImagePath($sortorder . "_order.png")); $image->setVariable("IMAGE_ALT", $this->lng->txt("change_sort_direction")); $image->setVariable("IMAGE_TITLE", $this->lng->txt("change_sort_direction")); $template->setVariable("IMAGE_QUESTION_TITLE", $image->get()); } $this->ctrl->setParameterByClass($targetclass, "sort", "max"); if (strcmp($sort, "max") == 0) { $this->ctrl->setParameterByClass($targetclass, "sortorder", strcmp($sortorder, "asc") ? "desc" : "asc"); } else { $this->ctrl->setParameterByClass($targetclass, "sortorder", "asc"); } $template->setVariable("URL_MAX_POINTS", $this->ctrl->getLinkTargetByClass($targetclass, $targetcommandsort)); $template->setVariable("MAX_POINTS", $this->lng->txt("tst_maximum_points")); if (strcmp($sort, "max") == 0) { $image = new ilTemplate("tpl.image.html", TRUE, TRUE, "Modules/Test"); $image->setVariable("IMAGE_SOURCE", ilUtil::getImagePath($sortorder . "_order.png")); $image->setVariable("IMAGE_ALT", $this->lng->txt("change_sort_direction")); $image->setVariable("IMAGE_TITLE", $this->lng->txt("change_sort_direction")); $template->setVariable("IMAGE_MAX_POINTS", $image->get()); } $this->ctrl->setParameterByClass($targetclass, "sort", "reached"); if (strcmp($sort, "reached") == 0) { $this->ctrl->setParameterByClass($targetclass, "sortorder", !strcmp($sortorder, "asc") ? "desc" : "asc"); } else { $this->ctrl->setParameterByClass($targetclass, "sortorder", "asc"); } $template->setVariable("URL_REACHED_POINTS", $this->ctrl->getLinkTargetByClass($targetclass, $targetcommandsort)); $template->setVariable("REACHED_POINTS", $this->lng->txt("tst_reached_points")); if (strcmp($sort, "reached") == 0) { $image = new ilTemplate("tpl.image.html", TRUE, TRUE, "Modules/Test"); $image->setVariable("IMAGE_SOURCE", ilUtil::getImagePath($sortorder . "_order.png")); $image->setVariable("IMAGE_ALT", $this->lng->txt("change_sort_direction")); $image->setVariable("IMAGE_TITLE", $this->lng->txt("change_sort_direction")); $template->setVariable("IMAGE_REACHED_POINTS", $image->get()); } $template->parseCurrentBlock(); } return $template->get(); }