Public Member Functions

ilObjChatServerGUI Class Reference

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

Detailed Description

Definition at line 39 of file class.ilObjChatServerGUI.php.


Member Function Documentation

ilObjChatServerGUI::__getLogLevelSelect ( a_level  ) 

Definition at line 210 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 220 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 200 of file class.ilObjChatServerGUI.php.

References $_POST, editObject(), and sendInfo().

        {
                $this->object->server_conf->setActiveStatus((bool) $_POST["chat_active"]);
                $this->object->server_conf->updateStatus();

                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 82 of file class.ilObjChatServerGUI.php.

References $_SESSION, $rbacsystem, __getLogLevelSelect(), and __getStatusSelect().

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",'chat');

        $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->ctrl->getFormAction($this));
                                                                #$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:

Here is the caller graph for this function:

& ilObjChatServerGUI::executeCommand (  ) 

execute command

Reimplemented from ilObjectGUI.

Definition at line 55 of file class.ilObjChatServerGUI.php.

References $cmd, 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

Parameters:
object tabs gui object

Reimplemented from ilObjectGUI.

Definition at line 233 of file class.ilObjChatServerGUI.php.

References $_GET, $rbacreview, and $rbacsystem.

        {
                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 45 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 168 of file class.ilObjChatServerGUI.php.

References $_POST, $rbacsystem, editObject(), 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);
                $this->editObject();
        }

Here is the call graph for this function:


The documentation for this class was generated from the following file: