/**
  * @param ilObjectGUI $a_parent_obj
  * @param string      $a_parent_cmd
  */
 public function __construct(ilObjectGUI $a_parent_obj, $a_parent_cmd)
 {
     /**
      * @var $ilCtrl ilCtrl
      */
     global $ilCtrl;
     $this->ctrl = $ilCtrl;
     // Call this immediately in constructor
     $this->setId('tos_agreement_by_lng');
     $this->setDefaultOrderDirection('ASC');
     $this->setDefaultOrderField('language');
     $this->setExternalSorting(false);
     $this->setExternalSegmentation(false);
     parent::__construct($a_parent_obj, $a_parent_cmd);
     $this->setTitle($this->lng->txt('tos_agreement_by_lng'));
     $this->addColumn($this->lng->txt('language'), 'language');
     $this->addColumn($this->lng->txt('tos_agreement'), 'agreement');
     $this->addColumn($this->lng->txt('tos_agreement_document'), 'agreement_document');
     $this->optionalColumns = (array) $this->getSelectableColumns();
     $this->visibleOptionalColumns = (array) $this->getSelectedColumns();
     foreach ($this->visibleOptionalColumns as $column) {
         $this->addColumn($this->optionalColumns[$column]['txt'], $column);
     }
     $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, 'applyAgreementByLanguageFilter'));
     $this->setRowTemplate('tpl.tos_agreement_by_lng_table_row.html', 'Services/TermsOfService');
     $this->setShowRowsSelector(true);
     require_once 'Services/jQuery/classes/class.iljQueryUtil.php';
     require_once 'Services/YUI/classes/class.ilYuiUtil.php';
     iljQueryUtil::initjQuery();
     ilYuiUtil::initPanel();
     ilYuiUtil::initOverlay();
     $this->initFilter();
     $this->setFilterCommand('applyAgreementByLanguageFilter');
     $this->setResetCommand('resetAgreementByLanguageFilter');
 }
 public function getHTML()
 {
     global $ilCtrl, $tpl, $lng, $ilUser;
     if (!$this->isContainer) {
         #return '';
     }
     if ($_GET['baseClass'] == 'ilSearchController') {
         //			return '';
     }
     include_once "Services/jQuery/classes/class.iljQueryUtil.php";
     iljQueryUtil::initjQuery();
     iljQueryUtil::initjQueryUI();
     $this->tpl = new ilTemplate('tpl.main_menu_search.html', true, true, 'Services/Search');
     if ($ilUser->getId() != ANONYMOUS_USER_ID) {
         if (ilSearchSettings::getInstance()->isLuceneUserSearchEnabled() or (int) $_GET['ref_id']) {
             $this->tpl->setCurrentBlock("position");
             $this->tpl->setVariable('TXT_GLOBALLY', $lng->txt("search_globally"));
             $this->tpl->setVariable('ROOT_ID', ROOT_FOLDER_ID);
             $this->tpl->parseCurrentBlock();
         } else {
             $this->tpl->setCurrentBlock("position_hid");
             $this->tpl->setVariable('ROOT_ID_HID', ROOT_FOLDER_ID);
             $this->tpl->parseCurrentBlock();
         }
         if ((int) $_GET['ref_id']) {
             $this->tpl->setCurrentBlock('position_rep');
             $this->tpl->setVariable('TXT_CURRENT_POSITION', $lng->txt("search_at_current_position"));
             $this->tpl->setVariable('REF_ID', (int) $_GET["ref_id"]);
             $this->tpl->parseCurrentBlock();
         }
     }
     if ($ilUser->getId() != ANONYMOUS_USER_ID && ilSearchSettings::getInstance()->isLuceneUserSearchEnabled()) {
         $this->tpl->setCurrentBlock('usr_search');
         $this->tpl->setVariable('TXT_USR_SEARCH', $this->lng->txt('search_users'));
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setVariable('FORMACTION', 'ilias.php?baseClass=ilSearchController&cmd=post' . '&rtoken=' . $ilCtrl->getRequestToken() . '&fallbackCmd=remoteSearch');
     $this->tpl->setVariable('BTN_SEARCH', $this->lng->txt('search'));
     // $this->tpl->setVariable('ID_AUTOCOMPLETE', "mm_sr_auto");
     $this->tpl->setVariable('AC_DATASOURCE', "ilias.php?baseClass=ilSearchController&cmd=autoComplete");
     $this->tpl->setVariable('IMG_MM_SEARCH', ilUtil::img(ilUtil::getImagePath("icon_seas.svg"), $lng->txt("search")));
     if ($ilUser->getId() != ANONYMOUS_USER_ID) {
         $this->tpl->setVariable('HREF_SEARCH_LINK', "ilias.php?baseClass=ilSearchController");
         $this->tpl->setVariable('TXT_SEARCH_LINK', $lng->txt("last_search_result"));
     }
     // #10555 - we need the overlay for the autocomplete which is always active
     $this->tpl->setVariable('TXT_SEARCH', $lng->txt("search"));
     include_once "./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
     $ov = new ilOverlayGUI("mm_search_menu");
     //$ov->setTrigger("main_menu_search", "none",
     //	"main_menu_search", "tr", "br");
     //$ov->setAnchor("main_menu_search", "tr", "br");
     $ov->setAutoHide(false);
     $ov->add();
     return $this->tpl->get();
 }
 /**
  * execute command
  */
 function executeCommand()
 {
     global $ilDB, $lng, $ilPluginAdmin, $ilTabs, $tree;
     $ilTabs->clearTargets();
     $this->ctrl->saveParameter($this, "sequence");
     $this->ctrl->saveParameter($this, "active_id");
     $this->initAssessmentSettings();
     require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
     $this->dynamicQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this->object);
     $this->dynamicQuestionSetConfig->loadFromDb();
     $testSessionFactory = new ilTestSessionFactory($this->object);
     $this->testSession = $testSessionFactory->getSession($_GET['active_id']);
     $this->ensureExistingTestSession($this->testSession);
     $this->initProcessLocker($this->testSession->getActiveId());
     $testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $this->object);
     $this->testSequence = $testSequenceFactory->getSequenceByTestSession($this->testSession);
     $this->testSequence->loadFromDb();
     include_once 'Services/jQuery/classes/class.iljQueryUtil.php';
     iljQueryUtil::initjQuery();
     include_once "./Services/YUI/classes/class.ilYuiUtil.php";
     ilYuiUtil::initConnectionWithAnimation();
     if ($this->object->getKioskMode()) {
         include_once 'Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php';
         ilOverlayGUI::initJavascript();
     }
     $this->handlePasswordProtectionRedirect();
     $cmd = $this->ctrl->getCmd();
     $nextClass = $this->ctrl->getNextClass($this);
     switch ($nextClass) {
         case 'ilassquestionpagegui':
             $questionId = $this->testSequence->getQuestionForSequence($this->calculateSequence());
             require_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php";
             $page_gui = new ilAssQuestionPageGUI($questionId);
             $ret = $this->ctrl->forwardCommand($page_gui);
             break;
         case 'ilassquestionhintrequestgui':
             $questionGUI = $this->object->createQuestionGUI("", $this->testSequenceFactory->getSequenceByTestSession()->getQuestionForSequence($this->calculateSequence()));
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
             $gui = new ilAssQuestionHintRequestGUI($this, self::CMD_SHOW_QUESTION, $this->testSession, $questionGUI);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ildynamicquestionsetstatistictablegui':
             $this->ctrl->forwardCommand($this->buildQuestionSetFilteredStatisticTableGUI());
             break;
         case 'iltestpasswordprotectiongui':
             require_once 'Modules/Test/classes/class.ilTestPasswordProtectionGUI.php';
             $gui = new ilTestPasswordProtectionGUI($this->ctrl, $this->tpl, $this->lng, $this, $this->passwordChecker);
             $ret = $this->ctrl->forwardCommand($gui);
             break;
         default:
             $cmd .= 'Cmd';
             $ret =& $this->{$cmd}();
             break;
     }
     return $ret;
 }
 /**
  * Render html
  */
 function render($a_mode = "")
 {
     global $lng, $tpl, $ilUser;
     $quota_exceeded = $quota_legend = false;
     if (self::$check_wsp_quota) {
         include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
         if (!ilDiskQuotaHandler::isUploadPossible()) {
             $lng->loadLanguageModule("file");
             return $lng->txt("personal_workspace_quota_exceeded_warning");
         } else {
             $quota_legend = ilDiskQuotaHandler::getStatusLegend();
         }
     }
     // make sure jQuery is loaded
     iljQueryUtil::initjQuery();
     // add file upload scripts
     include_once "./Services/FileUpload/classes/class.ilFileUploadGUI.php";
     ilFileUploadGUI::initFileUpload();
     // load template
     $this->tpl = new ilTemplate("tpl.prop_dndfiles.html", true, true, "Services/Form");
     // general variables
     $this->tpl->setVariable("UPLOAD_ID", $this->uniqueId);
     // input
     $this->tpl->setVariable("FILE_SELECT_ICON", ilUtil::getImagePath('icon_fold.png'));
     $this->tpl->setVariable("TXT_SHOW_ALL_DETAILS", $lng->txt('show_all_details'));
     $this->tpl->setVariable("TXT_HIDE_ALL_DETAILS", $lng->txt('hide_all_details'));
     $this->tpl->setVariable("TXT_SELECTED_FILES", $lng->txt('selected_files'));
     $this->tpl->setVariable("TXT_DRAG_FILES_HERE", $lng->txt('drag_files_here'));
     $this->tpl->setVariable("TXT_NUM_OF_SELECTED_FILES", $lng->txt('num_of_selected_files'));
     $this->tpl->setVariable("TXT_SELECT_FILES_FROM_COMPUTER", $lng->txt('select_files_from_computer'));
     $this->tpl->setVariable("TXT_OR", $lng->txt('logic_or'));
     $this->tpl->setVariable("INPUT_ACCEPT_SUFFIXES", $this->getInputAcceptSuffixes($this->getSuffixes()));
     // info
     $this->tpl->setCurrentBlock("max_size");
     $this->tpl->setVariable("TXT_MAX_SIZE", $lng->txt("file_notice") . " " . $this->getMaxFileSizeString());
     $this->tpl->parseCurrentBlock();
     if ($quota_legend) {
         $this->tpl->setVariable("TXT_MAX_SIZE", $quota_legend);
         $this->tpl->parseCurrentBlock();
     }
     $this->outputSuffixes($this->tpl);
     // create file upload object
     $upload = new ilFileUploadGUI("ilFileUploadDropZone_" . $this->uniqueId, $this->uniqueId, false);
     $upload->enableFormSubmit("ilFileUploadInput_" . $this->uniqueId, $this->submit_button_name, $this->cancel_button_name);
     $upload->setDropAreaId("ilFileUploadDropArea_" . $this->uniqueId);
     $upload->setFileListId("ilFileUploadList_" . $this->uniqueId);
     $upload->setFileSelectButtonId("ilFileUploadFileSelect_" . $this->uniqueId);
     $this->tpl->setVariable("FILE_UPLOAD", $upload->getHTML());
     return $this->tpl->get();
 }
 /**
  * Get trigger table
  */
 function getImageMapTableHTML()
 {
     global $tpl, $ilToolbar, $lng, $ilCtrl;
     include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
     iljQueryUtil::initjQueryUI();
     $tpl->addJavascript("./Services/COPage/js/ilCOPagePres.js");
     $tpl->addJavascript("./Services/COPage/js/ilCOPagePCInteractiveImage.js");
     include_once "./Services/Accordion/classes/class.ilAccordionGUI.php";
     ilAccordionGUI::addJavaScript();
     ilAccordionGUI::addCss();
     $ilToolbar->addText($lng->txt("cont_drag_element_click_save"));
     $ilToolbar->setId("drag_toolbar");
     $ilToolbar->setHidden(true);
     $ilToolbar->addButton($lng->txt("save"), "#", "", "", "", "save_pos_button");
     $ilToolbar->addButton($lng->txt("cancel"), $ilCtrl->getLinkTarget($this, "editMapAreas"));
     include_once "./Services/COPage/classes/class.ilPCIIMTriggerTableGUI.php";
     $image_map_table = new ilPCIIMTriggerTableGUI($this, "editMapAreas", $this->content_obj, $this->getParentNodeName());
     return $image_map_table->getHTML();
 }
 /**
  * execute command
  */
 function executeCommand()
 {
     global $ilDB, $lng, $ilPluginAdmin, $ilTabs, $tree;
     $ilTabs->clearTargets();
     $this->ctrl->saveParameter($this, "sequence");
     $this->ctrl->saveParameter($this, "active_id");
     require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
     $this->dynamicQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this->object);
     $this->dynamicQuestionSetConfig->loadFromDb();
     $testSessionFactory = new ilTestSessionFactory($this->object);
     $this->testSession = $testSessionFactory->getSession($_GET['active_id']);
     $testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $this->object);
     $this->testSequence = $testSequenceFactory->getSequence($this->testSession);
     $this->testSequence->loadFromDb();
     include_once 'Services/jQuery/classes/class.iljQueryUtil.php';
     iljQueryUtil::initjQuery();
     include_once "./Services/YUI/classes/class.ilYuiUtil.php";
     ilYuiUtil::initConnectionWithAnimation();
     if ($this->object->getKioskMode()) {
         include_once 'Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php';
         ilOverlayGUI::initJavascript();
     }
     $cmd = $this->ctrl->getCmd();
     $nextClass = $this->ctrl->getNextClass($this);
     switch ($nextClass) {
         case 'ilassquestionhintrequestgui':
             $questionGUI = $this->object->createQuestionGUI("", $this->testSequenceFactory->getSequence()->getQuestionForSequence($this->calculateSequence()));
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
             $gui = new ilAssQuestionHintRequestGUI($this, $this->testSession, $questionGUI);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilfilteredquestionstablegui':
             $this->ctrl->forwardCommand($this->buildFilteredQuestionsTableGUI());
             break;
         default:
             $cmd .= 'Cmd';
             $ret =& $this->{$cmd}();
             break;
     }
     return $ret;
 }
 /**
  * @return string
  */
 public function getHtml()
 {
     /**
      * @var $lng    ilLanguage
      * @var $tpl ilTemplate
      */
     global $lng, $tpl;
     if ($this->getSessionReminder()->isActive()) {
         require_once 'Services/jQuery/classes/class.iljQueryUtil.php';
         iljQueryUtil::initjQuery();
         require_once 'Services/YUI/classes/class.ilYuiUtil.php';
         ilYuiUtil::initCookie();
         $tpl->addJavaScript('./Services/Authentication/js/session_reminder.js');
         $reminder_tpl = new ilTemplate('tpl.session_reminder.html', true, true, 'Services/Authentication');
         $reminder_tpl->setVariable('DEBUG', defined('DEVMODE') && DEVMODE ? 1 : 0);
         $reminder_tpl->setVariable('CLIENT_ID', CLIENT_ID);
         $reminder_tpl->setVariable('SESSION_NAME', session_name());
         $reminder_tpl->setVariable('FREQUENCY', 60);
         $reminder_tpl->setVariable('SESSION_ID', session_id());
         $reminder_tpl->setVariable('URL', './sessioncheck.php?client_id=' . CLIENT_ID . '&lang=' . $lng->getLangKey());
         return $reminder_tpl->get();
     }
     return '';
 }
 /**
  * execute command
  */
 function executeCommand()
 {
     global $ilUser;
     $cmd = $this->ctrl->getCmd();
     $next_class = $this->ctrl->getNextClass($this);
     $this->ctrl->saveParameter($this, "sequence");
     $this->ctrl->saveParameter($this, "active_id");
     if (preg_match("/^gotoquestion_(\\d+)\$/", $cmd, $matches)) {
         $cmd = "gotoquestion";
         if (strlen($matches[1])) {
             $this->ctrl->setParameter($this, 'gotosequence', $matches[1]);
         }
     }
     if ($_GET["active_id"]) {
         $this->object->setTestSession($_GET["active_id"]);
     } else {
         $this->object->setTestSession();
     }
     include_once 'Services/jQuery/classes/class.iljQueryUtil.php';
     iljQueryUtil::initjQuery();
     include_once "./Services/YUI/classes/class.ilYuiUtil.php";
     ilYuiUtil::initConnectionWithAnimation();
     $cmd = $this->getCommand($cmd);
     switch ($next_class) {
         case 'ilassquestionhintrequestgui':
             $questionGUI = $this->object->createQuestionGUI("", $this->object->getTestSequence()->getQuestionForSequence($this->calculateSequence()));
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
             $gui = new ilAssQuestionHintRequestGUI($this, $this->object->getTestSession(), $questionGUI);
             $ret = $this->ctrl->forwardCommand($gui);
             break;
         default:
             $ret =& $this->{$cmd}();
             break;
     }
     return $ret;
 }
 /**
  * Export support scripts
  *
  * @param
  * @return
  */
 function exportSupportScripts()
 {
     // export flv/mp3 player
     //copy(ilPlayerUtil::getFlashVideoPlayerFilename(true),
     //	$this->js_dir."/".ilPlayerUtil::getFlashVideoPlayerFilename());
     //copy("./Services/MediaObjects/flash_mp3_player/mp3player.swf",
     //	$this->mp3_dir."/mp3player.swf");
     // basic js
     copy('./Services/JavaScript/js/Basic.js', $this->js_dir . '/Basic.js');
     copy('./Services/UIComponent/Overlay/js/ilOverlay.js', $this->js_dir . '/ilOverlay.js');
     // jquery
     include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
     copy(iljQueryUtil::getLocaljQueryPath(), $this->js_dir . '/jquery.js');
     copy(iljQueryUtil::getLocaljQueryUIPath(), $this->js_dir . '/jquery-ui-min.js');
     copy(iljQueryUtil::getLocalMaphilightPath(), $this->js_dir . '/maphilight.js');
     // yui stuff we use
     include_once "./Services/YUI/classes/class.ilYuiUtil.php";
     copy(ilYuiUtil::getLocalPath('yahoo/yahoo-min.js'), $this->js_yahoo_dir . '/yahoo-min.js');
     copy(ilYuiUtil::getLocalPath('yahoo-dom-event/yahoo-dom-event.js'), $this->js_yahoo_dir . '/yahoo-dom-event.js');
     copy(ilYuiUtil::getLocalPath('animation/animation-min.js'), $this->js_yahoo_dir . '/animation-min.js');
     copy(ilYuiUtil::getLocalPath('container/container-min.js'), $this->js_yahoo_dir . '/container-min.js');
     copy(ilYuiUtil::getLocalPath('container/assets/skins/sam/container.css'), $this->css_dir . '/container.css');
     // accordion
     copy('./Services/Accordion/js/accordion.js', $this->js_dir . '/accordion.js');
     copy('./Services/Accordion/css/accordion.css', $this->css_dir . '/accordion.css');
     // page presentation js
     copy('./Services/COPage/js/ilCOPagePres.js', $this->js_dir . '/ilCOPagePres.js');
     // tooltip
     copy('./Services/UIComponent/Tooltip/js/ilTooltip.js', $this->js_dir . '/ilTooltip.js');
     // mediaelement.js
     include_once "./Services/MediaObjects/classes/class.ilPlayerUtil.php";
     ilPlayerUtil::copyPlayerFilesToTargetDirectory($this->flv_dir);
     //		copy(ilPlayerUtil::getLocalMediaElementCssPath(),
     //			$this->css_dir.'/mediaelementplayer.css');
     //		copy(ilPlayerUtil::getLocalMediaElementJsPath(),
     //			$this->js_dir.'/mediaelement-and-player.js');
 }
 /**
  * set all template variables (images, scripts, target frames, ...)
  */
 function setTemplateVars()
 {
     global $rbacsystem, $lng, $ilias, $tree, $ilUser, $ilSetting, $ilPluginAdmin;
     if ($this->logo_only) {
         $this->tpl->setVariable("HEADER_URL", $this->getHeaderURL());
         $this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.svg"));
         return;
     }
     // get user interface plugins
     $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
     if ($this->getMode() != self::MODE_TOPBAR_REDUCED && $this->getMode() != self::MODE_TOPBAR_MEMBERVIEW) {
         // search
         include_once 'Services/Search/classes/class.ilSearchSettings.php';
         if ($rbacsystem->checkAccess('search', ilSearchSettings::_getSearchSettingRefId())) {
             include_once './Services/Search/classes/class.ilMainMenuSearchGUI.php';
             $main_search = new ilMainMenuSearchGUI();
             $html = "";
             // user interface plugin slot + default rendering
             include_once "./Services/UIComponent/classes/class.ilUIHookProcessor.php";
             $uip = new ilUIHookProcessor("Services/MainMenu", "main_menu_search", array("main_menu_gui" => $this, "main_menu_search_gui" => $main_search));
             if (!$uip->replaced()) {
                 $html = $main_search->getHTML();
             }
             $html = $uip->getHTML($html);
             if (strlen($html)) {
                 $this->tpl->setVariable('SEARCHBOX', $html);
             }
         }
         $this->renderStatusBox($this->tpl);
         // online help
         $this->renderHelpButtons();
     }
     if ($this->getMode() == self::MODE_FULL) {
         $mmle_html = "";
         // user interface plugin slot + default rendering
         include_once "./Services/UIComponent/classes/class.ilUIHookProcessor.php";
         $uip = new ilUIHookProcessor("Services/MainMenu", "main_menu_list_entries", array("main_menu_gui" => $this));
         if (!$uip->replaced()) {
             $mmle_tpl = new ilTemplate("tpl.main_menu_list_entries.html", true, true, "Services/MainMenu");
             $mmle_html = $this->renderMainMenuListEntries($mmle_tpl);
         }
         $mmle_html = $uip->getHTML($mmle_html);
         $this->tpl->setVariable("MAIN_MENU_LIST_ENTRIES", $mmle_html);
     }
     if ($this->getMode() != self::MODE_TOPBAR_MEMBERVIEW) {
         $link_dir = defined("ILIAS_MODULE") ? "../" : "";
         // login stuff
         if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID) {
             include_once 'Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
             if (ilRegistrationSettings::_lookupRegistrationType() != IL_REG_DISABLED) {
                 $this->tpl->setCurrentBlock("registration_link");
                 $this->tpl->setVariable("TXT_REGISTER", $lng->txt("register"));
                 $this->tpl->setVariable("LINK_REGISTER", $link_dir . "register.php?client_id=" . rawurlencode(CLIENT_ID) . "&lang=" . $ilias->account->getCurrentLanguage());
                 $this->tpl->parseCurrentBlock();
             }
             // language selection
             $selection = self::getLanguageSelection();
             if ($selection) {
                 // bs-patch start
                 global $ilUser, $lng;
                 $this->tpl->setVariable("TXT_LANGSELECT", $lng->txt("language"));
                 // bs-patch end
                 $this->tpl->setVariable("LANG_SELECT", $selection);
             }
             $this->tpl->setCurrentBlock("userisanonymous");
             $this->tpl->setVariable("TXT_NOT_LOGGED_IN", $lng->txt("not_logged_in"));
             $this->tpl->setVariable("TXT_LOGIN", $lng->txt("log_in"));
             // #13058
             $target_str = $this->getLoginTargetPar() != "" ? $this->getLoginTargetPar() : ilTemplate::buildLoginTarget();
             $this->tpl->setVariable("LINK_LOGIN", $link_dir . "login.php?target=" . $target_str . "&client_id=" . rawurlencode(CLIENT_ID) . "&cmd=force_login&lang=" . $ilias->account->getCurrentLanguage());
             $this->tpl->parseCurrentBlock();
         } else {
             if ($this->getMode() != self::MODE_TOPBAR_REDUCED) {
                 $notificationSettings = new ilSetting('notifications');
                 $chatSettings = new ilSetting('chatroom');
                 /**
                  * @var $tpl ilTemplate
                  */
                 global $tpl;
                 if ($chatSettings->get('chat_enabled') && $notificationSettings->get('enable_osd')) {
                     $this->tpl->touchBlock('osd_enabled');
                     $this->tpl->touchBlock('osd_container');
                     include_once "Services/jQuery/classes/class.iljQueryUtil.php";
                     iljQueryUtil::initjQuery();
                     include_once 'Services/MediaObjects/classes/class.ilPlayerUtil.php';
                     ilPlayerUtil::initMediaElementJs();
                     $tpl->addJavaScript('Services/Notifications/templates/default/notifications.js');
                     $tpl->addCSS('Services/Notifications/templates/default/osd.css');
                     require_once 'Services/Notifications/classes/class.ilNotificationOSDHandler.php';
                     require_once 'Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php';
                     $notifications = ilNotificationOSDHandler::getNotificationsForUser($ilUser->getId());
                     $this->tpl->setVariable('NOTIFICATION_CLOSE_HTML', json_encode(ilGlyphGUI::get(ilGlyphGUI::CLOSE, $lng->txt('close'))));
                     $this->tpl->setVariable('INITIAL_NOTIFICATIONS', json_encode($notifications));
                     $this->tpl->setVariable('OSD_POLLING_INTERVALL', $notificationSettings->get('osd_polling_intervall') ? $notificationSettings->get('osd_polling_intervall') : '5');
                     $this->tpl->setVariable('OSD_PLAY_SOUND', $chatSettings->get('play_invitation_sound') && $ilUser->getPref('chat_play_invitation_sound') ? 'true' : 'false');
                     foreach ($notifications as $notification) {
                         if ($notification['type'] == 'osd_maint') {
                             continue;
                         }
                         $this->tpl->setCurrentBlock('osd_notification_item');
                         $this->tpl->setVariable('NOTIFICATION_ICON_PATH', $notification['data']->iconPath);
                         $this->tpl->setVariable('NOTIFICATION_TITLE', $notification['data']->title);
                         $this->tpl->setVariable('NOTIFICATION_LINK', $notification['data']->link);
                         $this->tpl->setVariable('NOTIFICATION_LINKTARGET', $notification['data']->linktarget);
                         $this->tpl->setVariable('NOTIFICATION_ID', $notification['notification_osd_id']);
                         $this->tpl->setVariable('NOTIFICATION_SHORT_DESCRIPTION', $notification['data']->shortDescription);
                         $this->tpl->parseCurrentBlock();
                     }
                 }
             }
             $this->tpl->setCurrentBlock("userisloggedin");
             $this->tpl->setVariable("TXT_LOGIN_AS", $lng->txt("login_as"));
             $user_img_src = $ilias->account->getPersonalPicturePath("small", true);
             $user_img_alt = $ilias->account->getFullname();
             $this->tpl->setVariable("USER_IMG", ilUtil::img($user_img_src, $user_img_alt));
             $this->tpl->setVariable("USR_LINK_PROFILE", "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToProfile");
             $this->tpl->setVariable("USR_TXT_PROFILE", $lng->txt("personal_profile"));
             $this->tpl->setVariable("USR_LINK_SETTINGS", "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSettings");
             $this->tpl->setVariable("USR_TXT_SETTINGS", $lng->txt("personal_settings"));
             $this->tpl->setVariable("TXT_LOGOUT2", $lng->txt("logout"));
             $this->tpl->setVariable("LINK_LOGOUT2", $link_dir . "logout.php?lang=" . $ilias->account->getCurrentLanguage());
             $this->tpl->setVariable("USERNAME", $ilias->account->getFullname());
             $this->tpl->setVariable("LOGIN", $ilias->account->getLogin());
             $this->tpl->setVariable("MATRICULATION", $ilias->account->getMatriculation());
             $this->tpl->setVariable("EMAIL", $ilias->account->getEmail());
             $this->tpl->parseCurrentBlock();
         }
     } else {
         // member view info
         $this->tpl->setVariable("TOPBAR_CLASS", " ilMemberViewMainHeader");
         $this->tpl->setVariable("MEMBER_VIEW_INFO", $lng->txt("mem_view_long"));
     }
     if (!$this->topbar_back_url) {
         include_once "./Modules/SystemFolder/classes/class.ilObjSystemFolder.php";
         $header_top_title = ilObjSystemFolder::_getHeaderTitle();
         if (trim($header_top_title) != "" && $this->tpl->blockExists("header_top_title")) {
             $this->tpl->setCurrentBlock("header_top_title");
             $this->tpl->setVariable("TXT_HEADER_TITLE", $header_top_title);
             $this->tpl->parseCurrentBlock();
         }
     } else {
         $this->tpl->setCurrentBlock("header_back_bl");
         $this->tpl->setVariable("URL_HEADER_BACK", $this->topbar_back_url);
         $this->tpl->setVariable("TXT_HEADER_BACK", $this->topbar_back_caption ? $this->topbar_back_caption : $lng->txt("back"));
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
     if ($this->getMode() == self::MODE_FULL) {
         // $this->tpl->setVariable("TXT_LOGOUT", $lng->txt("logout"));
         $this->tpl->setVariable("HEADER_URL", $this->getHeaderURL());
         $this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.svg"));
     }
     include_once "./Modules/SystemFolder/classes/class.ilObjSystemFolder.php";
     // set link to return to desktop, not depending on a specific position in the hierarchy
     //$this->tpl->setVariable("SCRIPT_START", $this->getScriptTarget("start.php"));
     /*
     else
     {
     	$this->tpl->setVariable("HEADER_URL", $this->getHeaderURL());
     	$this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.svg"));
     }
     */
     $this->tpl->setVariable("TXT_MAIN_MENU", $lng->txt("main_menu"));
     $this->tpl->parseCurrentBlock();
 }
 /**
  *
  */
 protected function addBlockSorting()
 {
     if ($this->getSide() == IL_COL_CENTER && $this->getEnableMovement()) {
         /**
          * @var $ilBrowser ilBrowser
          * @var $tpl ilTemplate
          * @var $ilCtrl ilCtrl
          */
         global $ilBrowser, $tpl, $ilCtrl;
         include_once 'Services/jQuery/classes/class.iljQueryUtil.php';
         iljQueryUtil::initjQuery();
         iljQueryUtil::initjQueryUI();
         if ($ilBrowser->isMobile() || $ilBrowser->isIpad()) {
             $tpl->addJavaScript('./Services/jQuery/js/jquery.ui.touch-punch.min.js');
         }
         $tpl->addJavaScript('./Services/Block/js/block_sorting.js');
         // set the col_side parameter to pass the ctrl structure flow
         $ilCtrl->setParameter($this, 'col_side', IL_COL_CENTER);
         $this->tpl->setVariable('BLOCK_SORTING_STORAGE_URL', $ilCtrl->getLinkTarget($this, 'saveBlockSortingAsynch', '', true, false));
         $this->tpl->setVariable('BLOCK_COLUMNS', json_encode(array('il_left_col', 'il_right_col')));
         $this->tpl->setVariable('BLOCK_COLUMNS_SELECTOR', '#il_left_col,#il_right_col');
         $this->tpl->setVariable('BLOCK_COLUMNS_PARAMETERS', json_encode(array(IL_COL_LEFT, IL_COL_RIGHT)));
         // restore col_side parameter
         $ilCtrl->setParameter($this, 'col_side', $this->getSide());
     }
 }
    /**
     * Print View
     *
     * @param
     * @return
     */
    function printView()
    {
        global $ilAccess, $tpl;
        if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
            return;
        }
        $terms = array();
        switch ($_POST["sel_type"]) {
            case "glossary":
                $ts = $this->glossary->getTermList();
                foreach ($ts as $t) {
                    $terms[] = $t["id"];
                }
                break;
            case "sel_topic":
                include_once "./Services/Taxonomy/classes/class.ilObjTaxonomy.php";
                $t_id = $this->glossary->getTaxonomyId();
                $items = ilObjTaxonomy::getSubTreeItems("glo", $this->glossary->getId(), "term", $t_id, (int) $_POST["topic"]);
                foreach ($items as $i) {
                    if ($i["item_type"] == "term") {
                        $terms[] = $i["item_id"];
                    }
                }
                break;
            case "selection":
                if (is_array($_POST["obj_id"])) {
                    $terms = $_POST["obj_id"];
                } else {
                    $terms = array();
                }
                break;
            case "term":
                $terms = array($this->term_id);
                break;
        }
        $tpl = new ilTemplate("tpl.main.html", true, true);
        $tpl->setVariable("LOCATION_STYLESHEET", ilObjStyleSheet::getContentPrintStyle());
        /*
        		// syntax style
        		$this->tpl->setCurrentBlock("SyntaxStyle");
        		$this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
        			ilObjStyleSheet::getSyntaxStylePath());
        		$this->tpl->parseCurrentBlock();
        
        		// content style
        		$this->tpl->setCurrentBlock("ContentStyle");
        		$this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
        			ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
        		$this->tpl->parseCurrentBlock();*/
        include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
        iljQueryUtil::initjQuery($tpl);
        // determine target frames for internal links
        foreach ($terms as $t_id) {
            $page_content .= $this->listDefinitions($_GET["ref_id"], $t_id, true);
        }
        $tpl->setVariable("CONTENT", $page_content . '<script type="text/javascript" language="javascript1.2">
		<!--
			il.Util.addOnLoad(function () {
				il.Util.print();
			});
		//-->
		</script>');
        $tpl->show(false);
        exit;
    }
 /**
  * Show Editing Tree
  */
 function showTree()
 {
     global $ilUser, $ilias, $ilCtrl, $lng;
     $mtree = new ilTree($this->object->getId());
     $mtree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
     $mtree->setTreeTablePK("slm_id");
     if ($_POST["expandAll"] != "") {
         $_GET["scexpand"] = "";
         $stree = $mtree->getSubTree($mtree->getNodeData($mtree->readRootId()));
         $n_arr = array();
         foreach ($stree as $n) {
             $n_arr[] = $n["child"];
         }
         $_SESSION["scexpand"] = $n_arr;
     }
     if ($_POST["collapseAll"] != "") {
         $_GET["scexpand"] = "";
         $_SESSION["scexpand"] = array($mtree->readRootId());
     }
     $this->tpl = new ilTemplate("tpl.main.html", true, true);
     $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
     $ilCtrl->setParameter($this, "active_node", $_GET["active_node"]);
     $this->tpl->addBlockFile("CONTENT", "content", "tpl.explorer.html");
     $this->tpl->setVariable("IMG_SPACE", ilUtil::getImagePath("spacer.png", false));
     $this->tpl->setCurrentBlock("exp2_button");
     $this->tpl->setVariable("CMD_EXP2_BTN", "expandAll");
     $this->tpl->setVariable("TXT_EXP2_BTN", $lng->txt("expand_all"));
     $this->tpl->parseCurrentBlock();
     $this->tpl->setCurrentBlock("exp2_button");
     $this->tpl->setVariable("CMD_EXP2_BTN", "collapseAll");
     $this->tpl->setVariable("TXT_EXP2_BTN", $lng->txt("collapse_all"));
     $this->tpl->parseCurrentBlock();
     require_once "./Modules/Scorm2004/classes/class.ilSCORM2004EditorExplorer.php";
     $exp = new ilSCORM2004EditorExplorer($this->ctrl->getLinkTarget($this, "edit"), $this->object);
     $exp->setFrameUpdater("content", "ilHierarchyFormUpdater");
     $exp->setTargetGet("obj_id");
     $exp->setExpandTarget($this->ctrl->getLinkTarget($this, "showTree"));
     if ($_GET["scexpand"] == "") {
         $expanded = $mtree->readRootId();
     } else {
         $expanded = $_GET["scexpand"];
     }
     //echo "-".$_GET["active_node"]."-";
     if ($_GET["active_node"] != "") {
         $path = $mtree->getPathId($_GET["active_node"]);
         $exp->setForceOpenPath($path);
         $exp->highlightNode($_GET["active_node"]);
     }
     $exp->setExpand($expanded);
     // build html-output
     $exp->setOutput(0);
     $output = $exp->getOutput();
     // asynchronous output
     if ($ilCtrl->isAsynch()) {
         echo $output;
         exit;
     }
     $this->tpl->setCurrentBlock("content");
     $this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("sahs_organization"));
     $this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh"));
     $this->tpl->setVariable("EXPLORER", $output);
     $this->ctrl->setParameter($this, "scexpand", $_GET["scexpand"]);
     $this->tpl->setVariable("ACTION", $this->ctrl->getLinkTarget($this, "showTree"));
     $this->tpl->parseCurrentBlock();
     include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
     iljQueryUtil::initjQuery($this->tpl);
     $this->tpl->show(false);
     exit;
 }
 /**
  * display tree view
  */
 function showTree()
 {
     global $ilCtrl, $tree, $ilSetting, $lng;
     $ilCtrl->setParameter($this, "active_node", $_GET["active_node"]);
     $this->tpl = new ilTemplate("tpl.main.html", true, true);
     $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
     $this->tpl->addBlockFile("CONTENT", "content", "tpl.explorer.html");
     include_once "./Services/Repository/classes/class.ilRepositoryExplorer.php";
     $active_node = $_GET["active_node"] > 1 ? $_GET["active_node"] : $_GET["ref_id"] > 1 ? $_GET["ref_id"] : 0;
     $top_node = 0;
     if ($ilSetting->get("rep_tree_limit_grp_crs") && $active_node > 0) {
         $path = $tree->getPathId($active_node);
         foreach ($path as $n) {
             if ($top_node > 0) {
                 break;
             }
             if (in_array(ilObject::_lookupType(ilObject::_lookupObjId($n)), array("crs", "grp"))) {
                 $top_node = $n;
             }
         }
     }
     $exp = new ilRepositoryExplorer("ilias.php?baseClass=ilRepositoryGUI&amp;cmd=goto", $top_node);
     $exp->setUseStandardFrame(false);
     $exp->setExpandTarget($ilCtrl->getLinkTarget($this, "showTree"));
     $exp->setFrameUpdater("tree", "updater");
     $exp->setTargetGet("ref_id");
     if ($_GET["repexpand"] == "") {
         $expanded = $this->tree->readRootId();
     } else {
         $expanded = $_GET["repexpand"];
     }
     $exp->setExpand($expanded);
     if ($active_node > 0) {
         $path = $tree->getPathId($active_node);
         if ($top_node > 0) {
             $exp->setForceOpenPath($path);
             $exp->setExpand($expanded);
         } else {
             $exp->setForceOpenPath($path + array($top_node));
         }
         $exp->highlightNode($active_node);
     }
     // build html-output
     if ($top_node > 0) {
         $head_tpl = new ilTemplate("tpl.cont_tree_head.html", true, true, "Services/Repository");
         $path = ilObject::_getIcon(ROOT_FOLDER_ID, "tiny", "root");
         $nd = $tree->getNodeData(ROOT_FOLDER_ID);
         $title = $nd["title"];
         if ($title == "ILIAS") {
             $title = $lng->txt("repository");
         }
         $head_tpl->setVariable("IMG_SRC", $path);
         $head_tpl->setVariable("ALT_IMG", $lng->txt("icon") . " " . $title);
         $head_tpl->setVariable("LINK_TXT", $title);
         $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", "1");
         $head_tpl->setVariable("LINK_HREF", $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset"));
         $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
         $exp->setTreeLead($head_tpl->get());
         $exp->initItemCounter(1);
         $exp->setOutput($tree->getParentId($top_node), 1, ilObject::_lookupObjId($tree->getParentId($top_node)));
     } else {
         $exp->setOutput(0);
     }
     $output = $exp->getOutput(false);
     //if ($GLOBALS["ilUser"]->getLogin() == "alex") echo "topnode:$top_node:activenode:$active_node:";
     // asynchronous output
     if ($ilCtrl->isAsynch()) {
         echo $output;
         exit;
     }
     $this->tpl->setCurrentBlock("content");
     $this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("overview"));
     $this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh"));
     $this->tpl->setVariable("EXPLORER", $output);
     $ilCtrl->setParameter($this, "repexpand", $_GET["repexpand"]);
     $this->tpl->setVariable("ACTION", $ilCtrl->getLinkTarget($this, "showTree", "", false, false));
     $this->tpl->parseCurrentBlock();
     include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
     iljQueryUtil::initjQuery($this->tpl);
     $this->tpl->show(false);
     exit;
 }
Example #15
0
 /**
  * This method enriches the global template with some user interface elements (language selection, headlines, back buttons, ...) for public service views
  * @param mixed   $a_tmpl The template file as a string of as an array (index 0: template file, index 1: template directory)
  * @param bool    $a_show_back
  * @param bool    $a_show_logout
  */
 public static function initStartUpTemplate($a_tmpl, $a_show_back = false, $a_show_logout = false)
 {
     /**
      * @var $tpl       ilTemplate
      * @var $lng       ilLanguage
      * @var $ilCtrl    ilCtrl
      * @var $ilSetting ilSetting
      * @var $ilAccess  ilAccessHandler
      */
     global $tpl, $lng, $ilCtrl, $ilSetting, $ilAccess;
     // #13574 - basic.js is included with ilTemplate, so jQuery is needed, too
     include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
     iljQueryUtil::initjQuery();
     // framework is needed for language selection
     include_once "./Services/UICore/classes/class.ilUIFramework.php";
     ilUIFramework::init();
     $tpl->addBlockfile('CONTENT', 'content', 'tpl.startup_screen.html', 'Services/Init');
     $tpl->setVariable('HEADER_ICON', ilUtil::getImagePath('HeaderIcon.svg'));
     if ($a_show_back) {
         // #13400
         $param = 'client_id=' . $_COOKIE['ilClientId'] . '&lang=' . $lng->getLangKey();
         $tpl->setCurrentBlock('link_item_bl');
         $tpl->setVariable('LINK_TXT', $lng->txt('login_to_ilias'));
         $tpl->setVariable('LINK_URL', 'login.php?cmd=force_login&' . $param);
         $tpl->parseCurrentBlock();
         if ($ilSetting->get('pub_section') && $ilAccess->checkAccessOfUser(ANONYMOUS_USER_ID, 'read', '', ROOT_FOLDER_ID)) {
             $tpl->setVariable('LINK_URL', 'index.php?' . $param);
             $tpl->setVariable('LINK_TXT', $lng->txt('home'));
             $tpl->parseCurrentBlock();
         }
     } else {
         if ($a_show_logout) {
             $tpl->setCurrentBlock('link_item_bl');
             $tpl->setVariable('LINK_TXT', $lng->txt('logout'));
             $tpl->setVariable('LINK_URL', ILIAS_HTTP_PATH . '/logout.php');
             $tpl->parseCurrentBlock();
         }
     }
     if (is_array($a_tmpl)) {
         $template_file = $a_tmpl[0];
         $template_dir = $a_tmpl[1];
     } else {
         $template_file = $a_tmpl;
         $template_dir = 'Services/Init';
     }
     //Header Title
     include_once "./Modules/SystemFolder/classes/class.ilObjSystemFolder.php";
     $header_top_title = ilObjSystemFolder::_getHeaderTitle();
     if (trim($header_top_title) != "" && $tpl->blockExists("header_top_title")) {
         $tpl->setCurrentBlock("header_top_title");
         $tpl->setVariable("TXT_HEADER_TITLE", $header_top_title);
         $tpl->parseCurrentBlock();
     }
     // language selection
     $selection = self::getLanguageSelection();
     if ($selection) {
         $tpl->setCurrentBlock("lang_select");
         $tpl->setVariable("TXT_LANGSELECT", $lng->txt("language"));
         $tpl->setVariable("LANG_SELECT", $selection);
         $tpl->parseCurrentBlock();
     }
     $tpl->addBlockFile('STARTUP_CONTENT', 'startup_content', $template_file, $template_dir);
 }
 function getTestOutput($active_id, $pass = NULL, $is_postponed = FALSE, $user_post_solution = FALSE)
 {
     // shuffle output
     $keys = array();
     if (is_array($user_post_solution)) {
         $keys = $_SESSION["ordering_keys"];
     } else {
         $keys = array_keys($this->object->answers);
         shuffle($keys);
     }
     $_SESSION["ordering_keys"] = $keys;
     // generate the question output
     include_once "./Services/UICore/classes/class.ilTemplate.php";
     $template = new ilTemplate("tpl.il_as_qpl_ordering_output.html", TRUE, TRUE, "Modules/TestQuestionPool");
     if ($this->object->getOrderingType() == OQ_NESTED_TERMS || $this->object->getOrderingType() == OQ_NESTED_PICTURES) {
         $this->object->setOutputType(OUTPUT_JAVASCRIPT);
         include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
         include_once 'Modules/TestQuestionPool/classes/class.ilNestedOrderingGUI.php';
         $answers = new ilNestedOrderingGUI($this->lng->txt("answers"), "answers");
         $answers->setOrderingType($this->object->getOrderingType());
         $shuffle = 1;
         $answers->setObjAnswersArray($this->object->answers, $shuffle);
         if ($this->object->getOrderingType() == OQ_NESTED_PICTURES) {
             $answers->setImagePath($this->object->getImagePath());
             $answers->setImagePathWeb($this->object->getImagePathWeb());
             $answers->setThumbPrefix($this->object->getThumbPrefix());
         }
         $template->setCurrentBlock('nested_ordering_output');
         $template->setVariable('NESTED_ORDERING', $answers->getHtml($shuffle));
         $template->parseCurrentBlock();
         $questiontext = $this->object->getQuestion();
         $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
         $questionoutput = $template->get();
         $pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput);
         return $pageoutput;
     } else {
         if ($this->object->getOutputType() == OUTPUT_JAVASCRIPT) {
             // BEGIN: add javascript code for javascript enabled ordering questions
             $this->tpl->addBlockFile("CONTENT_BLOCK", "head_content", "tpl.il_as_qpl_ordering_output_javascript.html", "Modules/TestQuestionPool");
             $this->tpl->touchBlock("head_content");
             require_once 'Services/jQuery/classes/class.iljQueryUtil.php';
             iljQueryUtil::initjQuery();
             iljQueryUtil::initjQueryUI();
             // END: add javascript code for javascript enabled ordering questions
             // BEGIN: add additional stylesheet for javascript enabled ordering questions
             $this->tpl->setCurrentBlock("AdditionalStyle");
             $this->tpl->setVariable("LOCATION_ADDITIONAL_STYLESHEET", ilUtil::getStyleSheetLocation("output", "test_javascript.css", "Modules/TestQuestionPool"));
             $this->tpl->parseCurrentBlock();
             // END: add additional stylesheet for javascript enabled ordering questions
             // BEGIN: onsubmit form action for javascript enabled ordering questions
             $this->tpl->setVariable("ON_SUBMIT", "return saveOrder('orderlist');");
             // END: onsubmit form action for javascript enabled ordering questions
         }
         // get the solution of the user for the active pass or from the last pass if allowed
         if ($active_id) {
             $solutions = NULL;
             include_once "./Modules/Test/classes/class.ilObjTest.php";
             if (!ilObjTest::_getUsePreviousAnswers($active_id, true)) {
                 if (is_null($pass)) {
                     $pass = ilObjTest::_getPass($active_id);
                 }
             }
             if (is_array($user_post_solution)) {
                 $solutions = array();
                 foreach ($user_post_solution as $key => $value) {
                     if (preg_match("/order_(\\d+)/", $key, $matches)) {
                         foreach ($this->object->getAnswers() as $answeridx => $answer) {
                             if ($answer->getRandomID() == $matches[1]) {
                                 array_push($solutions, array("value1" => $answeridx, "value2" => $value));
                             }
                         }
                     }
                 }
             } else {
                 $solutions =& $this->object->getSolutionValues($active_id, $pass);
             }
             if ($this->object->getOutputType() == OUTPUT_JAVASCRIPT) {
                 $solution_script .= "";
                 $jssolutions = array();
                 foreach ($solutions as $idx => $solution_value) {
                     if (strcmp($solution_value["value2"], "") != 0 && strcmp($solution_value["value1"], "") != 0) {
                         $jssolutions[$solution_value["value2"]] = $solution_value["value1"];
                     }
                 }
                 if (count($jssolutions)) {
                     ksort($jssolutions);
                     $js = "";
                     foreach ($jssolutions as $key => $value) {
                         if (is_object($this->object->getAnswer($value))) {
                             $js .= "initialorder.push('id_" . $this->object->getAnswer($value)->getRandomID() . "');";
                         }
                     }
                     $js .= "restoreInitialOrder();";
                 }
                 if (strlen($js)) {
                     $template->setCurrentBlock("javascript_restore_order");
                     $template->setVariable("RESTORE_ORDER", $js);
                     $template->parseCurrentBlock();
                 }
             }
         }
         if ($this->object->getOutputType() != OUTPUT_JAVASCRIPT) {
             foreach ($keys as $idx) {
                 $answer = $this->object->answers[$idx];
                 if ($this->object->getOrderingType() == OQ_PICTURES) {
                     $template->setCurrentBlock("ordering_row_standard_pictures");
                     $template->setVariable("PICTURE_HREF", $this->object->getImagePathWeb() . $answer->getAnswertext());
                     $thumbweb = $this->object->getImagePathWeb() . $this->object->getThumbPrefix() . $answer->getAnswertext();
                     $thumb = $this->object->getImagePath() . $this->object->getThumbPrefix() . $answer->getAnswertext();
                     if (!@file_exists($thumb)) {
                         $this->object->rebuildThumbnails();
                     }
                     $template->setVariable("THUMB_HREF", $thumbweb);
                     $template->setVariable("THUMB_ALT", $this->lng->txt("thumbnail"));
                     $template->setVariable("THUMB_TITLE", $this->lng->txt("enlarge"));
                     $template->setVariable("ANSWER_ID", $answer->getRandomID());
                     $template->parseCurrentBlock();
                 } else {
                     $template->setCurrentBlock("ordering_row_standard_text");
                     $template->setVariable("ANSWER_TEXT", $this->object->prepareTextareaOutput($answer->getAnswertext(), TRUE));
                     $template->setVariable("ANSWER_ID", $answer->getRandomID());
                     $template->parseCurrentBlock();
                 }
                 $template->setCurrentBlock("ordering_row_standard");
                 $template->setVariable("ANSWER_ID", $answer->getRandomID());
                 if (is_array($solutions)) {
                     foreach ($solutions as $solution) {
                         if ($solution["value1"] == $idx && strlen($solution["value2"])) {
                             $template->setVariable("ANSWER_ORDER", " value=\"" . $solution["value2"] . "\"");
                         }
                     }
                 }
                 $template->parseCurrentBlock();
             }
         } else {
             foreach ($keys as $idx) {
                 $answer = $this->object->answers[$idx];
                 if ($this->object->getOrderingType() == OQ_PICTURES) {
                     $template->setCurrentBlock("ordering_row_javascript_pictures");
                     $template->setVariable("PICTURE_HREF", $this->object->getImagePathWeb() . $answer->getAnswertext());
                     $thumbweb = $this->object->getImagePathWeb() . $this->object->getThumbPrefix() . $answer->getAnswertext();
                     $thumb = $this->object->getImagePath() . $this->object->getThumbPrefix() . $answer->getAnswertext();
                     if (!@file_exists($thumb)) {
                         $this->object->rebuildThumbnails();
                     }
                     $template->setVariable("THUMB_HREF", $thumbweb);
                     $template->setVariable("THUMB_ALT", $this->lng->txt("thumbnail"));
                     $template->setVariable("THUMB_TITLE", $this->lng->txt("thumbnail"));
                     $template->setVariable("ENLARGE_HREF", ilUtil::getImagePath("enlarge.png", FALSE));
                     $template->setVariable("ENLARGE_ALT", $this->lng->txt("enlarge"));
                     $template->setVariable("ENLARGE_TITLE", $this->lng->txt("enlarge"));
                     $template->setVariable("ANSWER_ID", $answer->getRandomID());
                     $template->parseCurrentBlock();
                 } else {
                     $template->setCurrentBlock("ordering_row_javascript_text");
                     $template->setVariable("ANSWER_TEXT", $this->object->prepareTextareaOutput($answer->getAnswertext(), TRUE));
                     $template->setVariable("ANSWER_ID", $answer->getRandomID());
                     $template->parseCurrentBlock();
                 }
             }
             $template->setCurrentBlock("ordering_with_javascript");
             if ($this->object->getOrderingType() == OQ_PICTURES) {
                 $template->setVariable("RESET_POSITIONS", $this->lng->txt("reset_pictures"));
             } else {
                 $template->setVariable("RESET_POSITIONS", $this->lng->txt("reset_definitions"));
             }
             $template->parseCurrentBlock();
         }
         $questiontext = $this->object->getQuestion();
         $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
         $questionoutput = $template->get();
         $pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput);
         return $pageoutput;
     }
 }
 /**
  * Execute Command
  */
 public function executeCommand()
 {
     global $ilUser, $ilDB, $ilPluginAdmin, $lng, $ilTabs;
     $ilTabs->clearTargets();
     $cmd = $this->ctrl->getCmd();
     $next_class = $this->ctrl->getNextClass($this);
     $this->ctrl->saveParameter($this, "sequence");
     $this->ctrl->saveParameter($this, "active_id");
     if (preg_match("/^gotoquestion_(\\d+)\$/", $cmd, $matches)) {
         $cmd = "gotoquestion";
         if (strlen($matches[1])) {
             $this->ctrl->setParameter($this, 'gotosequence', $matches[1]);
         }
     }
     $testSessionFactory = new ilTestSessionFactory($this->object);
     $this->testSession = $testSessionFactory->getSession($_GET['active_id']);
     $this->ensureExistingTestSession($this->testSession);
     $this->initProcessLocker($this->testSession->getActiveId());
     $testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $this->object);
     $this->testSequence = $testSequenceFactory->getSequence($this->testSession);
     $this->testSequence->loadFromDb();
     $this->testSequence->loadQuestions();
     include_once 'Services/jQuery/classes/class.iljQueryUtil.php';
     iljQueryUtil::initjQuery();
     include_once "./Services/YUI/classes/class.ilYuiUtil.php";
     ilYuiUtil::initConnectionWithAnimation();
     $this->handlePasswordProtectionRedirect();
     $cmd = $this->getCommand($cmd);
     switch ($next_class) {
         case 'ilassquestionpagegui':
             $questionId = $this->testSequence->getQuestionForSequence($this->calculateSequence());
             require_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php";
             $page_gui = new ilAssQuestionPageGUI($questionId);
             $ret = $this->ctrl->forwardCommand($page_gui);
             break;
         case 'iltestsubmissionreviewgui':
             require_once './Modules/Test/classes/class.ilTestSubmissionReviewGUI.php';
             $gui = new ilTestSubmissionReviewGUI($this, $this->object, $this->testSession);
             $ret = $this->ctrl->forwardCommand($gui);
             break;
         case 'ilassquestionhintrequestgui':
             $questionGUI = $this->object->createQuestionGUI("", $this->testSequence->getQuestionForSequence($this->calculateSequence()));
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
             $questionHintTracking = new ilAssQuestionHintTracking($questionGUI->object->getId(), $this->testSession->getActiveId(), $this->testSession->getPass());
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
             $gui = new ilAssQuestionHintRequestGUI($this, 'redirectQuestion', $questionGUI, $questionHintTracking);
             $ret = $this->ctrl->forwardCommand($gui);
             break;
         case 'iltestsignaturegui':
             require_once './Modules/Test/classes/class.ilTestSignatureGUI.php';
             $gui = new ilTestSignatureGUI($this);
             $ret = $this->ctrl->forwardCommand($gui);
             break;
         case 'iltestpasswordprotectiongui':
             require_once 'Modules/Test/classes/class.ilTestPasswordProtectionGUI.php';
             $gui = new ilTestPasswordProtectionGUI($this->ctrl, $this->tpl, $this->lng, $this, $this->passwordChecker);
             $ret = $this->ctrl->forwardCommand($gui);
             break;
         default:
             $cmd .= 'Cmd';
             $ret =& $this->{$cmd}();
             break;
     }
     return $ret;
 }
