ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 $ilCtrl, $lng, ilAuthLoginPageEditorSettings\getInstance(), and settings().

34  {
35  global $ilCtrl,$lng;
36 
37  $this->ctrl = $ilCtrl;
38  $this->lng = $lng;
39  $this->lng->loadLanguageModule('auth');
40  $this->ref_id = $a_ref_id;
41 
43  }
global $ilCtrl
Definition: ilias.php:18
settings()
Definition: settings.php:2
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 224 of file class.ilAuthLoginPageEditorGUI.php.

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

225  {
227  foreach ((array) $_POST['visible_languages'] as $lang_key) {
228  $settings->enableIliasEditor($lang_key, in_array($lang_key, (array) $_POST['languages']));
229  }
230  $settings->update();
231 
232  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
233  $this->ctrl->redirect($this, 'show');
234  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Create styles array
The data for the language used.
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 172 of file class.ilAuthLoginPageEditorGUI.php.

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

Referenced by show().

173  {
174  global $ilToolbar;
175 
176  $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
177  switch ($this->getSettings()->getMode()) {
179 
180  $ilToolbar->addButton(
181  $this->lng->txt('login_page_switch_ipe'),
182  $this->ctrl->getLinkTarget($this, 'switchIPE')
183  );
184  break;
185 
187 
188  $ilToolbar->addButton(
189  $this->lng->txt('login_page_switch_rte'),
190  $this->ctrl->getLinkTarget($this, 'switchRTE')
191  );
192  break;
193  }
194  return;
195  }
+ 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 65 of file class.ilAuthLoginPageEditorGUI.php.

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

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

◆ forwardToPageObject()

ilAuthLoginPageEditorGUI::forwardToPageObject ( )
protected

Forward to page editor.

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

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

Referenced by executeCommand().

97  {
98  global $lng,$tpl;
99 
100  $key = (int) $_REQUEST['key'];
101  $this->ctrl->saveParameter($this, 'key', $key);
102 
103  include_once("./Services/Authentication/classes/class.ilLoginPage.php");
104  include_once("./Services/Authentication/classes/class.ilLoginPageGUI.php");
105  include_once './Services/Style/Content/classes/class.ilObjStyleSheet.php';
106 
107  $lng->loadLanguageModule("content");
108 
109  if (!ilLoginPage::_exists('auth', $key)) {
110  // doesn't exist -> create new one
111  $new_page_object = new ilLoginPage();
112  $new_page_object->setParentId($key);
113  $new_page_object->setId($key);
114  $new_page_object->createFromXML();
115  }
116 
117  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
118  $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
119  $tpl->setCurrentBlock("SyntaxStyle");
120  $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
121  $tpl->parseCurrentBlock();
122 
123 
124  $this->ctrl->setReturnByClass('illoginpagegui', "edit");
125  $page_gui = new ilLoginPageGUI($key);
126 
127  $page_gui->setTemplateTargetVar("ADM_CONTENT");
128  $page_gui->setLinkXML($link_xml);
129  //$page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments());
130  //$page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile"));
131  //$page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "showMediaFullscreen"));
132  //$page_gui->setLinkParams($this->ctrl->getUrlParameterString()); // todo
133  // $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this, ""));
134  $page_gui->setPresentationTitle("");
135  $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0));
136  $page_gui->setTemplateOutput(false);
137  //$page_gui->setLocator($contObjLocator);
138  $page_gui->setHeader("");
139 
140  // style tab
141  //$page_gui->setTabHook($this, "addPageTabs");
142 
143  if ($this->ctrl->getCmd() == 'editPage') {
144  $this->ctrl->setCmd('edit');
145  }
146  $html = $this->ctrl->forwardCommand($page_gui);
147 
148  $tpl->setContent($html);
149  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
Login page GUI class.
$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 57 of file class.ilAuthLoginPageEditorGUI.php.

References $ref_id.

◆ getSettings()

ilAuthLoginPageEditorGUI::getSettings ( )

Get Settings.

Returns
ilAuthLoginPageEditorSettings

Definition at line 49 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 320 of file class.ilAuthLoginPageEditorGUI.php.

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

Referenced by saveLoginInfo(), and showRichtextEditor().

321  {
322  global $rbacsystem, $lng,$ilSetting;
323 
324  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
325  $this->form = new ilPropertyFormGUI();
326  $this->form->setFormAction($this->ctrl->getFormAction($this, 'saveLoginInfo'));
327  $this->form->setTableWidth('80%');
328  $this->form->setTitle($this->lng->txt('login_information'));
329 
330  $this->form->addCommandButton('saveLoginInfo', $this->lng->txt('save'));
331 
332  include_once('Services/LDAP/classes/class.ilLDAPServer.php');
333  include_once('Services/Radius/classes/class.ilRadiusSettings.php');
334  $rad_settings = ilRadiusSettings::_getInstance();
335  if ($ldap_id = ilLDAPServer::_getFirstActiveServer() or $rad_settings->isActive()) {
336  $select = new ilSelectInputGUI($this->lng->txt('default_auth_mode'), 'default_auth_mode');
337  $select->setValue($ilSetting->get('default_auth_mode', AUTH_LOCAL));
338  $select->setInfo($this->lng->txt('default_auth_mode_info'));
339  $options[AUTH_LOCAL] = $this->lng->txt('auth_local');
340  if ($ldap_id) {
341  $options[AUTH_LDAP] = $this->lng->txt('auth_ldap');
342  }
343  if ($rad_settings->isActive()) {
344  $options [AUTH_RADIUS] = $this->lng->txt('auth_radius');
345  }
346  $select->setOptions($options);
347  $this->form->addItem($select);
348  }
349 
350  if (!is_object($this->loginSettings)) {
351  $this->loginSettings = new ilSetting("login_settings");
352  }
353 
354  $login_settings = $this->loginSettings->getAll();
355  $languages = $lng->getInstalledLanguages();
356  $def_language = $lng->getDefaultLanguage();
357 
358  foreach ($this->setDefLangFirst($def_language, $languages) as $lang_key) {
359  $add = "";
360  if ($lang_key == $def_language) {
361  $add = " (" . $lng->txt("default") . ")";
362  }
363 
364  $textarea = new ilTextAreaInputGUI(
365  $lng->txt("meta_l_" . $lang_key) . $add,
366  'login_message_' . $lang_key
367  );
368  $textarea->setRows(10);
369  $textarea->setValue($login_settings["login_message_" . $lang_key]);
370  $textarea->setUseRte(true);
371  $textarea->setRteTagSet("extended");
372  $this->form->addItem($textarea);
373 
374  unset($login_settings["login_message_" . $lang_key]);
375  }
376 
377  foreach ($login_settings as $key => $message) {
378  $lang_key = substr($key, strrpos($key, "_") + 1, strlen($key) - strrpos($key, "_"));
379 
380  $textarea = new ilTextAreaInputGUI(
381  $lng->txt("meta_l_" . $lang_key) . $add,
382  'login_message_' . $lang_key
383  );
384  $textarea->setRows(10);
385  $textarea->setValue($message);
386  $textarea->setUseRte(true);
387  $textarea->setRteTagSet("extended");
388  if (!in_array($lang_key, $languages)) {
389  $textarea->setAlert($lng->txt("not_installed"));
390  }
391  $this->form->addItem($textarea);
392  }
393  }
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.
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.
$key
Definition: croninfo.php:18
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
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 286 of file class.ilAuthLoginPageEditorGUI.php.

References $_POST, $ilErr, $ilSetting, $key, $lng, initLoginForm(), and ilUtil\sendSuccess().

287  {
288  global $rbacsystem, $lng,$ilSetting;
289 
290  if (!$rbacsystem->checkAccess("write", $this->getRefId())) {
291  $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
292  }
293 
294  $this->initLoginForm();
295  if ($this->form->checkInput()) {
296  if (is_array($_POST)) {
297  // @todo: Move settings ilAuthLoginPageSettings
298  $this->loginSettings = new ilSetting("login_settings");
299 
300  foreach ($_POST as $key => $val) {
301  if (substr($key, 0, 14) == "login_message_") {
302  $this->loginSettings->set($key, $val);
303  }
304  }
305  }
306 
307  if ($_POST['default_auth_mode']) {
308  $ilSetting->set('default_auth_mode', (int) $_POST['default_auth_mode']);
309  }
310 
311  ilUtil::sendSuccess($this->lng->txt("login_information_settings_saved"), true);
312  }
313 
314  $this->ctrl->redirect($this, 'show');
315  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
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 406 of file class.ilAuthLoginPageEditorGUI.php.

References array.

Referenced by initLoginForm().

407  {
408  if (is_array($a_languages) && $a_def_language != "") {
409  $languages = array();
410  $languages[] = $a_def_language;
411 
412  foreach ($a_languages as $val) {
413  if (!in_array($val, $languages)) {
414  $languages[] = $val;
415  }
416  }
417 
418  return $languages;
419  } else {
420  return array();
421  }
422  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ show()

ilAuthLoginPageEditorGUI::show ( )
protected

Show current activated editor.

Returns
void

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

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

156  {
157  $this->addEditorSwitch();
158 
159  switch ($this->getSettings()->getMode()) {
161  return $this->showRichtextEditor();
162 
164  return $this->showIliasEditor();
165  }
166  }
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 239 of file class.ilAuthLoginPageEditorGUI.php.

References $tbl, and $tpl.

Referenced by show().

240  {
241  global $tpl;
242 
243  include_once './Services/Authentication/classes/class.ilAuthLoginPageEditorTableGUI.php';
244  $tbl = new ilAuthLoginPageEditorTableGUI($this, 'show');
245  $tbl->parse();
246 
247  $tpl->setContent($tbl->getHTML());
248  }
$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 257 of file class.ilAuthLoginPageEditorGUI.php.

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

Referenced by show().

258  {
259  global $rbacsystem, $lng,$ilSetting,$tpl;
260 
261  if (!$rbacsystem->checkAccess("visible,read", $this->getRefId())) {
262  $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
263  }
264  $lng->loadLanguageModule("meta");
265 
266  $tpl->addBlockFile(
267  "ADM_CONTENT",
268  "adm_content",
269  "tpl.auth_login_messages.html",
270  "Services/Authentication"
271  );
272  $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
273  $tpl->setVariable("TXT_HEADLINE", $this->lng->txt("login_information"));
274  $tpl->setVariable("TXT_DESCRIPTION", $this->lng->txt("login_information_desc"));
275  $tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
276  $this->initLoginForm();
277  $tpl->setVariable('LOGIN_INFO', $this->form->getHTML());
278  }
global $ilErr
Definition: raiseError.php:16
$tpl
Definition: ilias.php:10
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 200 of file class.ilAuthLoginPageEditorGUI.php.

References getSettings(), ilAuthLoginPageEditorSettings\MODE_IPE, and ilUtil\sendSuccess().

201  {
203  $this->getSettings()->update();
204 
205  ilUtil::sendSuccess($this->lng->txt('login_page_editor_switched'), true);
206  $this->ctrl->redirect($this, 'show');
207  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
+ Here is the call graph for this function:

◆ switchRTE()

ilAuthLoginPageEditorGUI::switchRTE ( )
protected

Switch editor mode.

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

References getSettings(), ilAuthLoginPageEditorSettings\MODE_RTE, and ilUtil\sendSuccess().

213  {
215  $this->getSettings()->update();
216 
217  ilUtil::sendSuccess($this->lng->txt('login_page_editor_switched'), true);
218  $this->ctrl->redirect($this, 'show');
219  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
+ 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: