Class ilObjChatServerGUI. More...
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. | |
| & | executeCommand () |
| execute command | |
| editObject () | |
| edit object | |
| updateObject () | |
| updates object entry in object_data | |
| activateObject () | |
| __getLogLevelSelect ($a_level) | |
| __getStatusSelect ($a_status) | |
| getAdminTabs (&$tabs_gui) | |
| get tabs public | |
Class ilObjChatServerGUI.
ilObjChatServerGUI: ilPermissionGUI
Definition at line 38 of file class.ilObjChatServerGUI.php.
| ilObjChatServerGUI::__getLogLevelSelect | ( | $ | a_level | ) |
Definition at line 198 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 208 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 188 of file class.ilObjChatServerGUI.php.
References editObject(), and ilUtil::sendInfo().
{
$this->object->server_conf->setActiveStatus((bool) $_POST["chat_active"]);
$this->object->server_conf->updateStatus();
ilUtil::sendInfo($this->lng->txt("chat_status_saved"));
$this->editObject();
}
Here is the call graph for this function:| ilObjChatServerGUI::editObject | ( | ) |
edit object
public
Reimplemented from ilObjectGUI.
Definition at line 81 of file class.ilObjChatServerGUI.php.
References __getLogLevelSelect(), __getStatusSelect(), ilUtil::prepareFormOutput(), and ilUtil::sendInfo().
Referenced by activateObject(), and updateObject().
{
global $rbacsystem;
$this->tabs_gui->setTabActive('edit_properties');
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','Modules/Chat');
$internal_ip = $this->object->server_conf->getInternalIp();
$external_ip = $this->object->server_conf->getExternalIp();
$port = $this->object->server_conf->getPort();
$ssl_status = $this->object->server_conf->getSSLStatus();
$ssl_port = $this->object->server_conf->getSSLPort();
$moderator = $this->object->server_conf->getModeratorPassword();
$logfile = $this->object->server_conf->getLogfile();
$loglevel = $this->object->server_conf->getLogLevel();
$allowed = $this->object->server_conf->getAllowedHosts();
$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));
$this->tpl->parseCurrentBlock();
}
else if(!$this->object->server_conf->isAlive() && $this->ctrl->getCmd() != 'update')
{
ilUtil::sendInfo($this->lng->txt('chat_cannot_connect_to_server'));
}
// SET TEXT VARIABLES
$this->tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this, 'update'));
$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_SSL_SETTINGS', $this->lng->txt('chat_server_ssl_settings'));
$this->tpl->setVariable('TXT_CHAT_SERVER_SSL_ACTIVE', $this->lng->txt('chat_server_ssl_active'));
$this->tpl->setVariable('TXT_CHAT_SERVER_SSL_PORT', $this->lng->txt('chat_server_ssl_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', ilUtil::prepareFormOutput($internal_ip));
$this->tpl->setVariable('CHAT_SERVER_EXTERNAL', ilUtil::prepareFormOutput($external_ip));
$this->tpl->setVariable('CHAT_PORT', ilUtil::prepareFormOutput($port));
if ($ssl_status) $this->tpl->setVariable('CHAT_SSL_STATUS_CHECKED', 'checked="checked"');
$this->tpl->setVariable('CHAT_SSL_PORT', ilUtil::prepareFormOutput($ssl_port));
$this->tpl->setVariable('CHAT_MODERATOR', ilUtil::prepareFormOutput($moderator));
$this->tpl->setVariable('CHAT_LOGFILE', ilUtil::prepareFormOutput($logfile));
$this->tpl->setVariable('CHAT_ALLOWED', ilUtil::prepareFormOutput($allowed));
$this->tpl->setVariable('SELECT_LEVEL', $this->__getLogLevelSelect($loglevel));
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| & ilObjChatServerGUI::executeCommand | ( | ) |
execute command
Reimplemented from ilObjectGUI.
Definition at line 54 of file class.ilObjChatServerGUI.php.
References $cmd, $ret, and ilObjectGUI::prepareOutput().
{
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
$this->prepareOutput();
switch($next_class)
{
case 'ilpermissiongui':
include_once("./classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
default:
if(!$cmd)
{
$cmd = "view";
}
$cmd .= "Object";
$this->$cmd();
break;
}
return true;
}
Here is the call graph for this function:| ilObjChatServerGUI::getAdminTabs | ( | &$ | tabs_gui | ) |
get tabs public
| object | tabs gui object |
Reimplemented from ilObjectGUI.
Definition at line 221 of file class.ilObjChatServerGUI.php.
References $_GET.
{
global $rbacsystem,$rbacreview;
$this->ctrl->setParameter($this,"ref_id",$this->object->getRefId());
if($rbacsystem->checkAccess('read',$this->object->getRefId()))
{
$force_active = ($_GET["cmd"] == "" || $_GET["cmd"] == "view")
? true
: false;
$tabs_gui->addTarget("chat_rooms",
$this->ctrl->getLinkTarget($this, "view"), array("view", ""), get_class($this),
"", $force_active);
}
if($rbacsystem->checkAccess('write',$this->object->getRefId()))
{
$force_active = ($_GET["cmd"] == "edit")
? true
: false;
$tabs_gui->addTarget("edit_properties",
$this->ctrl->getLinkTarget($this, "edit"), "edit", get_class($this),
"", $force_active);
}
if($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
{
$tabs_gui->addTarget("perm_settings",
$this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
}
}
| ilObjChatServerGUI::ilObjChatServerGUI | ( | $ | a_data, | |
| $ | a_id, | |||
| $ | a_call_by_reference = true, |
|||
| $ | a_prepare_output = true | |||
| ) |
Constructor public.
Definition at line 44 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 151 of file class.ilObjChatServerGUI.php.
References editObject(), ilUtil::sendInfo(), and ilUtil::stripSlashes().
{
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(ilUtil::stripSlashes($_POST['chat_internal_ip']));
$this->object->server_conf->setExternalIp(ilUtil::stripSlashes($_POST['chat_external_ip']));
$this->object->server_conf->setPort(ilUtil::stripSlashes($_POST['chat_port']));
$this->object->server_conf->setSSLStatus((int)$_POST['chat_ssl_status'] ? 1 : 0);
$this->object->server_conf->setSSLPort(ilUtil::stripSlashes($_POST['chat_ssl_port']));
$this->object->server_conf->setModeratorPassword(ilUtil::stripSlashes($_POST['chat_moderator']));
$this->object->server_conf->setLogfile(ilUtil::stripSlashes($_POST['chat_logfile']));
$this->object->server_conf->setLogLevel(ilUtil::stripSlashes($_POST['chat_loglevel']));
$this->object->server_conf->setAllowedHosts(ilUtil::stripSlashes($_POST['chat_allowed']));
if(!$this->object->server_conf->validate())
{
ilUtil::sendInfo($this->object->server_conf->getErrorMessage());
return $this->editObject();
}
else
{
if(!$this->object->server_conf->update())
{
ilUtil::sendInfo($this->object->server_conf->getErrorMessage());
return $this->editObject();
}
}
ilUtil::sendInfo($this->lng->txt("chat_settings_saved"),true);
return $this->editObject();
}
Here is the call graph for this function:
1.7.1