Example #18
0
 function getStandardTemplate()
 {
     // always load jQuery
     include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
     iljQueryUtil::initjQuery();
     // always load ui framework
     include_once "./Services/UICore/classes/class.ilUIFramework.php";
     ilUIFramework::init();
     // always load Basic js
     //		$this->addJavaScript("./Services/JavaScript/js/Basic.js",
     //			true, 1);
     $this->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
     $this->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
 }
Example #19
0
 /**
  * Constructor
  *  
  */
 function ilSetupGUI()
 {
     global $tpl, $lng;
     $this->tpl = $tpl;
     $this->lng = $lng;
     // note: this is currently only used for subtabs, alex 8.1.2012
     include_once "./Services/UIComponent/Tabs/classes/class.ilTabsGUI.php";
     $this->tabs = new ilTabsGUI();
     $this->tabs->setSetupMode(true);
     include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
     iljQueryUtil::initjQuery($this->tpl);
     include_once "./Services/YUI/classes/class.ilYuiUtil.php";
     ilYuiUtil::initDomEvent();
     // CVS - REVISION - DO NOT MODIFY
     $this->revision = '$Revision$';
     $this->version = "2 " . substr(substr($this->revision, 1), 0, -2);
     $this->lang = $this->lng->lang_key;
     // init setup
     $this->setup = new ilSetup($_SESSION["auth"], $_SESSION["access_mode"]);
     // init client object if exists
     $client_id = $_GET["client_id"] ? $_GET["client_id"] : $_SESSION["ClientId"];
     if ($_POST["client_id"] != "") {
         $client_id = $_POST["client_id"];
     }
     /*if ($_POST["client_id"] == "")
     {		
     echo "<br>+".$_GET["client_id"];
     echo "<br>+".$_POST["client_id"];
     echo "<br>+".$_SESSION["ClientId"];
     echo "<br>+".$client_id;
     }*/
     // for security
     if (!$this->setup->isAdmin() and $client_id != $_SESSION["ClientId"]) {
         $client_id = $_SESSION["ClientId"];
     }
     $this->client_id = $client_id;
     $this->setup->ini_client_exists = $this->setup->newClient($client_id);
     if (is_object($this->setup->getClient())) {
         $this->setup->getClient()->status = $this->setup->getStatus($client_id);
     }
     // determine command
     if (($this->cmd = $_GET["cmd"]) == "gateway") {
         // surpress warning if POST is not set
         @($this->cmd = key($_POST["cmd"]));
     }
     // determine display mode here
     // TODO: depending on previous setting (session)
     // OR switch to 'setup'-mode if someone logs in as client and client's setup wasn't finished (-> entry in settings table does not exist)
     if ($this->setup->isAuthenticated() and !$this->setup->getClient()->status["finish"]["status"] and $this->cmd != "clientlist" and $this->cmd != "") {
         $this->setDisplayMode("setup");
     } else {
         $this->setDisplayMode($_SESSION["display_mode"]);
     }
     // output starts here
     // main cmd handling
     if (!$this->setup->isAuthenticated() or !$this->setup->isInstalled()) {
         // check for first time installation or migrate an old one first
         if (!$this->setup->isInstalled() or !$this->setup->ini->readVariable("clients", "path")) {
             $this->cmdInstall();
         } else {
             if ($this->cmd == "performLogin" || $this->cmd == "performMLogin") {
                 $cmd = $this->cmd;
                 $this->{$cmd}();
             } else {
                 $this->displayLogin();
             }
         }
     } else {
         if ($this->setup->isAdmin()) {
             $this->cmdAdmin();
         } else {
             $this->cmdClient();
         }
     }
     // display header
     $this->displayHeader();
     if (DEBUG) {
         echo "cmd: " . $this->cmd . " | access: " . $this->setup->access_mode . " | display: " . $this->display_mode;
         var_dump($this->setup->getClient()->status);
     }
     // display footer
     $this->displayFooter();
     // end output
 }
Example #20
0
 /**
  * display content of page
  */
 function showPage()
 {
     global $tree, $ilUser, $lng, $ilCtrl, $ilSetting, $ilTabs;
     // jquery and jquery ui are always provided for components
     include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
     iljQueryUtil::initjQuery();
     iljQueryUtil::initjQueryUI();
     //		$this->initSelfAssessmentRendering();
     include_once "./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php";
     ilObjMediaObjectGUI::includePresentationJS($GLOBALS["tpl"]);
     $GLOBALS["tpl"]->addJavaScript("./Services/COPage/js/ilCOPagePres.js");
     // needed for overlays in iim
     include_once "./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
     ilOverlayGUI::initJavascript();
     include_once "./Services/MediaObjects/classes/class.ilPlayerUtil.php";
     ilPlayerUtil::initMediaElementJs($GLOBALS["tpl"]);
     // init template
     //if($this->outputToTemplate())
     //{
     if ($this->getOutputMode() == "edit") {
         //echo ":".$this->getTemplateTargetVar().":";
         $tpl = new ilTemplate("tpl.page_edit_wysiwyg.html", true, true, "Services/COPage");
         //$this->tpl->addBlockFile($this->getTemplateTargetVar(), "adm_content", "tpl.page_edit_wysiwyg.html", "Services/COPage");
         // to do: status dependent class
         $tpl->setVariable("CLASS_PAGE_TD", "ilc_Page");
         // user comment
         if ($this->isEnabledChangeComments()) {
             $tpl->setCurrentBlock("change_comment");
             $tpl->setVariable("TXT_ADD_COMMENT", $this->lng->txt("cont_add_change_comment"));
             $tpl->parseCurrentBlock();
         }
         $tpl->setVariable("WYSIWYG_ACTION", $ilCtrl->getFormActionByClass("ilpageeditorgui", "", "", true));
         // determine media, html and javascript mode
         $sel_media_mode = $ilUser->getPref("ilPageEditor_MediaMode") == "disable" ? "disable" : "enable";
         $sel_html_mode = $ilUser->getPref("ilPageEditor_HTMLMode") == "disable" ? "disable" : "enable";
         $sel_js_mode = "disable";
         //if($ilSetting->get("enable_js_edit", 1))
         //{
         $sel_js_mode = ilPageEditorGUI::_doJSEditing() ? "enable" : "disable";
         //}
         // show prepending html
         $tpl->setVariable("PREPENDING_HTML", $this->getPrependingHtml());
         $tpl->setVariable("TXT_CONFIRM_DELETE", $lng->txt("cont_confirm_delete"));
         // presentation view
         if ($this->getViewPageLink() != "") {
             $ilTabs->addNonTabbedLink("pres_view", $this->lng->txt("cont_presentation_view"), $this->getViewPageLink(), $this->getViewPageTarget());
         }
         // show actions drop down
         $this->addActionsMenu($tpl, $sel_media_mode, $sel_html_mode, $sel_js_mode);
         // get js files for JS enabled editing
         if ($sel_js_mode == "enable") {
             $this->insertHelp($tpl);
             include_once "./Services/YUI/classes/class.ilYuiUtil.php";
             ilYuiUtil::initDragDrop();
             ilYuiUtil::initConnection();
             ilYuiUtil::initPanel(false);
             $GLOBALS["tpl"]->addJavaScript("./Services/COPage/js/ilcopagecallback.js");
             $GLOBALS["tpl"]->addJavascript("Services/COPage/js/page_editing.js");
             include_once './Services/Style/classes/class.ilObjStyleSheet.php';
             $GLOBALS["tpl"]->addOnloadCode("var preloader = new Image();\n\t\t\t\t\t\tpreloader.src = './templates/default/images/loader.svg';\n\t\t\t\t\t\tilCOPage.setContentCss('" . ilObjStyleSheet::getContentStylePath((int) $this->getStyleId()) . ", " . ilUtil::getStyleSheetLocation() . ", ./Services/COPage/css/tiny_extra.css" . "')");
             //$GLOBALS["tpl"]->addJavascript("Services/RTE/tiny_mce_3_3_9_2/il_tiny_mce_src.js");
             $GLOBALS["tpl"]->addJavascript("Services/COPage/tiny/4_1_5/tinymce.js");
             $tpl->touchBlock("init_dragging");
             $cfg = $this->getPageConfig();
             $tpl->setVariable("IL_TINY_MENU", self::getTinyMenu($this->getPageObject()->getParentType(), $cfg->getEnableInternalLinks(), $cfg->getEnableWikiLinks(), $cfg->getEnableKeywords(), $this->getStyleId(), true, true, $cfg->getEnableAnchors()));
             // add int link parts
             include_once "./Services/Link/classes/class.ilInternalLinkGUI.php";
             $tpl->setCurrentBlock("int_link_prep");
             $tpl->setVariable("INT_LINK_PREP", ilInternalLinkGUI::getInitHTML($ilCtrl->getLinkTargetByClass(array("ilpageeditorgui", "ilinternallinkgui"), "", false, true, false)));
             $tpl->parseCurrentBlock();
             include_once "./Services/YUI/classes/class.ilYuiUtil.php";
             ilYuiUtil::initConnection();
             $GLOBALS["tpl"]->addJavaScript("./Services/UIComponent/Explorer/js/ilExplorer.js");
         }
         // multiple actions
         $cnt_pcs = $this->getPageObject()->countPageContents();
         if ($cnt_pcs > 1 || $this->getPageObject()->getParentType() != "qpl" && $cnt_pcs > 0) {
             $tpl->setCurrentBlock("multi_actions");
             if ($sel_js_mode == "enable") {
                 $tpl->setVariable("ONCLICK_DE_ACTIVATE_SELECTED", 'onclick="return ilEditMultiAction(\'activateSelected\');"');
                 $tpl->setVariable("ONCLICK_DELETE_SELECTED", 'onclick="return ilEditMultiAction(\'deleteSelected\');"');
                 $tpl->setVariable("ONCLICK_ASSIGN_CHARACTERISTIC", 'onclick="return ilEditMultiAction(\'assignCharacteristicForm\');"');
                 $tpl->setVariable("ONCLICK_COPY_SELECTED", 'onclick="return ilEditMultiAction(\'copySelected\');"');
                 $tpl->setVariable("ONCLICK_CUT_SELECTED", 'onclick="return ilEditMultiAction(\'cutSelected\');"');
                 $tpl->setVariable("TXT_SELECT_ALL", $this->lng->txt("select_all"));
                 $tpl->setVariable("ONCLICK_SELECT_ALL", 'onclick="return ilEditMultiAction(\'selectAll\');"');
             }
             $tpl->setVariable("TXT_DE_ACTIVATE_SELECTED", $this->lng->txt("cont_ed_enable"));
             $tpl->setVariable("TXT_ASSIGN_CHARACTERISTIC", $this->lng->txt("cont_assign_characteristic"));
             $tpl->setVariable("TXT_DELETE_SELECTED", $this->lng->txt("cont_delete_selected"));
             $tpl->setVariable("TXT_COPY_SELECTED", $this->lng->txt("copy"));
             $tpl->setVariable("TXT_CUT_SELECTED", $this->lng->txt("cut"));
             $tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.svg"));
             $tpl->parseCurrentBlock();
         }
     } else {
         // presentation or preview here
         $tpl = new ilTemplate("tpl.page.html", true, true, "Services/COPage");
         if ($this->getEnabledPageFocus()) {
             $tpl->touchBlock("page_focus");
         }
         include_once "./Services/User/classes/class.ilUserUtil.php";
         // presentation
         if ($this->isPageContainerToBeRendered()) {
             $tpl->touchBlock("page_container_1");
             $tpl->touchBlock("page_container_2");
             $tpl->touchBlock("page_container_3");
         }
         // history
         $c_old_nr = $this->getPageObject()->old_nr;
         if ($c_old_nr > 0 || $this->getCompareMode() || $_GET["history_mode"] == 1) {
             $hist_info = $this->getPageObject()->getHistoryInfo($c_old_nr);
             if (!$this->getCompareMode()) {
                 $ilCtrl->setParameter($this, "history_mode", "1");
                 // previous revision
                 if (is_array($hist_info["previous"])) {
                     $tpl->setCurrentBlock("previous_rev");
                     $tpl->setVariable("TXT_PREV_REV", $lng->txt("cont_previous_rev"));
                     $ilCtrl->setParameter($this, "old_nr", $hist_info["previous"]["nr"]);
                     $tpl->setVariable("HREF_PREV", $ilCtrl->getLinkTarget($this, "preview"));
                     $tpl->parseCurrentBlock();
                 } else {
                     $tpl->setCurrentBlock("previous_rev_disabled");
                     $tpl->setVariable("TXT_PREV_REV", $lng->txt("cont_previous_rev"));
                     $tpl->parseCurrentBlock();
                 }
                 // next revision
                 if ($c_old_nr > 0) {
                     $tpl->setCurrentBlock("next_rev");
                     $tpl->setVariable("TXT_NEXT_REV", $lng->txt("cont_next_rev"));
                     $ilCtrl->setParameter($this, "old_nr", $hist_info["next"]["nr"]);
                     $tpl->setVariable("HREF_NEXT", $ilCtrl->getLinkTarget($this, "preview"));
                     $tpl->parseCurrentBlock();
                     // latest revision
                     $tpl->setCurrentBlock("latest_rev");
                     $tpl->setVariable("TXT_LATEST_REV", $lng->txt("cont_latest_rev"));
                     $ilCtrl->setParameter($this, "old_nr", "");
                     $tpl->setVariable("HREF_LATEST", $ilCtrl->getLinkTarget($this, "preview"));
                     $tpl->parseCurrentBlock();
                 }
                 $ilCtrl->setParameter($this, "history_mode", "");
                 // rollback
                 if ($c_old_nr > 0 && $ilUser->getId() != ANONYMOUS_USER_ID) {
                     $tpl->setCurrentBlock("rollback");
                     $ilCtrl->setParameter($this, "old_nr", $c_old_nr);
                     $tpl->setVariable("HREF_ROLLBACK", $ilCtrl->getLinkTarget($this, "rollbackConfirmation"));
                     $ilCtrl->setParameter($this, "old_nr", "");
                     $tpl->setVariable("TXT_ROLLBACK", $lng->txt("cont_rollback"));
                     $tpl->parseCurrentBlock();
                 }
             }
             $tpl->setCurrentBlock("hist_nav");
             $tpl->setVariable("TXT_REVISION", $lng->txt("cont_revision"));
             $tpl->setVariable("VAL_REVISION_DATE", ilDatePresentation::formatDate(new ilDateTime($hist_info["current"]["hdate"], IL_CAL_DATETIME)));
             $tpl->setVariable("VAL_REV_USER", ilUserUtil::getNamePresentation($hist_info["current"]["user_id"]));
             $tpl->parseCurrentBlock();
         }
     }
     if ($this->getOutputMode() != IL_PAGE_PRESENTATION && $this->getOutputMode() != IL_PAGE_OFFLINE && $this->getOutputMode() != IL_PAGE_PREVIEW && $this->getOutputMode() != IL_PAGE_PRINT) {
         $tpl->setVariable("FORMACTION", $this->ctrl->getFormActionByClass("ilpageeditorgui"));
     }
     // output media object edit list (of media links)
     if ($this->getOutputMode() == "edit") {
         $links = ilInternalLink::_getTargetsOfSource($this->obj->getParentType() . ":pg", $this->obj->getId(), $this->obj->getLanguage());
         $mob_links = array();
         foreach ($links as $link) {
             if ($link["type"] == "mob") {
                 if (ilObject::_exists($link["id"]) && ilObject::_lookupType($link["id"]) == "mob") {
                     $mob_links[$link["id"]] = ilObject::_lookupTitle($link["id"]) . " [" . $link["id"] . "]";
                 }
             }
         }
         // linked media objects
         if (count($mob_links) > 0) {
             $tpl->setCurrentBlock("med_link");
             $tpl->setVariable("TXT_LINKED_MOBS", $this->lng->txt("cont_linked_mobs"));
             $tpl->setVariable("SEL_MED_LINKS", ilUtil::formSelect(0, "mob_id", $mob_links, false, true));
             $tpl->setVariable("TXT_EDIT_MEDIA", $this->lng->txt("cont_edit_mob"));
             $tpl->setVariable("TXT_COPY_TO_CLIPBOARD", $this->lng->txt("cont_copy_to_clipboard"));
             //$this->tpl->setVariable("TXT_COPY_TO_POOL", $this->lng->txt("cont_copy_to_mediapool"));
             $tpl->parseCurrentBlock();
         }
         // content snippets used
         include_once "./Services/COPage/classes/class.ilPCContentInclude.php";
         $snippets = ilPCContentInclude::collectContentIncludes($this->getPageObject(), $this->getPageObject()->getDomDoc());
         if (count($snippets) > 0) {
             foreach ($snippets as $s) {
                 include_once "./Modules/MediaPool/classes/class.ilMediaPoolPage.php";
                 $sn_arr[$s["id"]] = ilMediaPoolPage::lookupTitle($s["id"]);
             }
             $tpl->setCurrentBlock("med_link");
             $tpl->setVariable("TXT_CONTENT_SNIPPETS_USED", $this->lng->txt("cont_snippets_used"));
             $tpl->setVariable("SEL_SNIPPETS", ilUtil::formSelect(0, "ci_id", $sn_arr, false, true));
             $tpl->setVariable("TXT_SHOW_INFO", $this->lng->txt("cont_show_info"));
             $tpl->parseCurrentBlock();
         }
         // scheduled activation?
         if (!$this->getPageObject()->getActive() && $this->getPageObject()->getActivationStart() != "" && $this->getPageConfig()->getEnableScheduledActivation()) {
             $tpl->setCurrentBlock("activation_txt");
             $tpl->setVariable("TXT_SCHEDULED_ACTIVATION", $lng->txt("cont_scheduled_activation"));
             $tpl->setVariable("SA_FROM", ilDatePresentation::formatDate(new ilDateTime($this->getPageObject()->getActivationStart(), IL_CAL_DATETIME)));
             $tpl->setVariable("SA_TO", ilDatePresentation::formatDate(new ilDateTime($this->getPageObject()->getActivationEnd(), IL_CAL_DATETIME)));
             $tpl->parseCurrentBlock();
         }
     }
     if ($_GET["reloadTree"] == "y") {
         $tpl->setCurrentBlock("reload_tree");
         if ($this->obj->getParentType() == "dbk") {
             $tpl->setVariable("LINK_TREE", $this->ctrl->getLinkTargetByClass("ilobjdlbookgui", "explorer", "", false, false));
         } else {
             $tpl->setVariable("LINK_TREE", $this->ctrl->getLinkTargetByClass("ilobjlearningmodulegui", "explorer", "", false, false));
         }
         $tpl->parseCurrentBlock();
     }
     //		}
     // get content
     $builded = $this->obj->buildDom();
     // manage hierarchical ids
     if ($this->getOutputMode() == "edit") {
         // add pc ids, if necessary
         if (!$this->obj->checkPCIds()) {
             $this->obj->insertPCIds();
             $this->obj->update(true, true);
         }
         $this->obj->addFileSizes();
         $this->obj->addHierIDs();
         $hids = $this->obj->getHierIds();
         $row1_ids = $this->obj->getFirstRowIds();
         $col1_ids = $this->obj->getFirstColumnIds();
         $litem_ids = $this->obj->getListItemIds();
         $fitem_ids = $this->obj->getFileItemIds();
         // standard menues
         $hids = $this->obj->getHierIds();
         foreach ($hids as $hid) {
             $tpl->setCurrentBlock("add_dhtml");
             $tpl->setVariable("CONTEXTMENU", "contextmenu_" . $hid);
             $tpl->parseCurrentBlock();
         }
         // column menues for tables
         foreach ($col1_ids as $hid) {
             $tpl->setCurrentBlock("add_dhtml");
             $tpl->setVariable("CONTEXTMENU", "contextmenu_r" . $hid);
             $tpl->parseCurrentBlock();
         }
         // row menues for tables
         foreach ($row1_ids as $hid) {
             $tpl->setCurrentBlock("add_dhtml");
             $tpl->setVariable("CONTEXTMENU", "contextmenu_c" . $hid);
             $tpl->parseCurrentBlock();
         }
         // list item menues
         foreach ($litem_ids as $hid) {
             $tpl->setCurrentBlock("add_dhtml");
             $tpl->setVariable("CONTEXTMENU", "contextmenu_i" . $hid);
             $tpl->parseCurrentBlock();
         }
         // file item menues
         foreach ($fitem_ids as $hid) {
             $tpl->setCurrentBlock("add_dhtml");
             $tpl->setVariable("CONTEXTMENU", "contextmenu_i" . $hid);
             $tpl->parseCurrentBlock();
         }
     } else {
         $this->obj->addFileSizes();
     }
     //echo "<br>-".htmlentities($this->obj->getXMLContent())."-<br><br>";
     //echo "<br>-".htmlentities($this->getLinkXML())."-";
     // set default link xml, if nothing was set yet
     if (!$this->link_xml_set) {
         $this->setDefaultLinkXml();
     }
     //$content = $this->obj->getXMLFromDom(false, true, true,
     //	$this->getLinkXML().$this->getQuestionXML().$this->getComponentPluginsXML());
     $link_xml = $this->getLinkXML();
     // disable/enable auto margins
     if ($this->getStyleId() > 0) {
         if (ilObject::_lookupType($this->getStyleId()) == "sty") {
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $style = new ilObjStyleSheet($this->getStyleId());
             $template_xml = $style->getTemplateXML();
             $disable_auto_margins = "n";
             if ($style->lookupStyleSetting("disable_auto_margins")) {
                 $disable_auto_margins = "y";
             }
         }
     }
     if ($this->getAbstractOnly()) {
         $content = "<dummy><PageObject><PageContent><Paragraph>" . $this->obj->getFirstParagraphText() . $link_xml . "</Paragraph></PageContent></PageObject></dummy>";
     } else {
         $content = $this->obj->getXMLFromDom(false, true, true, $link_xml . $this->getQuestionXML() . $template_xml . $this->getComponentPluginsXML());
     }
     // check validation errors
     if ($builded !== true) {
         $this->displayValidationError($builded);
     } else {
         $this->displayValidationError($_SESSION["il_pg_error"]);
     }
     unset($_SESSION["il_pg_error"]);
     if (isset($_SESSION["citation_error"])) {
         ilUtil::sendFailure($this->lng->txt("cont_citation_selection_not_valid"));
         ilSession::clear("citation_error");
     }
     // get title
     $pg_title = $this->getPresentationTitle();
     $col_path = ilUtil::getImagePath("col.svg");
     $row_path = ilUtil::getImagePath("row.svg");
     $item_path = ilUtil::getImagePath("item.svg");
     if ($this->getOutputMode() != "offline") {
         $enlarge_path = ilUtil::getImagePath("enlarge.svg");
         $wb_path = ilUtil::getWebspaceDir("output") . "/";
     } else {
         $enlarge_path = "images/enlarge.svg";
         $wb_path = "";
     }
     $pg_title_class = $this->getOutputMode() == "print" ? "ilc_PrintPageTitle" : "";
     // page splitting only for learning modules and
     // digital books
     $enable_split_new = $this->obj->getParentType() == "lm" || $this->obj->getParentType() == "dbk" ? "y" : "n";
     // page splitting to next page only for learning modules and
     // digital books if next page exists in tree
     if (($this->obj->getParentType() == "lm" || $this->obj->getParentType() == "dbk") && ilObjContentObject::hasSuccessorPage($this->obj->getParentId(), $this->obj->getId())) {
         $enable_split_next = "y";
     } else {
         $enable_split_next = "n";
     }
     $img_path = ilUtil::getImagePath("", false, $this->getOutputMode(), $this->getOutputMode() == "offline");
     if ($this->getPageConfig()->getEnablePCType("Tabs")) {
         //include_once("./Services/YUI/classes/class.ilYuiUtil.php");
         //ilYuiUtil::initTabView();
         include_once "./Services/Accordion/classes/class.ilAccordionGUI.php";
         ilAccordionGUI::addJavaScript();
         ilAccordionGUI::addCss();
     }
     $file_download_link = $this->determineFileDownloadLink();
     $fullscreen_link = $this->determineFullscreenLink();
     $this->sourcecode_download_script = $this->determineSourcecodeDownloadScript();
     // default values for various parameters (should be used by
     // all instances in the future)
     $media_mode = $this->getOutputMode() == "edit" ? $ilUser->getPref("ilPageEditor_MediaMode") : "enable";
     include_once "./Modules/LearningModule/classes/class.ilEditClipboard.php";
     $paste = ilEditClipboard::getAction() == "copy" && $this->getOutputMode() == "edit";
     include_once "./Services/MediaObjects/classes/class.ilPlayerUtil.php";
     $flv_video_player = $this->getOutputMode() != "offline" ? ilPlayerUtil::getFlashVideoPlayerFilename(true) : ilPlayerUtil::getFlashVideoPlayerFilename(true);
     $cfg = $this->getPageConfig();
     // added UTF-8 encoding otherwise umlaute are converted too
     include_once "./Services/Maps/classes/class.ilMapUtil.php";
     $params = array('mode' => $this->getOutputMode(), 'pg_title' => htmlentities($pg_title, ENT_QUOTES, "UTF-8"), 'enable_placeholder' => $cfg->getEnablePCType("PlaceHolder") ? "y" : "n", 'pg_id' => $this->obj->getId(), 'pg_title_class' => $pg_title_class, 'webspace_path' => $wb_path, 'enlarge_path' => $enlarge_path, 'img_col' => $col_path, 'img_row' => $row_path, 'img_item' => $item_path, 'enable_split_new' => $enable_split_new, 'enable_split_next' => $enable_split_next, 'link_params' => $this->link_params, 'file_download_link' => $file_download_link, 'fullscreen_link' => $fullscreen_link, 'img_path' => $img_path, 'parent_id' => $this->obj->getParentId(), 'download_script' => $this->sourcecode_download_script, 'encoded_download_script' => urlencode($this->sourcecode_download_script), 'bib_id' => $this->getBibId(), 'citation' => (int) $this->isEnabledCitation(), 'pagebreak' => $this->lng->txt('dgl_pagebreak'), 'page' => $this->lng->txt('page'), 'citate_page' => $this->lng->txt('citate_page'), 'citate_from' => $this->lng->txt('citate_from'), 'citate_to' => $this->lng->txt('citate_to'), 'citate' => $this->lng->txt('citate'), 'enable_rep_objects' => $cfg->getEnablePCType("Resources") ? "y" : "n", 'enable_login_page' => $cfg->getEnablePCType("LoginPageElement") ? "y" : "n", 'enable_map' => $cfg->getEnablePCType("Map") && ilMapUtil::isActivated() ? "y" : "n", 'enable_tabs' => $cfg->getEnablePCType("Tabs") ? "y" : "n", 'enable_sa_qst' => $cfg->getEnableSelfAssessment() ? "y" : "n", 'enable_file_list' => $cfg->getEnablePCType("FileList") ? "y" : "n", 'enable_content_includes' => $cfg->getEnablePCType("ContentInclude") ? "y" : "n", 'enable_content_templates' => count($this->getPageObject()->getContentTemplates()) > 0 ? "y" : "n", 'paste' => $paste ? "y" : "n", 'media_mode' => $media_mode, 'javascript' => $sel_js_mode, 'paragraph_plugins' => $paragraph_plugin_string, 'disable_auto_margins' => $disable_auto_margins, 'page_toc' => $cfg->getEnablePageToc() ? "y" : "n", 'enable_profile' => $cfg->getEnablePCType("Profile") ? "y" : "n", 'enable_verification' => $cfg->getEnablePCType("Verification") ? "y" : "n", 'enable_blog' => $cfg->getEnablePCType("Blog") ? "y" : "n", 'enable_skills' => $cfg->getEnablePCType("Skills") ? "y" : "n", 'enable_qover' => $cfg->getEnablePCType("QuestionOverview") ? "y" : "n", 'enable_consultation_hours' => $cfg->getEnablePCType("ConsultationHours") ? "y" : "n", 'enable_my_courses' => $cfg->getEnablePCType("MyCourses") ? "y" : "n", 'enable_amd_page_list' => $cfg->getEnablePCType("AMDPageList") ? "y" : "n", 'flv_video_player' => $flv_video_player);
     if ($this->link_frame != "") {
         // todo other link types
         $params["pg_frame"] = $this->link_frame;
     }
     //$content = str_replace("&nbsp;", "", $content);
     // this ensures that cache is emptied with every update
     $params["version"] = ILIAS_VERSION;
     // ensure no cache hit, if included files/media objects have been changed
     $params["incl_elements_date"] = $this->obj->getLastUpdateOfIncludedElements();
     // run xslt
     $md5 = md5(serialize($params) . $link_xml . $template_xml);
     //$a = microtime();
     // check cache (same parameters, non-edit mode and rendered time
     // > last change
     if (($this->getOutputMode() == "preview" || $this->getOutputMode() == "presentation") && !$this->getCompareMode() && !$this->getAbstractOnly() && $md5 == $this->obj->getRenderMd5() && $this->obj->getLastChange() < $this->obj->getRenderedTime() && $this->obj->getRenderedTime() != "" && $this->obj->old_nr == 0) {
         // cache hit
         $output = $this->obj->getRenderedContent();
     } else {
         $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
         $args = array('/_xml' => $content, '/_xsl' => $xsl);
         $xh = xslt_create();
         //		echo "<b>XSLT</b>:".htmlentities($xsl).":<br>";
         //		echo "mode:".$this->getOutputMode().":<br>";
         $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", NULL, $args, $params);
         if (($this->getOutputMode() == "presentation" || $this->getOutputMode() == "preview") && !$this->getAbstractOnly() && $this->obj->old_nr == 0) {
             //echo "writerenderedcontent";
             $this->obj->writeRenderedContent($output, $md5);
         }
         //echo xslt_error($xh);
         xslt_free($xh);
     }
     //$b = microtime();
     //echo "$a - $b";
     //echo "<pre>".htmlentities($output)."</pre>";
     // unmask user html
     if (($this->getOutputMode() != "edit" || $ilUser->getPref("ilPageEditor_HTMLMode") != "disable") && !$this->getPageConfig()->getPreventHTMLUnmasking()) {
         $output = str_replace("&lt;", "<", $output);
         $output = str_replace("&gt;", ">", $output);
     }
     $output = str_replace("&amp;", "&", $output);
     $output = ilUtil::insertLatexImages($output);
     // insert page snippets
     $output = $this->insertContentIncludes($output);
     // insert resource blocks
     $output = $this->insertResources($output);
     // insert page toc
     if ($this->getPageConfig()->getEnablePageToc()) {
         $output = $this->insertPageToc($output);
     }
     // insert advanced output trigger
     $output = $this->insertAdvTrigger($output);
     // workaround for preventing template engine
     // from hiding paragraph text that is enclosed
     // in curly brackets (e.g. "{a}", see ilLMEditorGUI::executeCommand())
     $output = $this->replaceCurlyBrackets($output);
     // remove all newlines (important for code / pre output)
     $output = str_replace("\n", "", $output);
     //echo htmlentities($output);
     $output = $this->postOutputProcessing($output);
     //echo htmlentities($output);
     if ($this->getOutputMode() == "edit" && !$this->getPageObject()->getActive($this->getPageConfig()->getEnableScheduledActivation())) {
         $output = '<div class="il_editarea_disabled">' . $output . '</div>';
     }
     // for all page components...
     include_once "./Services/COPage/classes/class.ilCOPagePCDef.php";
     $defs = ilCOPagePCDef::getPCDefinitions();
     foreach ($defs as $def) {
         ilCOPagePCDef::requirePCClassByName($def["name"]);
         $pc_class = $def["pc_class"];
         $pc_obj = new $pc_class($this->getPageObject());
         // post xsl page content modification by pc elements
         $output = $pc_obj->modifyPageContentPostXsl($output, $this->getOutputMode());
         // javascript files
         $js_files = $pc_obj->getJavascriptFiles($this->getOutputMode());
         foreach ($js_files as $js) {
             $GLOBALS["tpl"]->addJavascript($js);
         }
         // css files
         $css_files = $pc_obj->getCssFiles($this->getOutputMode());
         foreach ($css_files as $css) {
             $GLOBALS["tpl"]->addCss($css);
         }
         // onload code
         $onload_code = $pc_obj->getOnloadCode($this->getOutputMode());
         foreach ($onload_code as $code) {
             $GLOBALS["tpl"]->addOnloadCode($code);
         }
     }
     //		$output = $this->selfAssessmentRendering($output);
     // output
     if ($ilCtrl->isAsynch() && !$this->getRawPageContent() && $this->getOutputMode() == "edit") {
         // e.g. ###3:110dad8bad6df8620071a0a693a2d328###
         if ($_GET["updated_pc_id_str"] != "") {
             echo $_GET["updated_pc_id_str"];
         }
         $tpl->setVariable($this->getTemplateOutputVar(), $output);
         $tpl->setCurrentBlock("edit_page");
         $tpl->parseCurrentBlock();
         echo $tpl->get("edit_page");
         exit;
     }
     if ($this->outputToTemplate()) {
         $tpl->setVariable($this->getTemplateOutputVar(), $output);
         $this->tpl->setVariable($this->getTemplateTargetVar(), $tpl->get());
         return $output;
     } else {
         if ($this->getRawPageContent()) {
             return $output;
         } else {
             $tpl->setVariable($this->getTemplateOutputVar(), $output);
             return $tpl->get();
         }
     }
 }
 /**
  * get html
  */
 function getHTML()
 {
     global $lng, $ilSetting, $tree, $ilAccess, $ilCtrl, $ilUser;
     $tpl = new ilTemplate("tpl.infoscreen.html", true, true, "Services/InfoScreen");
     // other class handles form action (@todo: this is not implemented/tested)
     if ($this->form_action == "") {
         $this->setFormAction($ilCtrl->getFormAction($this));
     }
     require_once 'Services/jQuery/classes/class.iljQueryUtil.php';
     iljQueryUtil::initjQuery();
     if ($this->hidden) {
         $tpl->touchBlock("hidden_js");
         if ($this->show_hidden_toggle) {
             $this->addButton($lng->txt("show_hidden_sections"), "JavaScript:toggleSections(this, '" . $lng->txt("show_hidden_sections") . "', '" . $lng->txt("hide_visible_sections") . "');");
         }
     }
     // DEPRECATED - use ilToolbarGUI
     // add top buttons
     if (count($this->top_buttons) > 0) {
         $tpl->addBlockfile("TOP_BUTTONS", "top_buttons", "tpl.buttons.html");
         foreach ($this->top_buttons as $button) {
             // view button
             $tpl->setCurrentBlock("btn_cell");
             $tpl->setVariable("BTN_LINK", $button["link"]);
             $tpl->setVariable("BTN_TARGET", $button["target"]);
             $tpl->setVariable("BTN_TXT", $button["title"]);
             if ($button["primary"]) {
                 $tpl->setVariable("BTN_CLASS", " btn-primary");
             }
             $tpl->parseCurrentBlock();
         }
     }
     // add top formbuttons
     if (count($this->top_formbuttons) > 0 && strlen($this->form_action) > 0) {
         $tpl->addBlockfile("TOP_FORMBUTTONS", "top_submitbuttons", "tpl.submitbuttons.html", "Services/InfoScreen");
         foreach ($this->top_formbuttons as $button) {
             // view button
             $tpl->setCurrentBlock("btn_submit_cell");
             $tpl->setVariable("BTN_COMMAND", $button["command"]);
             $tpl->setVariable("BTN_NAME", $button["title"]);
             $tpl->parseCurrentBlock();
         }
     }
     // add form action
     if (strlen($this->form_action) > 0) {
         if ($this->open_form_tag) {
             $tpl->setCurrentBlock("formtop");
             $tpl->setVariable("FORMACTION", $this->form_action);
             $tpl->parseCurrentBlock();
         }
         if ($this->close_form_tag) {
             $tpl->touchBlock("formbottom");
         }
     }
     if (count($this->hiddenelements)) {
         foreach ($this->hiddenelements as $hidden) {
             $tpl->setCurrentBlock("hidden_element");
             $tpl->setVariable("HIDDEN_NAME", $hidden["name"]);
             $tpl->setVariable("HIDDEN_VALUE", $hidden["value"]);
             $tpl->parseCurrentBlock();
         }
     }
     // learning progress
     if ($this->learning_progress_enabled and $html = $this->showLearningProgress($tpl)) {
         $tpl->setCurrentBlock("learning_progress");
         $tpl->setVariable("LP_TABLE", $html);
         $tpl->parseCurrentBlock();
     }
     // notes section
     if ($this->private_notes_enabled && !$ilSetting->get('disable_notes')) {
         $html = $this->showNotesSection();
         $tpl->setCurrentBlock("notes");
         $tpl->setVariable("NOTES", $html);
         $tpl->parseCurrentBlock();
     }
     // tagging
     if (is_object($this->gui_object->object)) {
         $tags_set = new ilSetting("tags");
         if ($tags_set->get("enable") && $ilUser->getId() != ANONYMOUS_USER_ID) {
             $this->addTagging();
         }
     }
     if (is_object($this->gui_object->object)) {
         $this->addObjectSections();
     }
     // render all sections
     for ($i = 1; $i <= $this->sec_nr; $i++) {
         if (is_array($this->section[$i]["properties"])) {
             // section properties
             foreach ($this->section[$i]["properties"] as $property) {
                 if ($property["name"] != "") {
                     if ($property["link"] == "") {
                         $tpl->setCurrentBlock("pv");
                         $tpl->setVariable("TXT_PROPERTY_VALUE", $property["value"]);
                         $tpl->parseCurrentBlock();
                     } else {
                         $tpl->setCurrentBlock("lpv");
                         $tpl->setVariable("TXT_PROPERTY_LVALUE", $property["value"]);
                         $tpl->setVariable("LINK_PROPERTY_VALUE", $property["link"]);
                         $tpl->parseCurrentBlock();
                     }
                     $tpl->setCurrentBlock("property_row");
                     $tpl->setVariable("TXT_PROPERTY", $property["name"]);
                     $tpl->parseCurrentBlock();
                 } else {
                     $tpl->setCurrentBlock("property_full_row");
                     $tpl->setVariable("TXT_PROPERTY_FULL_VALUE", $property["value"]);
                     $tpl->parseCurrentBlock();
                 }
             }
             // section header
             if ($this->section[$i]["hidden"]) {
                 $tpl->setVariable("SECTION_HIDDEN", " style=\"display:none;\"");
                 $tpl->setVariable("SECTION_ID", "hidable_" . $i);
             } else {
                 $tpl->setVariable("SECTION_ID", $i);
             }
             $tpl->setVariable("TCLASS", $this->getTableClass());
             $tpl->setVariable("TXT_SECTION", $this->section[$i]["title"]);
             $tpl->touchBlock("row");
         }
     }
     return $tpl->get();
 }
 public function render($a_mode = "")
 {
     $tpl = new ilTemplate("tpl.prop_mail_quick_filter_input.html", true, true, "Services/Mail");
     if (strlen($this->getValue())) {
         $tpl->setCurrentBlock("prop_text_propval");
         $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getValue()));
         $tpl->parseCurrentBlock();
     }
     if (strlen($this->getInlineStyle())) {
         $tpl->setCurrentBlock("stylecss");
         $tpl->setVariable("CSS_STYLE", ilUtil::prepareFormOutput($this->getInlineStyle()));
         $tpl->parseCurrentBlock();
     }
     if (strlen($this->getCssClass())) {
         $tpl->setCurrentBlock("classcss");
         $tpl->setVariable('CLASS_CSS', ilUtil::prepareFormOutput($this->getCssClass()));
         $tpl->parseCurrentBlock();
     }
     if ($this->getSubmitFormOnEnter()) {
         $tpl->touchBlock("submit_form_on_enter");
     }
     switch ($this->getInputType()) {
         case 'password':
             $tpl->setVariable('PROP_INPUT_TYPE', 'password');
             break;
         case 'hidden':
             $tpl->setVariable('PROP_INPUT_TYPE', 'hidden');
             break;
         case 'text':
         default:
             $tpl->setVariable('PROP_INPUT_TYPE', 'text');
     }
     $tpl->setVariable("ID", $this->getFieldId());
     $tpl->setVariable("SIZE", $this->getSize());
     if ($this->getMaxLength() != null) {
         $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
     }
     if (strlen($this->getSuffix())) {
         $tpl->setVariable("INPUT_SUFFIX", $this->getSuffix());
     }
     $postvar = $this->getPostVar();
     if ($this->getMulti() && substr($postvar, -2) != "[]") {
         $postvar .= "[]";
     }
     if ($this->getDisabled()) {
         if ($this->getMulti()) {
             $value = $this->getMultiValues();
             $hidden = "";
             if (is_array($value)) {
                 foreach ($value as $item) {
                     $hidden .= $this->getHiddenTag($postvar, $item);
                 }
             }
         } else {
             $hidden = $this->getHiddenTag($postvar, $this->getValue());
         }
         if ($hidden) {
             $tpl->setVariable("DISABLED", " disabled=\"disabled\"");
             $tpl->setVariable("HIDDEN_INPUT", $hidden);
         }
     } else {
         $tpl->setVariable("POST_VAR", $postvar);
     }
     // use autocomplete feature?
     if ($this->getDataSource()) {
         include_once "Services/jQuery/classes/class.iljQueryUtil.php";
         iljQueryUtil::initjQuery();
         iljQueryUtil::initjQueryUI();
         if ($this->getMulti()) {
             $tpl->setCurrentBlock("ac_multi");
             $tpl->setVariable('MURL_AUTOCOMPLETE', $this->getDataSource());
             $tpl->setVariable('ID_AUTOCOMPLETE', $this->getFieldId());
             $tpl->parseCurrentBlock();
             // set to fields that start with autocomplete selector
             $sel_auto = '[id^="' . $this->getFieldId() . '"]';
         } else {
             // use id for autocomplete selector
             $sel_auto = "#" . $this->getFieldId();
         }
         $tpl->setCurrentBlock("prop_text_autocomplete");
         $tpl->setVariable('SEL_AUTOCOMPLETE', $sel_auto);
         $tpl->setVariable('URL_AUTOCOMPLETE', $this->getDataSource());
         $tpl->parseCurrentBlock();
     }
     if ($a_mode == "toolbar") {
         // block-inline hack, see: http://blog.mozilla.com/webdev/2009/02/20/cross-browser-inline-block/
         // -moz-inline-stack for FF2
         // zoom 1; *display:inline for IE6 & 7
         $tpl->setVariable("STYLE_PAR", 'display: -moz-inline-stack; display:inline-block; zoom: 1; *display:inline;');
     } else {
         $tpl->setVariable("STYLE_PAR", '');
     }
     // multi icons
     if ($this->getMulti() && !$a_mode && !$this->getDisabled()) {
         $tpl->setVariable("MULTI_ICONS", $this->getMultiIconsHTML($this->multi_sortable));
     }
     if (is_array($this->sub_items) && $this->sub_items) {
         /**
          * @var $lng ilLanguage
          */
         global $lng;
         $tpl->setVariable("FIELD_ID", $this->getFieldId());
         $tpl->setVariable("TXT_PLACEHOLDER", $lng->txt('mail_filter_field_placeholder'));
         $tpl->setVariable("TXT_FILTER_MESSAGES_BY", $lng->txt('mail_filter_txt'));
         $subitem_html = '';
         foreach ($this->sub_items as $item) {
             $subitem_html .= $item->render('toolbar');
         }
         $tpl->setVariable('FIELD_SUBITEMS', $subitem_html);
     }
     return $tpl->get();
 }
 /**
  * set all template variables (images, scripts, target frames, ...)
  */
 function setTemplateVars()
 {
     global $rbacsystem, $lng, $ilias, $tree, $ilUser, $ilSetting, $ilPluginAdmin;
     if ($this->logo_only) {
         $this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.png"));
         return;
     }
     // get user interface plugins
     $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
     // search
     include_once 'Services/Search/classes/class.ilSearchSettings.php';
     if ($rbacsystem->checkAccess('search', ilSearchSettings::_getSearchSettingRefId())) {
         include_once './Services/Search/classes/class.ilMainMenuSearchGUI.php';
         $main_search = new ilMainMenuSearchGUI();
         $html = "";
         // user interface plugin slot + default rendering
         include_once "./Services/UIComponent/classes/class.ilUIHookProcessor.php";
         $uip = new ilUIHookProcessor("Services/MainMenu", "main_menu_search", array("main_menu_gui" => $this, "main_menu_search_gui" => $main_search));
         if (!$uip->replaced()) {
             $html = $main_search->getHTML();
         }
         $html = $uip->getHTML($html);
         if (strlen($html)) {
             $this->tpl->setVariable('SEARCHBOX', $html);
         }
     }
     $this->renderStatusBox($this->tpl);
     // online help
     $this->renderHelpButtons();
     $mmle_html = "";
     // user interface plugin slot + default rendering
     include_once "./Services/UIComponent/classes/class.ilUIHookProcessor.php";
     $uip = new ilUIHookProcessor("Services/MainMenu", "main_menu_list_entries", array("main_menu_gui" => $this));
     if (!$uip->replaced()) {
         $mmle_tpl = new ilTemplate("tpl.main_menu_list_entries.html", true, true, "Services/MainMenu");
         $mmle_html = $this->renderMainMenuListEntries($mmle_tpl);
     }
     $mmle_html = $uip->getHTML($mmle_html);
     $this->tpl->setVariable("MAIN_MENU_LIST_ENTRIES", $mmle_html);
     $link_dir = defined("ILIAS_MODULE") ? "../" : "";
     if (!$this->small) {
         // login stuff
         if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID) {
             include_once 'Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
             if (ilRegistrationSettings::_lookupRegistrationType() != IL_REG_DISABLED) {
                 $this->tpl->setCurrentBlock("registration_link");
                 $this->tpl->setVariable("TXT_REGISTER", $lng->txt("register"));
                 $this->tpl->setVariable("LINK_REGISTER", $link_dir . "register.php?client_id=" . rawurlencode(CLIENT_ID) . "&lang=" . $ilias->account->getCurrentLanguage());
                 $this->tpl->parseCurrentBlock();
             }
             // language selection
             $selection = self::getLanguageSelection();
             if ($selection) {
                 $this->tpl->setVariable("LANG_SELECT", $selection);
             }
             $this->tpl->setCurrentBlock("userisanonymous");
             $this->tpl->setVariable("TXT_NOT_LOGGED_IN", $lng->txt("not_logged_in"));
             $this->tpl->setVariable("TXT_LOGIN", $lng->txt("log_in"));
             $target_str = "";
             if ($this->getLoginTargetPar() != "") {
                 $target_str = $this->getLoginTargetPar();
             } else {
                 if ($_GET["ref_id"] != "") {
                     if ($tree->isInTree($_GET["ref_id"]) && $_GET["ref_id"] != $tree->getRootId()) {
                         $obj_id = ilObject::_lookupObjId($_GET["ref_id"]);
                         $type = ilObject::_lookupType($obj_id);
                         $target_str = $type . "_" . $_GET["ref_id"];
                     }
                 }
             }
             $this->tpl->setVariable("LINK_LOGIN", $link_dir . "login.php?target=" . $target_str . "&client_id=" . rawurlencode(CLIENT_ID) . "&cmd=force_login&lang=" . $ilias->account->getCurrentLanguage());
             $this->tpl->parseCurrentBlock();
         } else {
             $notificationSettings = new ilSetting('notifications');
             $chatSettings = new ilSetting('chatroom');
             /**
              * @var $tpl ilTemplate
              */
             global $tpl;
             if ($chatSettings->get('chat_enabled') && $notificationSettings->get('enable_osd')) {
                 $this->tpl->touchBlock('osd_enabled');
                 $this->tpl->touchBlock('osd_container');
                 include_once "Services/jQuery/classes/class.iljQueryUtil.php";
                 iljQueryUtil::initjQuery();
                 include_once 'Services/MediaObjects/classes/class.ilPlayerUtil.php';
                 ilPlayerUtil::initMediaElementJs();
                 $tpl->addJavaScript('Services/Notifications/templates/default/notifications.js');
                 $tpl->addCSS('Services/Notifications/templates/default/osd.css');
                 require_once 'Services/Notifications/classes/class.ilNotificationOSDHandler.php';
                 $notifications = ilNotificationOSDHandler::getNotificationsForUser($ilUser->getId());
                 $this->tpl->setVariable('INITIAL_NOTIFICATIONS', json_encode($notifications));
                 $this->tpl->setVariable('OSD_POLLING_INTERVALL', $notificationSettings->get('osd_polling_intervall') ? $notificationSettings->get('osd_polling_intervall') : '5');
                 $this->tpl->setVariable('OSD_PLAY_SOUND', $chatSettings->get('play_invitation_sound') ? 'true' : 'false');
                 foreach ($notifications as $notification) {
                     if ($notification['type'] == 'osd_maint') {
                         continue;
                     }
                     $this->tpl->setCurrentBlock('osd_notification_item');
                     $this->tpl->setVariable('NOTIFICATION_ICON_PATH', $notification['data']->iconPath);
                     $this->tpl->setVariable('NOTIFICATION_TITLE', $notification['data']->title);
                     $this->tpl->setVariable('NOTIFICATION_LINK', $notification['data']->link);
                     $this->tpl->setVariable('NOTIFICATION_LINKTARGET', $notification['data']->linktarget);
                     $this->tpl->setVariable('NOTIFICATION_ID', $notification['notification_osd_id']);
                     $this->tpl->setVariable('NOTIFICATION_SHORT_DESCRIPTION', $notification['data']->shortDescription);
                     $this->tpl->parseCurrentBlock();
                 }
             }
             $this->tpl->setCurrentBlock("userisloggedin");
             $this->tpl->setVariable("TXT_LOGIN_AS", $lng->txt("login_as"));
             $this->tpl->setVariable("TXT_LOGOUT2", $lng->txt("logout"));
             $this->tpl->setVariable("LINK_LOGOUT2", $link_dir . "logout.php?lang=" . $ilias->account->getCurrentLanguage());
             $this->tpl->setVariable("USERNAME", $ilias->account->getFullname());
             $this->tpl->parseCurrentBlock();
         }
         include_once "./Modules/SystemFolder/classes/class.ilObjSystemFolder.php";
         $header_top_title = ilObjSystemFolder::_getHeaderTitle();
         if (trim($header_top_title) != "" && $this->tpl->blockExists("header_top_title")) {
             $this->tpl->setCurrentBlock("header_top_title");
             $this->tpl->setVariable("TXT_HEADER_TITLE", $header_top_title);
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
         $this->tpl->setVariable("TXT_LOGOUT", $lng->txt("logout"));
         $this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.png"));
         $this->tpl->setVariable("HEADER_BG_IMAGE", ilUtil::getImagePath("HeaderBackground.png"));
         include_once "./Modules/SystemFolder/classes/class.ilObjSystemFolder.php";
         // set link to return to desktop, not depending on a specific position in the hierarchy
         //$this->tpl->setVariable("SCRIPT_START", $this->getScriptTarget("start.php"));
     } else {
         $this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.png"));
     }
     $this->tpl->setVariable("TXT_MAIN_MENU", $lng->txt("main_menu"));
     $this->tpl->parseCurrentBlock();
 }
 /**
  * Render item
  */
 public function render($a_mode = "")
 {
     $tpl = new ilTemplate("tpl.prop_textinput.html", true, true, "Services/Form");
     if (strlen($this->getValue())) {
         $tpl->setCurrentBlock("prop_text_propval");
         $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getValue()));
         $tpl->parseCurrentBlock();
     }
     if (strlen($this->getInlineStyle())) {
         $tpl->setCurrentBlock("stylecss");
         $tpl->setVariable("CSS_STYLE", ilUtil::prepareFormOutput($this->getInlineStyle()));
         $tpl->parseCurrentBlock();
     }
     if (strlen($this->getCssClass())) {
         $tpl->setCurrentBlock("classcss");
         $tpl->setVariable('CLASS_CSS', ilUtil::prepareFormOutput($this->getCssClass()));
         $tpl->parseCurrentBlock();
     }
     if ($this->getSubmitFormOnEnter()) {
         $tpl->touchBlock("submit_form_on_enter");
     }
     switch ($this->getInputType()) {
         case 'password':
             $tpl->setVariable('PROP_INPUT_TYPE', 'password');
             break;
         case 'hidden':
             $tpl->setVariable('PROP_INPUT_TYPE', 'hidden');
             break;
         case 'text':
         default:
             $tpl->setVariable('PROP_INPUT_TYPE', 'text');
     }
     $tpl->setVariable("ID", $this->getFieldId());
     $tpl->setVariable("SIZE", $this->getSize());
     if ($this->getMaxLength() != null) {
         $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
     }
     if (strlen($this->getSuffix())) {
         $tpl->setVariable("INPUT_SUFFIX", $this->getSuffix());
     }
     $postvar = $this->getPostVar();
     if ($this->getMulti() && substr($postvar, -2) != "[]") {
         $postvar .= "[]";
     }
     if ($this->getDisabled()) {
         if ($this->getMulti()) {
             $value = $this->getMultiValues();
             $hidden = "";
             if (is_array($value)) {
                 foreach ($value as $item) {
                     $hidden .= $this->getHiddenTag($postvar, $item);
                 }
             }
         } else {
             $hidden = $this->getHiddenTag($postvar, $this->getValue());
         }
         if ($hidden) {
             $tpl->setVariable("DISABLED", " disabled=\"disabled\"");
             $tpl->setVariable("HIDDEN_INPUT", $hidden);
         }
     } else {
         $tpl->setVariable("POST_VAR", $postvar);
     }
     // use autocomplete feature?
     if ($this->getDataSource()) {
         include_once "Services/jQuery/classes/class.iljQueryUtil.php";
         iljQueryUtil::initjQuery();
         iljQueryUtil::initjQueryUI();
         if ($this->getMulti()) {
             $tpl->setCurrentBlock("ac_multi");
             $tpl->setVariable('MURL_AUTOCOMPLETE', $this->getDataSource());
             $tpl->setVariable('ID_AUTOCOMPLETE', $this->getFieldId());
             $tpl->parseCurrentBlock();
             // set to fields that start with autocomplete selector
             $sel_auto = '[id^="' . $this->getFieldId() . '"]';
         } else {
             // use id for autocomplete selector
             $sel_auto = "#" . $this->getFieldId();
         }
         if (!$this->ajax_datasource_delimiter) {
             $tpl->setCurrentBlock("autocomplete_bl");
             $tpl->setVariable('SEL_AUTOCOMPLETE', $sel_auto);
             $tpl->setVariable('URL_AUTOCOMPLETE', $this->getDataSource());
             $tpl->parseCurrentBlock();
         } else {
             $tpl->setCurrentBlock("autocomplete_bl");
             $tpl->setVariable('AUTOCOMPLETE_DELIMITER', $this->ajax_datasource_delimiter);
             $tpl->setVariable('SEL_AUTOCOMPLETE_DELIMITER', $sel_auto);
             $tpl->setVariable('URL_AUTOCOMPLETE_DELIMITER', $this->getDataSource());
             $tpl->parseCurrentBlock();
         }
     }
     if ($a_mode == "toolbar") {
         // block-inline hack, see: http://blog.mozilla.com/webdev/2009/02/20/cross-browser-inline-block/
         // -moz-inline-stack for FF2
         // zoom 1; *display:inline for IE6 & 7
         $tpl->setVariable("STYLE_PAR", 'display: -moz-inline-stack; display:inline-block; zoom: 1; *display:inline;');
     } else {
         $tpl->setVariable("STYLE_PAR", '');
     }
     if ($this->isHtmlAutoCompleteDisabled()) {
         $tpl->setVariable("AUTOCOMPLETE", "autocomplete=\"off\"");
     }
     // multi icons
     if ($this->getMulti() && !$a_mode && !$this->getDisabled()) {
         $tpl->setVariable("MULTI_ICONS", $this->getMultiIconsHTML());
     }
     return $tpl->get();
 }
 /**
  * @param $question_id
  * @param $question_pool_id
  *
  * @return ilPropertyFormGUI
  */
 protected function buildAdjustQuestionForm($question_id, $question_pool_id)
 {
     require_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setMultipart(FALSE);
     $form->setTableWidth("100%");
     $form->setId("adjustment");
     /** @var $question assQuestionGUI|ilGuiQuestionScoringAdjustable|ilGuiAnswerScoringAdjustable */
     $question = assQuestion::instantiateQuestionGUI($question_id);
     $form->setTitle($question->object->getTitle() . '<br /><small>(' . $question->outQuestionType() . ')</small>');
     $hidden_question_id = new ilHiddenInputGUI('q_id');
     $hidden_question_id->setValue($question_id);
     $form->addItem($hidden_question_id);
     $hidden_qpl_id = new ilHiddenInputGUI('qpl_id');
     $hidden_qpl_id->setValue($question_pool_id);
     $form->addItem($hidden_qpl_id);
     $this->populateScoringAdjustments($question, $form);
     $manscoring_section = new ilFormSectionHeaderGUI();
     $manscoring_section->setTitle($this->lng->txt('manscoring'));
     $form->addItem($manscoring_section);
     $manscoring_preservation = new ilCheckboxInputGUI($this->lng->txt('preserve_manscoring'), 'preserve_manscoring');
     $manscoring_preservation->setChecked(true);
     $manscoring_preservation->setInfo($this->lng->txt('preserve_manscoring_info'));
     $form->addItem($manscoring_preservation);
     $form->addCommandButton("savescoringfortest", $this->lng->txt("save"));
     $participants = $this->object->getParticipants();
     $active_ids = array_keys($participants);
     $results = array();
     foreach ($active_ids as $active_id) {
         $passes[] = $this->object->_getPass($active_id);
         foreach ($passes as $key => $pass) {
             for ($i = 0; $i <= $pass; $i++) {
                 $results[] = $question->object->getSolutionValues($active_id, $i);
             }
         }
     }
     $relevant_answers = array();
     foreach ($results as $result) {
         foreach ($result as $answer) {
             if ($answer['question_fi'] == $question->object->getId()) {
                 $relevant_answers[] = $answer;
             }
         }
     }
     $answers_view = $question->getAggregatedAnswersView($relevant_answers);
     include_once 'Services/jQuery/classes/class.iljQueryUtil.php';
     iljQueryUtil::initjQuery();
     include_once 'Services/YUI/classes/class.ilYuiUtil.php';
     ilYuiUtil::initPanel();
     ilYuiUtil::initOverlay();
     $this->tpl->addJavascript('./Services/UIComponent/Overlay/js/ilOverlay.js');
     $this->tpl->addJavaScript("./Services/JavaScript/js/Basic.js");
     $container = new ilTemplate('tpl.il_as_tst_adjust_answer_aggregation_container.html', true, true, 'Modules/Test');
     $container->setVariable('FORM_ELEMENT_NAME', 'aggr_usr_answ');
     $container->setVariable('CLOSE_HTML', json_encode(ilGlyphGUI::get(ilGlyphGUI::CLOSE, $this->lng->txt('close'))));
     $container->setVariable('TXT_SHOW_ANSWER_OVERVIEW', $this->lng->txt('show_answer_overview'));
     $container->setVariable('TXT_CLOSE', $this->lng->txt('close'));
     $container->setVariable('ANSWER_OVERVIEW', $answers_view);
     $custom_input = new ilCustomInputGUI('', 'aggr_usr_answ');
     $custom_input->setHtml($container->get());
     $form->addItem($custom_input);
     return $form;
 }
 /**
  * SCO preview
  */
 function sco_preview()
 {
     global $tpl, $ilCtrl, $lng;
     // init main template
     $tpl = new ilTemplate("tpl.main.html", true, true);
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
     $tpl->setBodyClass("");
     $tpl->setCurrentBlock("ContentStyle");
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->slm_object->getStyleSheetId()));
     $tpl->parseCurrentBlock();
     // get javascript
     include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
     iljQueryUtil::initjQuery();
     iljQueryUtil::initjQueryUI();
     $tpl->addJavaScript("./Modules/Scorm2004/scripts/questions/pure.js");
     $tpl->addJavaScript("./Modules/Scorm2004/scripts/pager.js");
     $tpl->addOnLoadCode("pager.Init();");
     $tree = new ilTree($this->slm_object->getId());
     $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
     $tree->setTreeTablePK("slm_id");
     include_once "./Modules/Scorm2004/classes/class.ilSCORM2004PageGUI.php";
     include_once "./Services/MetaData/classes/class.ilMD.php";
     $meta = new ilMD($this->node_object->getSLMId(), $this->node_object->getId(), $this->node_object->getType());
     $desc_ids = $meta->getGeneral()->getDescriptionIds();
     $sco_description = $meta->getGeneral()->getDescription($desc_ids[0])->getDescription();
     // get sco template
     $sco_tpl = new ilTemplate("tpl.sco.html", true, true, "Modules/Scorm2004");
     // navigation
     $lk = ilObjSAHSLearningModule::getAffectiveLocalization($this->node_object->getSLMId());
     ilSCORM2004Asset::renderNavigation($sco_tpl, "", $lk);
     // meta page (description and objectives)
     ilSCORM2004Asset::renderMetaPage($sco_tpl, $this->node_object, $this->node_object->getType());
     // init export (this initialises glossary template)
     ilSCORM2004PageGUI::initExport();
     $terms = $this->node_object->getGlossaryTermIds();
     // render page
     foreach ($tree->getSubTree($tree->getNodeData($this->node_object->getId()), true, 'page') as $page) {
         $page_obj = new ilSCORM2004PageGUI($this->node_object->getType(), $page["obj_id"], 0, $this->slm_object->getId());
         $page_obj->setPresentationTitle($page["title"]);
         $page_obj->setOutputMode(IL_PAGE_PREVIEW);
         $page_obj->setStyleId($this->slm_object->getStyleSheetId());
         if (count($terms) > 1) {
             $page_obj->setGlossaryOverviewInfo(ilSCORM2004ScoGUI::getGlossaryOverviewId(), $this->node_object);
         }
         $sco_tpl->setCurrentBlock("page_preview");
         $html = $ilCtrl->getHTML($page_obj);
         //$sco_tpl->setVariable("PAGE_PRV", $page_obj->showPage("export"));
         $sco_tpl->setVariable("PAGE_PRV", $html);
         $sco_tpl->parseCurrentBlock();
     }
     $output = $sco_tpl->get();
     // append glossary entries on the sco level
     $output .= ilSCORM2004PageGUI::getGlossaryHTML($this->node_object);
     //insert questions
     require_once './Modules/Scorm2004/classes/class.ilQuestionExporter.php';
     $output = preg_replace_callback("/{{{{{(Question;)(il__qst_[0-9]+)}}}}}/", array(get_class($this), 'insertQuestion'), $output);
     //		$output = preg_replace("/&#123;/","",$output);
     //		$output = preg_replace("/&#125;/","",$output);
     $output = "<script>var ScormApi=null;" . ilQuestionExporter::questionsJS() . "</script>" . $output;
     $lk = ilObjSAHSLearningModule::getAffectiveLocalization($this->node_object->getSLMId());
     //		include_once("./Modules/Scorm2004/classes/class.ilSCORM2004PageGUI.php");
     //		ilSCORM2004PageGUI::addPreparationJavascript($tpl, $lk);
     $tpl->addJavaScript("./Modules/Scorm2004/scripts/questions/question_handling.js");
     $tpl->addCss("./Modules/Scorm2004/templates/default/question_handling.css");
     include_once "./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
     ilOverlayGUI::initJavascript();
     //inline JS
     $output .= '<script type="text/javascript" src="./Modules/Scorm2004/scripts/questions/question_handling.js"></script>';
     $tpl->setVariable("CONTENT", $output);
 }
 protected function initLearningProgressDetailsLayer()
 {
     global $tpl;
     include_once "./Services/YUI/classes/class.ilYuiUtil.php";
     ilYuiUtil::initPanel();
     include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
     iljQueryUtil::initjQuery();
     $tpl->addJavascript("./Services/Tracking/js/ilObjStat.js");
 }
 /**
  * generates frame layout
  */
 function layout($a_xml = "main.xml", $doShow = true)
 {
     global $tpl, $ilSetting, $ilCtrl, $ilUser;
     $layout = $this->determineLayout();
     // xmldocfile is deprecated! Use domxml_open_file instead.
     // But since using relative pathes with domxml under windows don't work,
     // we need another solution:
     $xmlfile = file_get_contents("./Modules/LearningModule/layouts/lm/" . $layout . "/" . $a_xml);
     if (!($doc = domxml_open_mem($xmlfile))) {
         include_once "./Modules/LearningModule/exceptions/class.ilLMPresentationException.php";
         throw new ilLMPresentationException("ilLMPresentation: XML File invalid. Error reading " . $layout . "/" . $a_xml . ".");
     }
     $this->layout_doc = $doc;
     //echo ":".htmlentities($xmlfile).":$layout:$a_xml:";
     // get current frame node
     $xpc = xpath_new_context($doc);
     $path = empty($_GET["frame"]) || $_GET["frame"] == "_blank" ? "/ilLayout/ilFrame[1]" : "//ilFrame[@name='" . $_GET["frame"] . "']";
     $result = xpath_eval($xpc, $path);
     $found = $result->nodeset;
     if (count($found) != 1) {
         include_once "./Modules/LearningModule/exceptions/class.ilLMPresentationException.php";
         throw new ilLMPresentationException("ilLMPresentation: XML File invalid. Found " . count($found) . " nodes for " . " path " . $path . " in " . $layout . "/" . $a_xml . ". LM Layout is " . $this->lm->getLayout());
     }
     $node = $found[0];
     // ProcessFrameset
     // node is frameset, if it has cols or rows attribute
     $attributes = $this->attrib2arr($node->attributes());
     $this->frames = array();
     if (!empty($attributes["rows"]) || !empty($attributes["cols"])) {
         $content .= $this->buildTag("start", "frameset", $attributes);
         //$this->frames = array();
         $this->processNodes($content, $node);
         $content .= $this->buildTag("end", "frameset");
         $this->tpl = new ilTemplate("tpl.frameset.html", true, true, "Modules/LearningModule");
         $this->renderPageTitle();
         $this->tpl->setVariable("FS_CONTENT", $content);
         if (!$doshow) {
             $content = $this->tpl->get();
         }
     } else {
         // ProcessContentTag
         //if ((empty($attributes["template"]) || !empty($_GET["obj_type"])))
         if ((empty($attributes["template"]) || !empty($_GET["obj_type"])) && ($_GET["frame"] != "_blank" || $_GET["obj_type"] != "MediaObject")) {
             // we got a variable content frame (can display different
             // object types (PageObject, MediaObject, GlossarItem)
             // and contains elements for them)
             // determine object type
             if (empty($_GET["obj_type"])) {
                 $obj_type = "PageObject";
             } else {
                 $obj_type = $_GET["obj_type"];
             }
             // get object specific node
             $childs = $node->child_nodes();
             $found = false;
             foreach ($childs as $child) {
                 if ($child->node_name() == $obj_type) {
                     $found = true;
                     $attributes = $this->attrib2arr($child->attributes());
                     $node = $child;
                     //echo "<br>2node:".$node->node_name();
                     break;
                 }
             }
             if (!$found) {
                 echo "ilLMPresentation: No template specified for frame '" . $_GET["frame"] . "' and object type '" . $obj_type . "'.";
                 exit;
             }
         }
         // get template
         $in_module = $attributes["template_location"] == "module" ? true : false;
         if ($in_module) {
             $this->tpl = new ilTemplate($attributes["template"], true, true, $in_module);
             $this->tpl->setBodyClass("");
         } else {
             $this->tpl = $tpl;
         }
         // set style sheets
         if (!$this->offlineMode()) {
             $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
         } else {
             $style_name = $ilUser->getPref("style") . ".css";
             $this->tpl->setVariable("LOCATION_STYLESHEET", "./style/" . $style_name);
         }
         include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
         iljQueryUtil::initjQuery($this->tpl);
         iljQueryUtil::initjQueryUI($this->tpl);
         include_once "./Services/UICore/classes/class.ilUIFramework.php";
         ilUIFramework::init($this->tpl);
         // to make e.g. advanced seletions lists work:
         $GLOBALS["tpl"] = $this->tpl;
         $childs = $node->child_nodes();
         foreach ($childs as $child) {
             $child_attr = $this->attrib2arr($child->attributes());
             switch ($child->node_name()) {
                 case "ilMainMenu":
                     $this->ilMainMenu();
                     $this->renderPageTitle();
                     break;
                 case "ilTOC":
                     $this->ilTOC($child_attr["target_frame"]);
                     break;
                 case "ilPage":
                     switch ($this->lm->getType()) {
                         case "lm":
                             unset($_SESSION["tr_id"]);
                             unset($_SESSION["bib_id"]);
                             unset($_SESSION["citation"]);
                             $content = $this->ilPage($child);
                             break;
                     }
                     break;
                 case "ilGlossary":
                     $content = $this->ilGlossary($child);
                     break;
                 case "ilLMNavigation":
                     $this->ilLMNavigation();
                     break;
                 case "ilMedia":
                     $this->ilMedia();
                     break;
                 case "ilLocator":
                     $this->ilLocator();
                     break;
                 case "ilJavaScript":
                     $this->ilJavaScript($child_attr["inline"], $child_attr["file"], $child_attr["location"]);
                     break;
                 case "ilLMMenu":
                     $this->ilLMMenu();
                     break;
                 case "ilLMHead":
                     $this->ilLMHead();
                     break;
                 case "ilLMSubMenu":
                     $this->ilLMSubMenu();
                     break;
                 case "ilLMNotes":
                     $this->ilLMNotes();
                     break;
             }
         }
         // TODO: Very dirty hack to force the import of JavaScripts in learning content in the FAQ frame (e.g. if jsMath is in the content)
         // Unfortunately there is no standardized way to do this somewhere else. Calling fillJavaScripts always in ilTemplate causes multiple additions of the the js files.
         // 19.7.2014: outcommented, since fillJavaScriptFiles is called in the next blocks, and the
         // following lines would add the js files two times
         //			if (strcmp($_GET["frame"], "topright") == 0) $this->tpl->fillJavaScriptFiles();
         //			if (strcmp($_GET["frame"], "right") == 0) $this->tpl->fillJavaScriptFiles();
         //			if (strcmp($_GET["frame"], "botright") == 0) $this->tpl->fillJavaScriptFiles();
         if (!$this->offlineMode()) {
             include_once "./Services/Accordion/classes/class.ilAccordionGUI.php";
             ilAccordionGUI::addJavaScript();
             ilAccordionGUI::addCss();
             $this->tpl->addJavascript("./Modules/LearningModule/js/LearningModule.js");
             include_once "./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php";
             $close_call = "il.LearningModule.setCloseHTML('" . ilGlyphGUI::get(ilGlyphGUI::CLOSE) . "');";
             $this->tpl->addOnLoadCode($close_call);
             //$store->set("cf_".$this->lm->getId());
             // handle initial content
             if ($_GET["frame"] == "") {
                 include_once "./Services/Authentication/classes/class.ilSessionIStorage.php";
                 $store = new ilSessionIStorage("lm");
                 $last_frame_url = $store->get("cf_" . $this->lm->getId());
                 if ($last_frame_url != "") {
                     $this->tpl->addOnLoadCode("il.LearningModule.setLastFrameUrl('" . $last_frame_url . "', 'center_bottom');");
                 }
                 if (in_array($layout, array("toc2windyn"))) {
                     $this->tpl->addOnLoadCode("il.LearningModule.setSaveUrl('" . $ilCtrl->getLinkTarget($this, "saveFrameUrl", "", false, false) . "');\n\t\t\t\t\t\t\til.LearningModule.openInitFrames();\n\t\t\t\t\t\t\t");
                 }
                 $this->tpl->addOnLoadCode("il.LearningModule.setTocRefreshUrl('" . $ilCtrl->getLinkTarget($this, "refreshToc", "", false, false) . "');\n\t\t\t\t\t\t\t");
             }
             // from main menu
             //				$this->tpl->addJavascript("./Services/JavaScript/js/Basic.js");
             $this->tpl->addJavascript("./Services/Navigation/js/ServiceNavigation.js");
             $this->tpl->fillJavaScriptFiles();
             $this->tpl->fillScreenReaderFocus();
             $this->tpl->fillCssFiles();
         } else {
             // reset standard css files
             $this->tpl->resetJavascript();
             $this->tpl->resetCss();
             include_once "./Modules/LearningModule/classes/class.ilObjContentObject.php";
             foreach (ilObjContentObject::getSupplyingExportFiles() as $f) {
                 if ($f["type"] == "js") {
                     $this->tpl->addJavascript($f["target"]);
                 }
                 if ($f["type"] == "css") {
                     $this->tpl->addCSS($f["target"]);
                 }
             }
             $this->tpl->fillJavaScriptFiles(true);
             $this->tpl->fillCssFiles(true);
         }
         $this->tpl->fillBodyClass();
     }
     if ($doShow) {
         // (horrible) workaround for preventing template engine
         // from hiding paragraph text that is enclosed
         // in curly brackets (e.g. "{a}", see ilPageObjectGUI::showPage())
         $this->tpl->fillTabs();
         if ($this->fill_on_load_code) {
             $this->tpl->fillOnLoadCode();
         }
         $content = $this->tpl->get();
         $content = str_replace("&#123;", "{", $content);
         $content = str_replace("&#125;", "}", $content);
         header('Content-type: text/html; charset=UTF-8');
         echo $content;
     } else {
         $this->tpl->fillLeftNav();
         $this->tpl->fillOnLoadCode();
         $content = $this->tpl->get();
     }
     return $content;
 }
Example #29
0
 /**
  * Initializes the preview and loads the needed javascripts and styles.
  */
 private static function initPreview()
 {
     if (self::$initialized) {
         return;
     }
     global $tpl, $lng, $ilCtrl;
     // jquery
     include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
     iljQueryUtil::initjQuery();
     // load qtip
     include_once "./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php";
     ilTooltipGUI::initLibrary();
     // needed scripts & styles
     $tpl->addJavaScript("./Services/Preview/js/jquery.mousewheel.js");
     $tpl->addJavaScript("./Services/Preview/js/ilPreview.js");
     $tpl->addCss(ilUtil::getStyleSheetLocation("filesystem", "preview.css", "Services/Preview"));
     // create loading template
     $tmpl = new ilTemplate("tpl.preview.html", true, true, "Services/Preview");
     $tmpl->setCurrentBlock("no_preview");
     $tmpl->setVariable("TXT_NO_PREVIEW", "%%0%%");
     $tmpl->parseCurrentBlock();
     $initialHtml = str_replace(array("\r\n", "\r"), "\n", $tmpl->get());
     $lines = explode("\n", $initialHtml);
     $new_lines = array();
     foreach ($lines as $i => $line) {
         if (!empty($line)) {
             $new_lines[] = trim($line);
         }
     }
     $initialHtml = implode($new_lines);
     // add default texts and values
     include_once "./Services/JSON/classes/class.ilJsonUtil.php";
     $tpl->addOnLoadCode("il.Preview.texts.preview = \"" . self::jsonSafeString($lng->txt("preview")) . "\";");
     $tpl->addOnLoadCode("il.Preview.texts.showPreview = \"" . self::jsonSafeString($lng->txt("preview_show")) . "\";");
     $tpl->addOnLoadCode("il.Preview.texts.close = \"" . self::jsonSafeString($lng->txt("close")) . "\";");
     $tpl->addOnLoadCode("il.Preview.previewSize = " . ilPreviewSettings::getImageSize() . ";");
     $tpl->addOnLoadCode("il.Preview.initialHtml = " . ilJsonUtil::encode($initialHtml) . ";");
     $tpl->addOnLoadCode("il.Preview.highlightClass = \"ilContainerListItemOuterHighlight\";");
     $tpl->addOnLoadCode("il.Preview.init();");
     self::$initialized = true;
 }
 /**
  * Get supplying export files
  *
  * @param
  * @return
  */
 static function getSupplyingExportFiles($a_target_dir = ".")
 {
     include_once "./Services/YUI/classes/class.ilYuiUtil.php";
     include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
     include_once "./Services/MediaObjects/classes/class.ilPlayerUtil.php";
     $scripts = array(array("source" => ilYuiUtil::getLocalPath('yahoo/yahoo-min.js'), "target" => $a_target_dir . '/js/yahoo/yahoo-min.js', "type" => "js"), array("source" => ilYuiUtil::getLocalPath('yahoo-dom-event/yahoo-dom-event.js'), "target" => $a_target_dir . '/js/yahoo/yahoo-dom-event.js', "type" => "js"), array("source" => ilYuiUtil::getLocalPath('animation/animation-min.js'), "target" => $a_target_dir . '/js/yahoo/animation-min.js', "type" => "js"), array("source" => './Services/JavaScript/js/Basic.js', "target" => $a_target_dir . '/js/Basic.js', "type" => "js"), array("source" => './Services/Accordion/js/accordion.js', "target" => $a_target_dir . '/js/accordion.js', "type" => "js"), array("source" => './Services/Accordion/css/accordion.css', "target" => $a_target_dir . '/css/accordion.css', "type" => "css"), array("source" => iljQueryUtil::getLocaljQueryPath(), "target" => $a_target_dir . '/js/jquery.js', "type" => "js"), array("source" => iljQueryUtil::getLocalMaphilightPath(), "target" => $a_target_dir . '/js/maphilight.js', "type" => "js"), array("source" => iljQueryUtil::getLocaljQueryUIPath(), "target" => $a_target_dir . '/js/jquery-ui-min.js', "type" => "js"), array("source" => './Services/COPage/js/ilCOPagePres.js', "target" => $a_target_dir . '/js/ilCOPagePres.js', "type" => "js"), array("source" => './Modules/Scorm2004/scripts/questions/pure.js', "target" => $a_target_dir . '/js/pure.js', "type" => "js"), array("source" => './Modules/Scorm2004/scripts/questions/question_handling.js', "target" => $a_target_dir . '/js/question_handling.js', "type" => "js"), array("source" => './Modules/Scorm2004/templates/default/question_handling.css', "target" => $a_target_dir . '/css/question_handling.css', "type" => "css"), array("source" => ilPlayerUtil::getLocalMediaElementJsPath(), "target" => $a_target_dir . "/" . ilPlayerUtil::getLocalMediaElementJsPath(), "type" => "js"), array("source" => ilPlayerUtil::getLocalMediaElementCssPath(), "target" => $a_target_dir . "/" . ilPlayerUtil::getLocalMediaElementCssPath(), "type" => "css"));
     $mathJaxSetting = new ilSetting("MathJax");
     $use_mathjax = $mathJaxSetting->get("enable");
     if ($use_mathjax) {
         $scripts[] = array("source" => "", "target" => $mathJaxSetting->get("path_to_mathjax"), "type" => "js");
     }
     return $scripts;
 }