コード例 #1
0
ファイル: class.ilTemplate.php プロジェクト: bheyser/qplskl
 /**
  * @access	public
  * @param	string
  * @param bool fill template variable {TABS} with content of ilTabs
  */
 function show($part = "DEFAULT", $a_fill_tabs = true, $a_skip_main_menu = false)
 {
     global $ilias, $ilTabs;
     // include yahoo dom per default
     include_once "./Services/YUI/classes/class.ilYuiUtil.php";
     ilYuiUtil::initDom();
     //echo "-".ilUtil::getP3PLocation()."-";
     //header('P3P: policyref="'.ilUtil::getP3PLocation().
     //	'", CP="CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa OUR BUS IND UNI COM NAV INT CNT STA PRE"');
     header('P3P: CP="CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa OUR BUS IND UNI COM NAV INT CNT STA PRE"');
     header("Content-type: " . $this->getContentType() . "; charset=UTF-8");
     $this->fillMessage();
     // display ILIAS footer
     if ($part !== false) {
         $this->addILIASFooter();
     }
     // set standard parts (tabs and title icon)
     $this->fillBodyClass();
     if ($a_fill_tabs) {
         if ($this->blockExists("content")) {
             // determine default screen id
             $this->getTabsHTML();
         }
         // to get also the js files for the main menu
         if (!$a_skip_main_menu) {
             $this->getMainMenu();
             $this->initHelp();
         }
         if ($this->blockExists("content") && $this->variableExists('MAINMENU')) {
             global $tpl;
             include_once 'Services/Authentication/classes/class.ilSessionReminderGUI.php';
             $session_reminder_gui = new ilSessionReminderGUI(ilSessionReminder::createInstanceWithCurrentUserSession());
             $tpl->setVariable('SESSION_REMINDER', $session_reminder_gui->getHtml());
         }
         // these fill blocks in tpl.main.html
         $this->fillCssFiles();
         $this->fillInlineCss();
         //$this->fillJavaScriptFiles();
         $this->fillContentStyle();
         // these fill just plain placeholder variables in tpl.main.html
         $this->setCurrentBlock("DEFAULT");
         $this->fillNewContentStyle();
         $this->fillContentLanguage();
         $this->fillWindowTitle();
         // these fill blocks in tpl.adm_content.html
         $this->fillHeader();
         $this->fillSideIcons();
         $this->fillScreenReaderFocus();
         $this->fillStopFloating();
         $this->fillLeftContent();
         $this->fillLeftNav();
         $this->fillRightContent();
         $this->fillAdminPanel();
         $this->fillToolbar();
         $this->fillPermanentLink();
         $this->setCenterColumnClass();
         // late loading of javascipr files, since operations above may add files
         $this->fillJavaScriptFiles();
         $this->fillOnLoadCode();
         // these fill just plain placeholder variables in tpl.adm_content.html
         // these fill just plain placeholder variables in tpl.adm_content.html
         if ($this->blockExists("content")) {
             $this->setCurrentBlock("content");
             $this->fillTabs();
             $this->fillMainContent();
             $this->fillMainMenu();
             $this->fillLightbox();
             $this->parseCurrentBlock();
         }
     }
     if ($part == "DEFAULT" or is_bool($part)) {
         $html = parent::get();
     } else {
         $html = parent::get($part);
     }
     // include the template output hook
     global $ilPluginAdmin;
     $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
     foreach ($pl_names as $pl) {
         $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
         $gui_class = $ui_plugin->getUIClassInstance();
         $resp = $gui_class->getHTML("", "template_show", array("tpl_id" => $this->tplIdentifier, "tpl_obj" => $this, "html" => $html));
         if ($resp["mode"] != ilUIHookPluginGUI::KEEP) {
             $html = $gui_class->modifyHTML($html, $resp);
         }
     }
     print $html;
     $this->handleReferer();
 }
コード例 #2
0
 /**
  * Save general settings
  */
 public function saveGeneralSettings()
 {
     global $tpl, $lng, $ilCtrl, $ilUser;
     $this->initGeneralSettingsForm();
     if ($this->form->checkInput()) {
         if ($this->workWithUserSetting("skin_style")) {
             //set user skin and style
             if ($_POST["skin_style"] != "") {
                 $sknst = explode(":", $_POST["skin_style"]);
                 if ($ilUser->getPref("style") != $sknst[1] || $ilUser->getPref("skin") != $sknst[0]) {
                     $ilUser->setPref("skin", $sknst[0]);
                     $ilUser->setPref("style", $sknst[1]);
                 }
             }
         }
         // language
         if ($this->workWithUserSetting("language")) {
             $ilUser->setLanguage($_POST["language"]);
         }
         // hits per page
         if ($this->workWithUserSetting("hits_per_page")) {
             if ($_POST["hits_per_page"] != "") {
                 $ilUser->setPref("hits_per_page", $_POST["hits_per_page"]);
             }
         }
         // set show users online
         if ($this->workWithUserSetting("show_users_online")) {
             $ilUser->setPref("show_users_online", $_POST["show_users_online"]);
         }
         // store last visited?
         global $ilNavigationHistory;
         $ilUser->setPref("store_last_visited", (int) $_POST["store_last_visited"]);
         if ((int) $_POST["store_last_visited"] > 0) {
             $ilNavigationHistory->deleteDBEntries();
             if ((int) $_POST["store_last_visited"] == 2) {
                 $ilNavigationHistory->deleteSessionEntries();
             }
         }
         // set hide own online_status
         if ($this->workWithUserSetting("hide_own_online_status")) {
             if ($_POST["hide_own_online_status"] == 1) {
                 $ilUser->setPref("hide_own_online_status", "y");
             } else {
                 $ilUser->setPref("hide_own_online_status", "n");
             }
         }
         // set show users online
         if ($this->workWithUserSetting("screen_reader_optimization")) {
             $ilUser->setPref("screen_reader_optimization", $_POST["screen_reader_optimization"]);
         }
         // session reminder
         include_once 'Services/Authentication/classes/class.ilSessionReminder.php';
         if (ilSessionReminder::isGloballyActivated()) {
             $ilUser->setPref('session_reminder_enabled', (int) $this->form->getInput('session_reminder_enabled'));
             $ilUser->setPref('session_reminder_lead_time', $this->form->getInput('session_reminder_lead_time'));
         }
         // starting point
         include_once "Services/User/classes/class.ilUserUtil.php";
         if (ilUserUtil::hasPersonalStartingPoint()) {
             ilUserUtil::setPersonalStartingPoint($this->form->getInput('usr_start'), $this->form->getInput('usr_start_ref_id'));
         }
         // selector for unicode characters
         global $ilSetting;
         if ($ilSetting->get('char_selector_availability') > 0) {
             require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
             $char_selector = new ilCharSelectorGUI(ilCharSelectorConfig::CONTEXT_USER);
             $char_selector->getFormValues($this->form);
             $ilUser->setPref('char_selector_availability', $char_selector->getConfig()->getAvailability());
             $ilUser->setPref('char_selector_definition', $char_selector->getConfig()->getDefinition());
         }
         $ilUser->update();
         // calendar settings
         include_once 'Services/Calendar/classes/class.ilCalendarUserSettings.php';
         $user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
         $user_settings->setTimeZone($this->form->getInput("timezone"));
         $user_settings->setDateFormat((int) $this->form->getInput("date_format"));
         $user_settings->setTimeFormat((int) $this->form->getInput("time_format"));
         $user_settings->save();
         ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
         $ilCtrl->redirect($this, "showGeneralSettings");
     }
     $this->form->setValuesByPost();
     $this->showGeneralSettings(true);
 }