/**
  * Get singelton instance
  * @return ilAuthLoginPageEditorSettings
  */
 public static function getInstance()
 {
     if (self::$instance) {
         return self::$instance;
     }
     return self::$instance = new ilAuthLoginPageEditorSettings();
 }
 /**
  * Parse input data
  */
 public function parse()
 {
     $installed = $this->lng->getInstalledLanguages();
     $tbl_data = array();
     $counter = 0;
     foreach ($installed as $key => $langkey) {
         $tbl_data[$counter]['key'] = $langkey;
         $tbl_data[$counter]['id'] = ilLanguage::lookupId($langkey);
         $tbl_data[$counter]['status'] = ilAuthLoginPageEditorSettings::getInstance()->isIliasEditorEnabled($langkey);
         ++$counter;
     }
     $this->setData($tbl_data);
 }
 /**
  * Activate languages
  */
 protected function activate()
 {
     $settings = ilAuthLoginPageEditorSettings::getInstance();
     foreach ((array) $_POST['visible_languages'] as $lang_key) {
         $settings->enableIliasEditor($lang_key, in_array($lang_key, (array) $_POST['languages']));
     }
     $settings->update();
     ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
     $this->ctrl->redirect($this, 'show');
 }
Пример #4
0
 /**
  * Get HTML of ILIAS login page editor
  * @return string html
  */
 protected function getLoginPageEditorHTML()
 {
     global $lng, $tpl;
     include_once './Services/Authentication/classes/class.ilAuthLoginPageEditorSettings.php';
     $lpe = ilAuthLoginPageEditorSettings::getInstance();
     $active_lang = $lpe->getIliasEditorLanguage($lng->getLangKey());
     if (!$active_lang) {
         return '';
     }
     // if page does not exist, return nothing
     include_once './Services/COPage/classes/class.ilPageUtil.php';
     if (!ilPageUtil::_existsAndNotEmpty('auth', ilLanguage::lookupId($active_lang))) {
         return '';
     }
     include_once './Services/Authentication/classes/class.ilLoginPage.php';
     include_once './Services/Authentication/classes/class.ilLoginPageGUI.php';
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->parseCurrentBlock();
     // get page object
     $page_gui = new ilLoginPageGUI(ilLanguage::lookupId($active_lang));
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $page_gui->setStyleId(0, 'auth');
     $page_gui->setPresentationTitle("");
     $page_gui->setTemplateOutput(false);
     $page_gui->setHeader("");
     $ret = $page_gui->showPage();
     return $ret;
 }
 /**
  * Get HTML of ILIAS login page editor
  * @return string html
  */
 protected function getLoginPageEditorHTML()
 {
     global $lng, $tpl;
     include_once './Services/Authentication/classes/class.ilAuthLoginPageEditorSettings.php';
     $lpe = ilAuthLoginPageEditorSettings::getInstance();
     $active_lang = $lpe->getIliasEditorLanguage($lng->getLangKey());
     if (!$active_lang) {
         return '';
     }
     // if page does not exist, return nothing
     include_once './Services/COPage/classes/class.ilPageUtil.php';
     if (!ilPageUtil::_existsAndNotEmpty('auth', ilLanguage::lookupId($active_lang))) {
         return '';
     }
     include_once './Services/COPage/classes/class.ilPageObject.php';
     include_once './Services/COPage/classes/class.ilPageObjectGUI.php';
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->parseCurrentBlock();
     // get page object
     $page_gui = new ilPageObjectGUI('auth', ilLanguage::lookupId($active_lang));
     /*
     		include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
     		$page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
     			$this->object->getStyleSheetId(), $this->object->getType()));
     */
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $page_gui->setStyleId(0, 'auth');
     $page_gui->setIntLinkHelpDefault("RepositoryItem", $active_lang);
     //$page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile"));
     //$page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "showMediaFullscreen"));
     //$page_gui->setLinkParams($this->ctrl->getUrlParameterString()); // todo
     //		$page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this, ""));
     $page_gui->setPresentationTitle("");
     $page_gui->setTemplateOutput(false);
     $page_gui->setHeader("");
     $page_gui->setEnabledRepositoryObjects(true);
     $page_gui->setEnabledLoginPage(true);
     $page_gui->setEnabledFileLists(false);
     $page_gui->setEnabledPCTabs(false);
     $page_gui->setEnabledMaps(true);
     $ret = $page_gui->showPage();
     return $ret;
 }