ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups 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.
 getSettings ()
 Get Settings.
 getRefId ()
 executeCommand ()
 ilCtrl execute command

Protected Member Functions

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

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: ilPageObjectGUI

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

Constructor & Destructor Documentation

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().

{
global $ilCtrl,$lng;
$this->ctrl = $ilCtrl;
$this->lng = $lng;
$this->lng->loadLanguageModule('auth');
$this->ref_id = $a_ref_id;
}

+ Here is the call graph for this function:

Member Function Documentation

ilAuthLoginPageEditorGUI::activate ( )
protected

Activate languages.

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

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

{
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');
}

+ Here is the call graph for this function:

ilAuthLoginPageEditorGUI::addEditorSwitch ( )
protected

Show editore switch ilToolbarGUI $ilToolbar.

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

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

Referenced by show().

{
global $ilToolbar;
$ilToolbar->setFormAction($this->ctrl->getFormAction($this));
switch($this->getSettings()->getMode())
{
$ilToolbar->addButton(
$this->lng->txt('login_page_switch_ipe'),
$this->ctrl->getLinkTarget($this,'switchIPE')
);
break;
$ilToolbar->addButton(
$this->lng->txt('login_page_switch_rte'),
$this->ctrl->getLinkTarget($this,'switchRTE')
);
break;
}
return;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAuthLoginPageEditorGUI::executeCommand ( )

ilCtrl execute command

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

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

{
switch($this->ctrl->getNextClass($this))
{
case 'ilpageobjectgui':
$GLOBALS['ilTabs']->clearTargets();
$GLOBALS['ilTabs']->setBackTarget(
$this->lng->txt('back'),
$this->ctrl->getLinkTarget($this,'show'),
'_top'
);
if ($_GET["redirectSource"] != "ilinternallinkgui")
{
}
else
{
return '';
}
break;
default:
if(!$cmd = $this->ctrl->getCmd())
{
$cmd = 'show';
}
$this->$cmd();
break;
}
}

+ Here is the call graph for this function:

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().

{
global $lng,$tpl;
$key = (int) $_REQUEST['key'];
$this->ctrl->saveParameter($this,'key',$key);
include_once("./Services/COPage/classes/class.ilPageObject.php");
include_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
include_once './Services/Style/classes/class.ilObjStyleSheet.php';
$lng->loadLanguageModule("content");
if (!ilPageObject::_exists('auth',$key))
{
// doesn't exist -> create new one
$new_page_object = new ilPageObject('auth');
$new_page_object->setParentId($key);
$new_page_object->setId($key);
$new_page_object->createFromXML();
}
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();
$this->ctrl->setReturnByClass('ilpageobjectgui', "edit");
$page_gui = new ilPageObjectGUI('auth',$key);
$page_gui->setIntLinkHelpDefault("RepositoryItem",$key);
$page_gui->setTemplateTargetVar("ADM_CONTENT");
$page_gui->setLinkXML($link_xml);
//$page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments());
//$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->setLocator($contObjLocator);
$page_gui->setHeader("");
$page_gui->setEnabledRepositoryObjects(true);
$page_gui->setEnabledLoginPage(true);
$page_gui->setEnabledFileLists(false);
$page_gui->setEnabledMaps(true);
$page_gui->setEnabledPCTabs(true);
$page_gui->setEnabledInternalLinks(true);
// style tab
//$page_gui->setTabHook($this, "addPageTabs");
if($this->ctrl->getCmd() == 'editPage')
$this->ctrl->setCmd('edit');
$html = $this->ctrl->forwardCommand($page_gui);
$tpl->setContent($html);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAuthLoginPageEditorGUI::getRefId ( )
Returns
int ref_id

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

References $ref_id.

{
return $this->ref_id;
}
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:

ilAuthLoginPageEditorGUI::initLoginForm ( )
protected

Init login form.

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

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

Referenced by saveLoginInfo(), and showRichtextEditor().

{
global $rbacsystem, $lng,$ilSetting;
include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this,'saveLoginInfo'));
$this->form->setTableWidth('80%');
$this->form->setTitle($this->lng->txt('login_information'));
$this->form->addCommandButton('saveLoginInfo',$this->lng->txt('save'));
include_once('Services/LDAP/classes/class.ilLDAPServer.php');
include_once('Services/Radius/classes/class.ilRadiusSettings.php');
$rad_settings = ilRadiusSettings::_getInstance();
if($ldap_id = ilLDAPServer::_getFirstActiveServer() or $rad_settings->isActive())
{
$select = new ilSelectInputGUI($this->lng->txt('default_auth_mode'),'default_auth_mode');
$select->setValue($ilSetting->get('default_auth_mode',AUTH_LOCAL));
$select->setInfo($this->lng->txt('default_auth_mode_info'));
$options[AUTH_LOCAL] = $this->lng->txt('auth_local');
if($ldap_id)
{
$options[AUTH_LDAP] = $this->lng->txt('auth_ldap');
}
if($rad_settings->isActive())
{
$options [AUTH_RADIUS] = $this->lng->txt('auth_radius');
}
$select->setOptions($options);
$this->form->addItem($select);
}
if (!is_object($this->loginSettings))
{
$this->loginSettings = new ilSetting("login_settings");
}
$login_settings = $this->loginSettings->getAll();
$languages = $lng->getInstalledLanguages();
$def_language = $lng->getDefaultLanguage();
foreach ($this->setDefLangFirst($def_language, $languages) as $lang_key)
{
$add = "";
if ($lang_key == $def_language)
{
$add = " (".$lng->txt("default").")";
}
$textarea = new ilTextAreaInputGUI($lng->txt("meta_l_".$lang_key).$add,
'login_message_'.$lang_key);
$textarea->setRows(10);
$textarea->setValue($login_settings["login_message_".$lang_key]);
$textarea->setUseRte(true);
$textarea->setRteTagSet("extended");
$this->form->addItem($textarea);
unset($login_settings["login_message_".$lang_key]);
}
foreach ($login_settings as $key => $message)
{
$lang_key = substr($key, strrpos($key, "_") + 1, strlen($key) - strrpos($key, "_"));
$textarea = new ilTextAreaInputGUI($lng->txt("meta_l_".$lang_key).$add,
'login_message_'.$lang_key);
$textarea->setRows(10);
$textarea->setValue($message);
$textarea->setUseRte(true);
$textarea->setRteTagSet("extended");
if(!in_array($lang_key,$languages))
{
$textarea->setAlert($lng->txt("not_installed"));
}
$this->form->addItem($textarea);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAuthLoginPageEditorGUI::saveLoginInfo ( )
protected

saves the login information data

protected

Author
Michael Jansen

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

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

{
global $rbacsystem, $lng,$ilSetting;
if(!$rbacsystem->checkAccess("write",$this->getRefId()))
{
$ilErr->raiseError($this->lng->txt("permission_denied"),$ilErr->MESSAGE);
}
$this->initLoginForm();
if ($this->form->checkInput())
{
if (is_array($_POST))
{
// @todo: Move settings ilAuthLoginPageSettings
$this->loginSettings = new ilSetting("login_settings");
foreach ($_POST as $key => $val)
{
if (substr($key, 0, 14) == "login_message_")
{
$this->loginSettings->set($key, $val);
}
}
}
if($_POST['default_auth_mode'])
{
$ilSetting->set('default_auth_mode',(int) $_POST['default_auth_mode']);
}
ilUtil::sendSuccess($this->lng->txt("login_information_settings_saved"),true);
}
$this->ctrl->redirect($this,'show');
}

+ Here is the call graph for this function:

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

Referenced by initLoginForm().

{
if (is_array($a_languages) && $a_def_language != "")
{
$languages = array();
$languages[] = $a_def_language;
foreach ($a_languages as $val)
{
if (!in_array($val, $languages))
{
$languages[] = $val;
}
}
return $languages;
}
else
{
return array();
}
}

+ Here is the caller graph for this function:

ilAuthLoginPageEditorGUI::show ( )
protected

Show current activated editor.

Returns
void

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

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

{
$this->addEditorSwitch();
switch($this->getSettings()->getMode())
{
return $this->showRichtextEditor();
return $this->showIliasEditor();
}
}

+ Here is the call graph for this function:

ilAuthLoginPageEditorGUI::showIliasEditor ( )
protected

Show ILIAS page editor summary.

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

References $tpl.

Referenced by show().

{
global $tpl;
include_once './Services/Authentication/classes/class.ilAuthLoginPageEditorTableGUI.php';
$tbl = new ilAuthLoginPageEditorTableGUI($this,'show');
$tbl->parse();
$tpl->setContent($tbl->getHTML());
}

+ Here is the caller graph for this function:

ilAuthLoginPageEditorGUI::showRichtextEditor ( )
protected

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

Author
Michael Jansen

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

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

Referenced by show().

{
global $rbacsystem, $lng,$ilSetting,$tpl;
if(!$rbacsystem->checkAccess("visible,read", $this->getRefId()))
{
$ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
}
$lng->loadLanguageModule("meta");
$tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.auth_login_messages.html",
"Services/Authentication");
$tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$tpl->setVariable("TXT_HEADLINE", $this->lng->txt("login_information"));
$tpl->setVariable("TXT_DESCRIPTION", $this->lng->txt("login_information_desc"));
$tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
$this->initLoginForm();
$tpl->setVariable('LOGIN_INFO',$this->form->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAuthLoginPageEditorGUI::switchIPE ( )
protected

Switch editor mode.

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

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

{
$this->getSettings()->update();
ilUtil::sendSuccess($this->lng->txt('login_page_editor_switched'),true);
$this->ctrl->redirect($this,'show');
}

+ Here is the call graph for this function:

ilAuthLoginPageEditorGUI::switchRTE ( )
protected

Switch editor mode.

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

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

{
$this->getSettings()->update();
ilUtil::sendSuccess($this->lng->txt('login_page_editor_switched'),true);
$this->ctrl->redirect($this,'show');
}

+ Here is the call graph for this function:

Field Documentation

ilAuthLoginPageEditorGUI::$ctrl = null
protected

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

ilAuthLoginPageEditorGUI::$lng = null
protected
ilAuthLoginPageEditorGUI::$ref_id = 0
private

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

Referenced by getRefId().

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: