ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilChatroomServerSettings Class Reference

Class ilChatroomServerSettings. More...

+ Collaboration diagram for ilChatroomServerSettings:

Public Member Functions

 getPort ()
 Returns $this->port. More...
 
 setPort ($port)
 Sets $this->port using given $port. More...
 
 getProtocol ()
 Returns $this->protocol. More...
 
 setProtocol ($protocol)
 Sets $this->protocol using given $protocol. More...
 
 getDomain ()
 Returns $this->domain. More...
 
 setDomain ($domain)
 Sets $this->domain using given $domain. More...
 
 getURL ($action, $scope)
 Creates URL by calling $this->getBaseURL and using given $action and $scope and returns it. More...
 
 getBaseURL ()
 Returns base URL. More...
 
 getInstance ()
 Returns $this->instance. More...
 
 setInstance ($instance)
 Sets $this->instance using given $instance. More...
 
 setSmiliesEnabled ($a_bool)
 
 getSmiliesEnabled ()
 

Static Public Member Functions

static loadDefault ()
 

Private Attributes

 $port = '8585'
 
 $protocol = 'http://'
 
 $domain = '192.168.1.94'
 
 $instance = '123456'
 

Detailed Description

Member Function Documentation

◆ getBaseURL()

ilChatroomServerSettings::getBaseURL ( )

Returns base URL.

Creates base URL by calling $this->getProtocol(), $this->getDomain() and $this->getPort() and returnes it.

Returns
string

Definition at line 103 of file class.ilChatroomServerSettings.php.

104 {
105 return $this->getProtocol() . $this->getDomain() . ':' . $this->getPort();
106 }
getProtocol()
Returns $this->protocol.

References getDomain(), getPort(), and getProtocol().

Referenced by getURL().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDomain()

ilChatroomServerSettings::getDomain ( )

Returns $this->domain.

Returns
string

Definition at line 66 of file class.ilChatroomServerSettings.php.

References $domain.

Referenced by getBaseURL().

+ Here is the caller graph for this function:

◆ getInstance()

ilChatroomServerSettings::getInstance ( )

Returns $this->instance.

Returns
string

Definition at line 113 of file class.ilChatroomServerSettings.php.

References $instance.

Referenced by getURL().

+ Here is the caller graph for this function:

◆ getPort()

ilChatroomServerSettings::getPort ( )

Returns $this->port.

Returns
string

Definition at line 26 of file class.ilChatroomServerSettings.php.

References $port.

Referenced by getBaseURL().

+ Here is the caller graph for this function:

◆ getProtocol()

ilChatroomServerSettings::getProtocol ( )

Returns $this->protocol.

Returns
string

Definition at line 46 of file class.ilChatroomServerSettings.php.

References $protocol.

Referenced by getBaseURL().

+ Here is the caller graph for this function:

◆ getSmiliesEnabled()

ilChatroomServerSettings::getSmiliesEnabled ( )

Definition at line 132 of file class.ilChatroomServerSettings.php.

132 {
133 return (bool) $this->smilies_enabled;
134 }

◆ getURL()

ilChatroomServerSettings::getURL (   $action,
  $scope 
)

Creates URL by calling $this->getBaseURL and using given $action and $scope and returns it.

Parameters
string$action
string$scope
Returns
string

Definition at line 89 of file class.ilChatroomServerSettings.php.

90 {
91 return $this->getBaseURL() .
92 '/backend/' . $action . '/' . $this->getInstance() . '/' . $scope;
93 }

References getBaseURL(), and getInstance().

+ Here is the call graph for this function:

◆ loadDefault()

static ilChatroomServerSettings::loadDefault ( )
static

Definition at line 136 of file class.ilChatroomServerSettings.php.

136 {
137 global $ilDB;
138
139 $query = 'SELECT * FROM chatroom_admconfig';
140 $rset = $ilDB->query($query);
141 $row = $ilDB->fetchAssoc($rset);
142
143 $client_settings = json_decode($row['client_settings']);
144 $server_settings = json_decode($row['server_settings']);
145
146 $settings = new ilChatroomServerSettings();
147 $settings->setPort($server_settings->port);
148 $settings->setProtocol($server_settings->protocol);
149 $settings->setInstance($client_settings->name);
150 $settings->setDomain($server_settings->address);
151 $settings->setSmiliesEnabled($client_settings->enable_smilies);
152 return $settings;
153 }
Class ilChatroomServerSettings.
global $ilDB

References $ilDB, $query, and $row.

Referenced by ilObjChatroomAdminGUI\getConnector(), and ilChatroomAdmin\getServerSettings().

+ Here is the caller graph for this function:

◆ setDomain()

ilChatroomServerSettings::setDomain (   $domain)

Sets $this->domain using given $domain.

Parameters
string$domain

Definition at line 76 of file class.ilChatroomServerSettings.php.

77 {
78 $this->domain = $domain;
79 }

References $domain.

◆ setInstance()

ilChatroomServerSettings::setInstance (   $instance)

Sets $this->instance using given $instance.

Parameters
string$instance

Definition at line 123 of file class.ilChatroomServerSettings.php.

124 {
125 $this->instance = $instance;
126 }

References $instance.

◆ setPort()

ilChatroomServerSettings::setPort (   $port)

Sets $this->port using given $port.

Parameters
string$port

Definition at line 36 of file class.ilChatroomServerSettings.php.

37 {
38 $this->port = $port;
39 }

References $port.

◆ setProtocol()

ilChatroomServerSettings::setProtocol (   $protocol)

Sets $this->protocol using given $protocol.

Parameters
string$protocol

Definition at line 56 of file class.ilChatroomServerSettings.php.

57 {
58 $this->protocol = $protocol . '://';
59 }

References $protocol.

◆ setSmiliesEnabled()

ilChatroomServerSettings::setSmiliesEnabled (   $a_bool)

Definition at line 128 of file class.ilChatroomServerSettings.php.

128 {
129 $this->smilies_enabled = $a_bool;
130 }

Field Documentation

◆ $domain

ilChatroomServerSettings::$domain = '192.168.1.94'
private

Definition at line 18 of file class.ilChatroomServerSettings.php.

Referenced by getDomain(), and setDomain().

◆ $instance

ilChatroomServerSettings::$instance = '123456'
private

Definition at line 19 of file class.ilChatroomServerSettings.php.

Referenced by getInstance(), and setInstance().

◆ $port

ilChatroomServerSettings::$port = '8585'
private

Definition at line 16 of file class.ilChatroomServerSettings.php.

Referenced by getPort(), and setPort().

◆ $protocol

ilChatroomServerSettings::$protocol = 'http://'
private

Definition at line 17 of file class.ilChatroomServerSettings.php.

Referenced by getProtocol(), and setProtocol().


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