Inheritance diagram for ilObjChatServerGUI:
Collaboration diagram for ilObjChatServerGUI:Public Member Functions | |
| ilObjChatServerGUI ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true) | |
| Constructor public. | |
| editObject () | |
| edit object | |
| updateObject () | |
| updates object entry in object_data | |
| activateObject () | |
| __getLogLevelSelect ($a_level) | |
| __getStatusSelect ($a_status) | |
Definition at line 37 of file class.ilObjChatServerGUI.php.
| ilObjChatServerGUI::__getLogLevelSelect | ( | $ | a_level | ) |
Definition at line 180 of file class.ilObjChatServerGUI.php.
References formSelect().
Referenced by editObject().
{
$levels = array(1 => $this->lng->txt("chat_level_fatal"),
2 => $this->lng->txt("chat_level_error"),
3 => $this->lng->txt("chat_level_info"),
5 => $this->lng->txt("chat_level_debug"),
6 => $this->lng->txt("chat_level_all"));
return ilUtil::formSelect($a_level,"chat_loglevel",$levels,false,true);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjChatServerGUI::__getStatusSelect | ( | $ | a_status | ) |
Definition at line 190 of file class.ilObjChatServerGUI.php.
References formSelect().
Referenced by editObject().
{
$stati = array(1 => $this->lng->txt("chat_active"),
0 => $this->lng->txt("chat_inactive"));
return ilUtil::formSelect($a_status,"chat_active",$stati,false,true);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjChatServerGUI::activateObject | ( | ) |
Definition at line 169 of file class.ilObjChatServerGUI.php.
References $_POST, exit, ilObjectGUI::getReturnLocation(), and sendInfo().
{
$this->object->server_conf->setActiveStatus((bool) $_POST["chat_active"]);
$this->object->server_conf->updateStatus();
sendInfo($this->lng->txt("chat_status_saved"),true);
header("location: ".$this->getReturnLocation("update","adm_object.php?ref_id=$_GET[ref_id]"));
exit;
}
Here is the call graph for this function:| ilObjChatServerGUI::editObject | ( | ) |
edit object
public
Reimplemented from ilObjectGUI.
Definition at line 53 of file class.ilObjChatServerGUI.php.
References $_SESSION, $rbacsystem, __getLogLevelSelect(), __getStatusSelect(), and ilObjectGUI::getFormAction().
{
global $rbacsystem;
if (!$rbacsystem->checkAccess("read", $this->ref_id))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
}
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.chac_edit.html",true);
$internal_ip = $_SESSION["error_post_vars"]["chat_internal_ip"] ?
$_SESSION["error_post_vars"]["chat_internal_ip"] :
$this->object->server_conf->getInternalIp();
$external_ip = $_SESSION["error_post_vars"]["chat_external_ip"] ?
$_SESSION["error_post_vars"]["chat_external_ip"] :
$this->object->server_conf->getExternalIp();
$port = $_SESSION["error_post_vars"]["chat_port"] ?
$_SESSION["error_post_vars"]["chat_port"] :
$this->object->server_conf->getPort();
$moderator = $_SESSION["error_post_vars"]["chat_moderator"] ?
$_SESSION["error_post_vars"]["chat_moderator"] :
$this->object->server_conf->getModeratorPassword();
$logfile = $_SESSION["error_post_vars"]["chat_logfile"] ?
$_SESSION["error_post_vars"]["chat_logfile"] :
$this->object->server_conf->getLogfile();
$loglevel = $_SESSION["error_post_vars"]["chat_loglevel"] ?
$_SESSION["error_post_vars"]["chat_loglevel"] :
$this->object->server_conf->getLogLevel();
$allowed = $_SESSION["error_post_vars"]["chat_allowed"] ?
$_SESSION["error_post_vars"]["chat_internal_ip"] :
$this->object->server_conf->getAllowedHosts();
$active = $_SESSION["error_post_vars"]["chat_active"] ?
$_SESSION["error_post_vars"]["chat_active"] :
$this->object->server_conf->getActiveStatus();
if($this->object->server_conf->isAlive() or $this->object->server_conf->getActiveStatus())
{
$this->tpl->setCurrentBlock("chat_active");
$this->tpl->setVariable("TXT_ACT_CHAT",$this->lng->txt("chat_ilias"));
$this->tpl->setVariable("TXT_ACT_STATUS",$this->lng->txt("chat_status"));
$this->tpl->setVariable("TXT_ACT_SUBMIT",$this->lng->txt("change"));
$this->tpl->setVariable("SELECT_ACT_STATUS",$this->__getStatusSelect($active));
}
// SET TEXT VARIABLES
$this->tpl->setVariable("FORMACTION",
$this->getFormAction("gateway","adm_object.php?ref_id=".$this->ref_id."&cmd=gateway"));
$this->tpl->setVariable("TXT_CHAT_SERVER_SETTINGS",$this->lng->txt("chat_server_settings"));
$this->tpl->setVariable("TXT_CHAT_SERVER_INTERNAL_IP",$this->lng->txt("chat_server_internal_ip"));
$this->tpl->setVariable("TXT_CHAT_SERVER_EXTERNAL_IP",$this->lng->txt("chat_server_external_ip"));
$this->tpl->setVariable("TXT_CHAT_SERVER_MODERATOR",$this->lng->txt("chat_moderator_password"));
$this->tpl->setVariable("TXT_CHAT_SERVER_PORT",$this->lng->txt("chat_server_port"));
$this->tpl->setVariable("TXT_CHAT_SERVER_LOGFILE",$this->lng->txt("chat_server_logfile"));
$this->tpl->setVariable("TXT_CHAT_SERVER_LEVEL",$this->lng->txt("chat_server_loglevel"));
$this->tpl->setVariable("TXT_CHAT_SERVER_ALLOWED",$this->lng->txt("chat_server_allowed"));
$this->tpl->setVariable("TXT_CHAT_SERVER_ALLOWED_B",$this->lng->txt("chat_server_allowed_b"));
$this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
$this->tpl->setVariable("TXT_CANCEL",$this->lng->txt("cancel"));
$this->tpl->setVariable("TXT_SUBMIT",$this->lng->txt("save"));
// SET SETTING VARS
$this->tpl->setVariable("CHAT_SERVER_INTERNAL",$internal_ip);
$this->tpl->setVariable("CHAT_SERVER_EXTERNAL",$external_ip);
$this->tpl->setVariable("CHAT_PORT",$port);
$this->tpl->setVariable("CHAT_MODERATOR",$moderator);
$this->tpl->setVariable("CHAT_LOGFILE",$logfile);
$this->tpl->setVariable("CHAT_ALLOWED",$allowed);
$this->tpl->setVariable("SELECT_LEVEL",$this->__getLogLevelSelect($loglevel));
$this->tpl->parseCurrentBlock();
return true;
}
Here is the call graph for this function:| ilObjChatServerGUI::ilObjChatServerGUI | ( | $ | a_data, | |
| $ | a_id, | |||
| $ | a_call_by_reference = true, |
|||
| $ | a_prepare_output = true | |||
| ) |
Constructor public.
Definition at line 43 of file class.ilObjChatServerGUI.php.
References ilObjectGUI::ilObjectGUI().
{
define("ILIAS_MODULE","chat");
$this->type = "chac";
$this->ilObjectGUI($a_data,$a_id,$a_call_by_reference, $a_prepare_output);
$this->lng->loadLanguageModule("chat");
}
Here is the call graph for this function:| ilObjChatServerGUI::updateObject | ( | ) |
updates object entry in object_data
public
Reimplemented from ilObjectGUI.
Definition at line 136 of file class.ilObjChatServerGUI.php.
References $_POST, $rbacsystem, exit, ilObjectGUI::getReturnLocation(), and sendInfo().
{
global $rbacsystem;
if (!$rbacsystem->checkAccess("write", $this->ref_id))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
}
$this->object->server_conf->setInternalIp($_POST["chat_internal_ip"]);
$this->object->server_conf->setExternalIp($_POST["chat_external_ip"]);
$this->object->server_conf->setPort($_POST["chat_port"]);
$this->object->server_conf->setModeratorPassword($_POST["chat_moderator"]);
$this->object->server_conf->setLogfile($_POST["chat_logfile"]);
$this->object->server_conf->setLogLevel($_POST["chat_loglevel"]);
$this->object->server_conf->setAllowedHosts($_POST["chat_allowed"]);
if(!$this->object->server_conf->validate())
{
$this->ilias->raiseError($this->object->server_conf->getErrorMessage(),$this->ilias->error_obj->MESSAGE);
}
else
{
if(!$this->object->server_conf->update())
{
$this->ilias->raiseError($this->object->server_conf->getErrorMessage(),$this->ilias->error_obj->MESSAGE);
}
}
sendInfo($this->lng->txt("chat_settings_saved"),true);
header("location: ".$this->getReturnLocation("update","adm_object.php?ref_id=$_GET[ref_id]"));
exit;
}
Here is the call graph for this function:
1.7.1