ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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, and ilAuthLoginPageEditorSettings\getInstance().

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
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 230 of file class.ilAuthLoginPageEditorGUI.php.

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

231  {
233  foreach((array) $_POST['visible_languages'] as $lang_key)
234  {
235  $settings->enableIliasEditor($lang_key, in_array($lang_key,(array) $_POST['languages']));
236  }
237  $settings->update();
238 
239  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
240  $this->ctrl->redirect($this,'show');
241  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static getInstance()
Get singelton instance.
+ Here is the call graph for this function:

◆ addEditorSwitch()

ilAuthLoginPageEditorGUI::addEditorSwitch ( )
protected

Show editore switch ilToolbarGUI $ilToolbar.

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

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

Referenced by show().

178  {
179  global $ilToolbar;
180 
181  $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
182  switch($this->getSettings()->getMode())
183  {
185 
186  $ilToolbar->addButton(
187  $this->lng->txt('login_page_switch_ipe'),
188  $this->ctrl->getLinkTarget($this,'switchIPE')
189  );
190  break;
191 
193 
194  $ilToolbar->addButton(
195  $this->lng->txt('login_page_switch_rte'),
196  $this->ctrl->getLinkTarget($this,'switchRTE')
197  );
198  break;
199  }
200  return;
201  }
+ 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, $cmd, $GLOBALS, and forwardToPageObject().

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

◆ forwardToPageObject()

ilAuthLoginPageEditorGUI::forwardToPageObject ( )
protected

Forward to page editor.

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

References $_REQUEST, $lng, $tpl, ilPageObject\_exists(), ilObjStyleSheet\getContentStylePath(), and ilObjStyleSheet\getSyntaxStylePath().

Referenced by executeCommand().

102  {
103  global $lng,$tpl;
104 
105  $key = (int) $_REQUEST['key'];
106  $this->ctrl->saveParameter($this,'key',$key);
107 
108  include_once("./Services/Authentication/classes/class.ilLoginPage.php");
109  include_once("./Services/Authentication/classes/class.ilLoginPageGUI.php");
110  include_once './Services/Style/classes/class.ilObjStyleSheet.php';
111 
112  $lng->loadLanguageModule("content");
113 
114  if (!ilLoginPage::_exists('auth',$key))
115  {
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/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->setTemplateOutput(false);
142  //$page_gui->setLocator($contObjLocator);
143  $page_gui->setHeader("");
144 
145  // style tab
146  //$page_gui->setTabHook($this, "addPageTabs");
147 
148  if($this->ctrl->getCmd() == 'editPage')
149  $this->ctrl->setCmd('edit');
150  $html = $this->ctrl->forwardCommand($page_gui);
151 
152  $tpl->setContent($html);
153  }
Login page GUI class.
getSyntaxStylePath()
get syntax style path
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
Login page object.
getContentStylePath($a_style_id)
get content style path
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ 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 330 of file class.ilAuthLoginPageEditorGUI.php.

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

Referenced by saveLoginInfo(), and showRichtextEditor().

331  {
332  global $rbacsystem, $lng,$ilSetting;
333 
334  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
335  $this->form = new ilPropertyFormGUI();
336  $this->form->setFormAction($this->ctrl->getFormAction($this,'saveLoginInfo'));
337  $this->form->setTableWidth('80%');
338  $this->form->setTitle($this->lng->txt('login_information'));
339 
340  $this->form->addCommandButton('saveLoginInfo',$this->lng->txt('save'));
341 
342  include_once('Services/LDAP/classes/class.ilLDAPServer.php');
343  include_once('Services/Radius/classes/class.ilRadiusSettings.php');
344  $rad_settings = ilRadiusSettings::_getInstance();
345  if($ldap_id = ilLDAPServer::_getFirstActiveServer() or $rad_settings->isActive())
346  {
347  $select = new ilSelectInputGUI($this->lng->txt('default_auth_mode'),'default_auth_mode');
348  $select->setValue($ilSetting->get('default_auth_mode',AUTH_LOCAL));
349  $select->setInfo($this->lng->txt('default_auth_mode_info'));
350  $options[AUTH_LOCAL] = $this->lng->txt('auth_local');
351  if($ldap_id)
352  {
353  $options[AUTH_LDAP] = $this->lng->txt('auth_ldap');
354  }
355  if($rad_settings->isActive())
356  {
357  $options [AUTH_RADIUS] = $this->lng->txt('auth_radius');
358  }
359  $select->setOptions($options);
360  $this->form->addItem($select);
361  }
362 
363  if (!is_object($this->loginSettings))
364  {
365  $this->loginSettings = new ilSetting("login_settings");
366  }
367 
368  $login_settings = $this->loginSettings->getAll();
369  $languages = $lng->getInstalledLanguages();
370  $def_language = $lng->getDefaultLanguage();
371 
372  foreach ($this->setDefLangFirst($def_language, $languages) as $lang_key)
373  {
374  $add = "";
375  if ($lang_key == $def_language)
376  {
377  $add = " (".$lng->txt("default").")";
378  }
379 
380  $textarea = new ilTextAreaInputGUI($lng->txt("meta_l_".$lang_key).$add,
381  'login_message_'.$lang_key);
382  $textarea->setRows(10);
383  $textarea->setValue($login_settings["login_message_".$lang_key]);
384  $textarea->setUseRte(true);
385  $textarea->setRteTagSet("extended");
386  $this->form->addItem($textarea);
387 
388  unset($login_settings["login_message_".$lang_key]);
389  }
390 
391  foreach ($login_settings as $key => $message)
392  {
393  $lang_key = substr($key, strrpos($key, "_") + 1, strlen($key) - strrpos($key, "_"));
394 
395  $textarea = new ilTextAreaInputGUI($lng->txt("meta_l_".$lang_key).$add,
396  'login_message_'.$lang_key);
397  $textarea->setRows(10);
398  $textarea->setValue($message);
399  $textarea->setUseRte(true);
400  $textarea->setRteTagSet("extended");
401  if(!in_array($lang_key,$languages))
402  {
403  $textarea->setAlert($lng->txt("not_installed"));
404  }
405  $this->form->addItem($textarea);
406  }
407  }
static _getFirstActiveServer()
Get first active server.
ILIAS Setting Class.
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
if(!is_array($argv)) $options
setValue($a_value)
Set Value.
static _getInstance()
singleton get instance
const AUTH_LOCAL
global $ilSetting
Definition: privfeed.php:40
This class represents a text area property in a property form.
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 290 of file class.ilAuthLoginPageEditorGUI.php.

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

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

Referenced by initLoginForm().

421  {
422  if (is_array($a_languages) && $a_def_language != "")
423  {
424  $languages = array();
425  $languages[] = $a_def_language;
426 
427  foreach ($a_languages as $val)
428  {
429  if (!in_array($val, $languages))
430  {
431  $languages[] = $val;
432  }
433  }
434 
435  return $languages;
436  }
437  else
438  {
439  return array();
440  }
441  }
+ Here is the caller graph for this function:

◆ show()

ilAuthLoginPageEditorGUI::show ( )
protected

Show current activated editor.

Returns
void

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

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

160  {
161  $this->addEditorSwitch();
162 
163  switch($this->getSettings()->getMode())
164  {
166  return $this->showRichtextEditor();
167 
169  return $this->showIliasEditor();
170  }
171  }
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 246 of file class.ilAuthLoginPageEditorGUI.php.

References $tpl.

Referenced by show().

247  {
248  global $tpl;
249 
250  include_once './Services/Authentication/classes/class.ilAuthLoginPageEditorTableGUI.php';
251  $tbl = new ilAuthLoginPageEditorTableGUI($this,'show');
252  $tbl->parse();
253 
254  $tpl->setContent($tbl->getHTML());
255  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
+ 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 264 of file class.ilAuthLoginPageEditorGUI.php.

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

Referenced by show().

265  {
266  global $rbacsystem, $lng,$ilSetting,$tpl;
267 
268  if(!$rbacsystem->checkAccess("visible,read", $this->getRefId()))
269  {
270  $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
271  }
272  $lng->loadLanguageModule("meta");
273 
274  $tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.auth_login_messages.html",
275  "Services/Authentication");
276  $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
277  $tpl->setVariable("TXT_HEADLINE", $this->lng->txt("login_information"));
278  $tpl->setVariable("TXT_DESCRIPTION", $this->lng->txt("login_information_desc"));
279  $tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
280  $this->initLoginForm();
281  $tpl->setVariable('LOGIN_INFO',$this->form->getHTML());
282  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
global $ilSetting
Definition: privfeed.php:40
+ 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 206 of file class.ilAuthLoginPageEditorGUI.php.

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

207  {
209  $this->getSettings()->update();
210 
211  ilUtil::sendSuccess($this->lng->txt('login_page_editor_switched'),true);
212  $this->ctrl->redirect($this,'show');
213  }
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 218 of file class.ilAuthLoginPageEditorGUI.php.

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

219  {
221  $this->getSettings()->update();
222 
223  ilUtil::sendSuccess($this->lng->txt('login_page_editor_switched'),true);
224  $this->ctrl->redirect($this,'show');
225  }
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: