ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilAuthLoginPageEditorGUI Class Reference

Login page editor settings GUI ILIAS page editor or richtext editor. More...

+ Collaboration diagram for ilAuthLoginPageEditorGUI:

Public Member Functions

 __construct ($a_ref_id)
 Constructor. More...
 
 getSettings ()
 Get Settings. More...
 
 getRefId ()
 
 executeCommand ()
 ilCtrl execute command More...
 

Protected Member Functions

 forwardToPageObject ()
 Forward to page editor. More...
 
 show ()
 Show current activated editor. More...
 
 addEditorSwitch ()
 Show editore switch ilToolbarGUI $ilToolbar. More...
 
 switchIPE ()
 Switch editor mode. More...
 
 switchRTE ()
 Switch editor mode. More...
 
 activate ()
 Activate languages. More...
 
 showIliasEditor ()
 Show ILIAS page editor summary. More...
 
 showRichtextEditor ()
 Show richtext editor ilRbacSystem $rbacsystem ilLanguage $lng ilSetting $ilSetting. More...
 
 saveLoginInfo ()
 saves the login information data More...
 
 initLoginForm ()
 Init login form. More...
 
 setDefLangFirst ($a_def_language, $a_languages)
 returns an array of all installed languages, default language at the first position More...
 

Protected Attributes

 $ctrl = null
 
 $lng = null
 

Private Attributes

 $ref_id = 0
 
 $settings = null
 

Detailed Description

Login page editor settings GUI ILIAS page editor or richtext editor.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

ilAuthLoginPageEditorGUI: ilObjAuthSettingsGUI ilAuthLoginPageEditorGUI: ilLoginPageGUI

Definition at line 15 of file class.ilAuthLoginPageEditorGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilAuthLoginPageEditorGUI::__construct (   $a_ref_id)

Constructor.

Parameters
int$a_ref_idilCtrl ilCtrl

Definition at line 33 of file class.ilAuthLoginPageEditorGUI.php.

References $DIC, $ilCtrl, $lng, ilAuthLoginPageEditorSettings\getInstance(), and settings().

34  {
35  global $DIC;
36 
37  $ilCtrl = $DIC['ilCtrl'];
38  $lng = $DIC['lng'];
39 
40  $this->ctrl = $ilCtrl;
41  $this->lng = $lng;
42  $this->lng->loadLanguageModule('auth');
43  $this->ref_id = $a_ref_id;
44 
46  }
settings()
Definition: settings.php:2
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
static getInstance()
Get singelton instance.
+ Here is the call graph for this function:

Member Function Documentation

◆ activate()

ilAuthLoginPageEditorGUI::activate ( )
protected

Activate languages.

Definition at line 232 of file class.ilAuthLoginPageEditorGUI.php.

References $_POST, $settings, and ilAuthLoginPageEditorSettings\getInstance().

233  {
235  foreach ((array) $_POST['visible_languages'] as $lang_key) {
236  $settings->enableIliasEditor($lang_key, in_array($lang_key, (array) $_POST['languages']));
237  }
238  $settings->update();
239 
240  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
241  $this->ctrl->redirect($this, 'show');
242  }
static getInstance()
Get singelton instance.
$_POST["username"]
+ Here is the call graph for this function:

◆ addEditorSwitch()

ilAuthLoginPageEditorGUI::addEditorSwitch ( )
protected

Show editore switch ilToolbarGUI $ilToolbar.

Definition at line 178 of file class.ilAuthLoginPageEditorGUI.php.

References $DIC, getSettings(), ilAuthLoginPageEditorSettings\MODE_IPE, and ilAuthLoginPageEditorSettings\MODE_RTE.

Referenced by show().

179  {
180  global $DIC;
181 
182  $ilToolbar = $DIC['ilToolbar'];
183 
184  $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
185  switch ($this->getSettings()->getMode()) {
187 
188  $ilToolbar->addButton(
189  $this->lng->txt('login_page_switch_ipe'),
190  $this->ctrl->getLinkTarget($this, 'switchIPE')
191  );
192  break;
193 
195 
196  $ilToolbar->addButton(
197  $this->lng->txt('login_page_switch_rte'),
198  $this->ctrl->getLinkTarget($this, 'switchRTE')
199  );
200  break;
201  }
202  return;
203  }
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilAuthLoginPageEditorGUI::executeCommand ( )

ilCtrl execute command

Definition at line 68 of file class.ilAuthLoginPageEditorGUI.php.

References $_GET, $GLOBALS, and forwardToPageObject().

69  {
70  switch ($this->ctrl->getNextClass($this)) {
71  case 'illoginpagegui':
72  $GLOBALS['DIC']['ilTabs']->clearTargets();
73  $GLOBALS['DIC']['ilTabs']->setBackTarget(
74  $this->lng->txt('back'),
75  $this->ctrl->getLinkTarget($this, 'show'),
76  '_top'
77  );
78 
79  if ($_GET["redirectSource"] != "ilinternallinkgui") {
80  $this->forwardToPageObject();
81  } else {
82  return '';
83  }
84  break;
85 
86  default:
87  if (!$cmd = $this->ctrl->getCmd()) {
88  $cmd = 'show';
89  }
90  $this->$cmd();
91  break;
92  }
93  }
forwardToPageObject()
Forward to page editor.
$_GET["client_id"]
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ forwardToPageObject()

ilAuthLoginPageEditorGUI::forwardToPageObject ( )
protected

Forward to page editor.

Definition at line 99 of file class.ilAuthLoginPageEditorGUI.php.

References $DIC, $html, $key, $lng, $tpl, ilPageObject\_exists(), ilObjStyleSheet\getContentStylePath(), ilObjStyleSheet\getEffectiveContentStyleId(), and ilObjStyleSheet\getSyntaxStylePath().

Referenced by executeCommand().

100  {
101  global $DIC;
102 
103  $lng = $DIC['lng'];
104  $tpl = $DIC['tpl'];
105 
106  $key = (int) $_REQUEST['key'];
107  $this->ctrl->saveParameter($this, 'key', $key);
108 
109  include_once("./Services/Authentication/classes/class.ilLoginPage.php");
110  include_once("./Services/Authentication/classes/class.ilLoginPageGUI.php");
111  include_once './Services/Style/Content/classes/class.ilObjStyleSheet.php';
112 
113  $lng->loadLanguageModule("content");
114 
115  if (!ilLoginPage::_exists('auth', $key)) {
116  // doesn't exist -> create new one
117  $new_page_object = new ilLoginPage();
118  $new_page_object->setParentId($key);
119  $new_page_object->setId($key);
120  $new_page_object->createFromXML();
121  }
122 
123  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
124  $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
125  $tpl->setCurrentBlock("SyntaxStyle");
126  $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
127  $tpl->parseCurrentBlock();
128 
129 
130  $this->ctrl->setReturnByClass('illoginpagegui', "edit");
131  $page_gui = new ilLoginPageGUI($key);
132 
133  $page_gui->setTemplateTargetVar("ADM_CONTENT");
134  $page_gui->setLinkXML($link_xml);
135  //$page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments());
136  //$page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile"));
137  //$page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "showMediaFullscreen"));
138  //$page_gui->setLinkParams($this->ctrl->getUrlParameterString()); // todo
139  // $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this, ""));
140  $page_gui->setPresentationTitle("");
141  $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0));
142  $page_gui->setTemplateOutput(false);
143  //$page_gui->setLocator($contObjLocator);
144  $page_gui->setHeader("");
145 
146  // style tab
147  //$page_gui->setTabHook($this, "addPageTabs");
148 
149  if ($this->ctrl->getCmd() == 'editPage') {
150  $this->ctrl->setCmd('edit');
151  }
152  $html = $this->ctrl->forwardCommand($page_gui);
153 
154  $tpl->setContent($html);
155  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
Login page GUI class.
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true)
get content style path
Login page object.
$key
Definition: croninfo.php:18
$html
Definition: example_001.php:87
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRefId()

ilAuthLoginPageEditorGUI::getRefId ( )
Returns
int ref_id

Definition at line 60 of file class.ilAuthLoginPageEditorGUI.php.

References $ref_id.

◆ getSettings()

ilAuthLoginPageEditorGUI::getSettings ( )

Get Settings.

Returns
ilAuthLoginPageEditorSettings

Definition at line 52 of file class.ilAuthLoginPageEditorGUI.php.

References $settings.

Referenced by addEditorSwitch(), show(), switchIPE(), and switchRTE().

+ Here is the caller graph for this function:

◆ initLoginForm()

ilAuthLoginPageEditorGUI::initLoginForm ( )
protected

Init login form.

Definition at line 339 of file class.ilAuthLoginPageEditorGUI.php.

References $DIC, $ilSetting, $key, $languages, $lng, $message, PHPMailer\PHPMailer\$options, ilLDAPServer\_getFirstActiveServer(), ilRadiusSettings\_getInstance(), AUTH_LDAP, AUTH_LOCAL, AUTH_RADIUS, setDefLangFirst(), ilTextAreaInputGUI\setRows(), and ilSelectInputGUI\setValue().

Referenced by saveLoginInfo(), and showRichtextEditor().

340  {
341  global $DIC;
342 
343  $rbacsystem = $DIC['rbacsystem'];
344  $lng = $DIC['lng'];
345  $ilSetting = $DIC['ilSetting'];
346 
347  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
348  $this->form = new ilPropertyFormGUI();
349  $this->form->setFormAction($this->ctrl->getFormAction($this, 'saveLoginInfo'));
350  $this->form->setTableWidth('80%');
351  $this->form->setTitle($this->lng->txt('login_information'));
352 
353  $this->form->addCommandButton('saveLoginInfo', $this->lng->txt('save'));
354 
355  include_once('Services/LDAP/classes/class.ilLDAPServer.php');
356  include_once('Services/Radius/classes/class.ilRadiusSettings.php');
357  $rad_settings = ilRadiusSettings::_getInstance();
358  if ($ldap_id = ilLDAPServer::_getFirstActiveServer() or $rad_settings->isActive()) {
359  $select = new ilSelectInputGUI($this->lng->txt('default_auth_mode'), 'default_auth_mode');
360  $select->setValue($ilSetting->get('default_auth_mode', AUTH_LOCAL));
361  $select->setInfo($this->lng->txt('default_auth_mode_info'));
362  $options[AUTH_LOCAL] = $this->lng->txt('auth_local');
363  if ($ldap_id) {
364  $options[AUTH_LDAP] = $this->lng->txt('auth_ldap');
365  }
366  if ($rad_settings->isActive()) {
367  $options [AUTH_RADIUS] = $this->lng->txt('auth_radius');
368  }
369  $select->setOptions($options);
370  $this->form->addItem($select);
371  }
372 
373  if (!is_object($this->loginSettings)) {
374  $this->loginSettings = new ilSetting("login_settings");
375  }
376 
377  $login_settings = $this->loginSettings->getAll();
378  $languages = $lng->getInstalledLanguages();
379  $def_language = $lng->getDefaultLanguage();
380 
381  foreach ($this->setDefLangFirst($def_language, $languages) as $lang_key) {
382  $add = "";
383  if ($lang_key == $def_language) {
384  $add = " (" . $lng->txt("default") . ")";
385  }
386 
387  $textarea = new ilTextAreaInputGUI(
388  $lng->txt("meta_l_" . $lang_key) . $add,
389  'login_message_' . $lang_key
390  );
391  $textarea->setRows(10);
392  $textarea->setValue($login_settings["login_message_" . $lang_key]);
393  $textarea->setUseRte(true);
394  $textarea->setRteTagSet("extended");
395  $this->form->addItem($textarea);
396 
397  unset($login_settings["login_message_" . $lang_key]);
398  }
399 
400  foreach ($login_settings as $key => $message) {
401  $lang_key = substr($key, strrpos($key, "_") + 1, strlen($key) - strrpos($key, "_"));
402 
403  $textarea = new ilTextAreaInputGUI(
404  $lng->txt("meta_l_" . $lang_key) . $add,
405  'login_message_' . $lang_key
406  );
407  $textarea->setRows(10);
408  $textarea->setValue($message);
409  $textarea->setUseRte(true);
410  $textarea->setRteTagSet("extended");
411  if (!in_array($lang_key, $languages)) {
412  $textarea->setAlert($lng->txt("not_installed"));
413  }
414  $this->form->addItem($textarea);
415  }
416  }
static _getFirstActiveServer()
Get first active server.
setDefLangFirst($a_def_language, $a_languages)
returns an array of all installed languages, default language at the first position ...
This class represents a selection list property in a property form.
This class represents a property form user interface.
global $DIC
Definition: saml.php:7
const AUTH_LDAP
catch(Exception $e) $message
setValue($a_value)
Set Value.
static _getInstance()
singleton get instance
const AUTH_LOCAL
global $ilSetting
Definition: privfeed.php:17
This class represents a text area property in a property form.
$languages
Definition: cssgen2.php:34
$key
Definition: croninfo.php:18
const AUTH_RADIUS
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveLoginInfo()

ilAuthLoginPageEditorGUI::saveLoginInfo ( )
protected

saves the login information data

protected

Author
Michael Jansen

Definition at line 301 of file class.ilAuthLoginPageEditorGUI.php.

References $_POST, $DIC, $ilErr, $ilSetting, $key, $lng, and initLoginForm().

302  {
303  global $DIC;
304 
305  $rbacsystem = $DIC['rbacsystem'];
306  $lng = $DIC['lng'];
307  $ilSetting = $DIC['ilSetting'];
308 
309  if (!$rbacsystem->checkAccess("write", $this->getRefId())) {
310  $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
311  }
312 
313  $this->initLoginForm();
314  if ($this->form->checkInput()) {
315  if (is_array($_POST)) {
316  // @todo: Move settings ilAuthLoginPageSettings
317  $this->loginSettings = new ilSetting("login_settings");
318 
319  foreach ($_POST as $key => $val) {
320  if (substr($key, 0, 14) == "login_message_") {
321  $this->loginSettings->set($key, $val);
322  }
323  }
324  }
325 
326  if ($_POST['default_auth_mode']) {
327  $ilSetting->set('default_auth_mode', (int) $_POST['default_auth_mode']);
328  }
329 
330  ilUtil::sendSuccess($this->lng->txt("login_information_settings_saved"), true);
331  }
332 
333  $this->ctrl->redirect($this, 'show');
334  }
global $DIC
Definition: saml.php:7
$ilErr
Definition: raiseError.php:18
global $ilSetting
Definition: privfeed.php:17
$key
Definition: croninfo.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ setDefLangFirst()

ilAuthLoginPageEditorGUI::setDefLangFirst (   $a_def_language,
  $a_languages 
)
protected

returns an array of all installed languages, default language at the first position

Parameters
string$a_def_languageDefault language of the current installation
array$a_languagesArray of all installed languages
Returns
array $languages Array of the installed languages, default language at first position public
Author
Michael Jansen

Definition at line 429 of file class.ilAuthLoginPageEditorGUI.php.

References $languages.

Referenced by initLoginForm().

430  {
431  if (is_array($a_languages) && $a_def_language != "") {
432  $languages = array();
433  $languages[] = $a_def_language;
434 
435  foreach ($a_languages as $val) {
436  if (!in_array($val, $languages)) {
437  $languages[] = $val;
438  }
439  }
440 
441  return $languages;
442  } else {
443  return array();
444  }
445  }
$languages
Definition: cssgen2.php:34
+ Here is the caller graph for this function:

◆ show()

ilAuthLoginPageEditorGUI::show ( )
protected

Show current activated editor.

Returns
void

Definition at line 161 of file class.ilAuthLoginPageEditorGUI.php.

References addEditorSwitch(), getSettings(), ilAuthLoginPageEditorSettings\MODE_IPE, ilAuthLoginPageEditorSettings\MODE_RTE, showIliasEditor(), and showRichtextEditor().

162  {
163  $this->addEditorSwitch();
164 
165  switch ($this->getSettings()->getMode()) {
167  return $this->showRichtextEditor();
168 
170  return $this->showIliasEditor();
171  }
172  }
showIliasEditor()
Show ILIAS page editor summary.
showRichtextEditor()
Show richtext editor ilRbacSystem $rbacsystem ilLanguage $lng ilSetting $ilSetting.
addEditorSwitch()
Show editore switch ilToolbarGUI $ilToolbar.
+ Here is the call graph for this function:

◆ showIliasEditor()

ilAuthLoginPageEditorGUI::showIliasEditor ( )
protected

Show ILIAS page editor summary.

Definition at line 247 of file class.ilAuthLoginPageEditorGUI.php.

References $DIC, $tbl, and $tpl.

Referenced by show().

248  {
249  global $DIC;
250 
251  $tpl = $DIC['tpl'];
252 
253  include_once './Services/Authentication/classes/class.ilAuthLoginPageEditorTableGUI.php';
254  $tbl = new ilAuthLoginPageEditorTableGUI($this, 'show');
255  $tbl->parse();
256 
257  $tpl->setContent($tbl->getHTML());
258  }
global $DIC
Definition: saml.php:7
$tbl
Definition: example_048.php:81
$tpl
Definition: ilias.php:10
+ Here is the caller graph for this function:

◆ showRichtextEditor()

ilAuthLoginPageEditorGUI::showRichtextEditor ( )
protected

Show richtext editor ilRbacSystem $rbacsystem ilLanguage $lng ilSetting $ilSetting.

Author
Michael Jansen

Definition at line 267 of file class.ilAuthLoginPageEditorGUI.php.

References $DIC, $ilErr, $ilSetting, $lng, $tpl, and initLoginForm().

Referenced by show().

268  {
269  global $DIC;
270 
271  $rbacsystem = $DIC['rbacsystem'];
272  $lng = $DIC['lng'];
273  $ilSetting = $DIC['ilSetting'];
274  $tpl = $DIC['tpl'];
275 
276  if (!$rbacsystem->checkAccess("visible,read", $this->getRefId())) {
277  $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
278  }
279  $lng->loadLanguageModule("meta");
280 
281  $tpl->addBlockFile(
282  "ADM_CONTENT",
283  "adm_content",
284  "tpl.auth_login_messages.html",
285  "Services/Authentication"
286  );
287  $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
288  $tpl->setVariable("TXT_HEADLINE", $this->lng->txt("login_information"));
289  $tpl->setVariable("TXT_DESCRIPTION", $this->lng->txt("login_information_desc"));
290  $tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
291  $this->initLoginForm();
292  $tpl->setVariable('LOGIN_INFO', $this->form->getHTML());
293  }
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
$ilErr
Definition: raiseError.php:18
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ switchIPE()

ilAuthLoginPageEditorGUI::switchIPE ( )
protected

Switch editor mode.

Definition at line 208 of file class.ilAuthLoginPageEditorGUI.php.

References getSettings(), and ilAuthLoginPageEditorSettings\MODE_IPE.

209  {
211  $this->getSettings()->update();
212 
213  ilUtil::sendSuccess($this->lng->txt('login_page_editor_switched'), true);
214  $this->ctrl->redirect($this, 'show');
215  }
+ Here is the call graph for this function:

◆ switchRTE()

ilAuthLoginPageEditorGUI::switchRTE ( )
protected

Switch editor mode.

Definition at line 220 of file class.ilAuthLoginPageEditorGUI.php.

References getSettings(), and ilAuthLoginPageEditorSettings\MODE_RTE.

221  {
223  $this->getSettings()->update();
224 
225  ilUtil::sendSuccess($this->lng->txt('login_page_editor_switched'), true);
226  $this->ctrl->redirect($this, 'show');
227  }
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilAuthLoginPageEditorGUI::$ctrl = null
protected

Definition at line 20 of file class.ilAuthLoginPageEditorGUI.php.

◆ $lng

ilAuthLoginPageEditorGUI::$lng = null
protected

◆ $ref_id

ilAuthLoginPageEditorGUI::$ref_id = 0
private

Definition at line 23 of file class.ilAuthLoginPageEditorGUI.php.

Referenced by getRefId().

◆ $settings

ilAuthLoginPageEditorGUI::$settings = null
private

Definition at line 24 of file class.ilAuthLoginPageEditorGUI.php.

Referenced by activate(), and getSettings().


The documentation for this class was generated from the following file: