ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilChatroomObjectDefinition Class Reference
+ Collaboration diagram for ilChatroomObjectDefinition:

Public Member Functions

 __construct (private readonly string $moduleName, string $moduleBasePath, string $relativeClassPath='classes', string $guiScope='')
 
 hasGUI (string $gui)
 
 getGUIPath (string $gui)
 Builds gui path using given $gui and returns it. More...
 
 getGUIClassName (string $gui)
 Builds gui classname using given $gui and returns it. More...
 
 buildGUI (string $gui, ilChatroomObjectGUI $chatroomObjectGUI)
 Builds and returns new gui using given $gui and $gui. More...
 

Static Public Member Functions

static getDefaultDefinition (string $moduleName)
 Returns an Instance of ilChatroomObjectDefinition, using given $moduleName as parameter. More...
 
static getDefaultDefinitionWithCustomGUIPath (string $moduleName, string $guiScope='')
 Returns an Instance of ilChatroomObjectDefinition, using given $moduleName and $guiScope as parameters. More...
 

Private Attributes

readonly string $moduleBasePath
 
readonly string $relativeClassPath
 
readonly string $guiScope
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilChatroomObjectDefinition::__construct ( private readonly string  $moduleName,
string  $moduleBasePath,
string  $relativeClassPath = 'classes',
string  $guiScope = '' 
)
Parameters
$moduleNameModule name, defaults to 'Chatroom'

Definition at line 45 of file class.ilChatroomObjectDefinition.php.

53  {
54  $this->moduleBasePath = rtrim($moduleBasePath, '/\\');
55  $this->relativeClassPath = rtrim($relativeClassPath);
56  $this->guiScope = rtrim($guiScope);
57  }

Member Function Documentation

◆ buildGUI()

ilChatroomObjectDefinition::buildGUI ( string  $gui,
ilChatroomObjectGUI  $chatroomObjectGUI 
)

Builds and returns new gui using given $gui and $gui.

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

References getGUIClassName().

114  {
115  $className = $this->getGUIClassName($gui);
116  return new $className($chatroomObjectGUI);
117  }
Class ilChatroomGUIHandler.
getGUIClassName(string $gui)
Builds gui classname using given $gui and returns it.
+ Here is the call graph for this function:

◆ getDefaultDefinition()

static ilChatroomObjectDefinition::getDefaultDefinition ( string  $moduleName)
static

Returns an Instance of ilChatroomObjectDefinition, using given $moduleName as parameter.

Definition at line 63 of file class.ilChatroomObjectDefinition.php.

Referenced by ilObjChatroomGUI\getObjectDefinition().

63  : self
64  {
65  return new self($moduleName, '../components/ILIAS/' . $moduleName . '/');
66  }
+ Here is the caller graph for this function:

◆ getDefaultDefinitionWithCustomGUIPath()

static ilChatroomObjectDefinition::getDefaultDefinitionWithCustomGUIPath ( string  $moduleName,
string  $guiScope = '' 
)
static

Returns an Instance of ilChatroomObjectDefinition, using given $moduleName and $guiScope as parameters.

Parameters
string$guiScopeOptional. 'admin' or ''. Default ''

Definition at line 73 of file class.ilChatroomObjectDefinition.php.

References $guiScope.

Referenced by ilObjChatroomAdminGUI\getObjectDefinition().

73  : self
74  {
75  return new self(
76  $moduleName,
77  '../components/ILIAS/' . $moduleName . '/',
78  'classes',
79  $guiScope
80  );
81  }
+ Here is the caller graph for this function:

◆ getGUIClassName()

ilChatroomObjectDefinition::getGUIClassName ( string  $gui)

Builds gui classname using given $gui and returns it.

Definition at line 105 of file class.ilChatroomObjectDefinition.php.

Referenced by buildGUI(), getGUIPath(), and hasGUI().

105  : string
106  {
107  return 'il' . $this->moduleName . ucfirst($this->guiScope) . ucfirst($gui) . 'GUI';
108  }
+ Here is the caller graph for this function:

◆ getGUIPath()

ilChatroomObjectDefinition::getGUIPath ( string  $gui)

Builds gui path using given $gui and returns it.

Definition at line 93 of file class.ilChatroomObjectDefinition.php.

References getGUIClassName().

Referenced by hasGUI().

93  : string
94  {
95  return (
96  $this->moduleBasePath . '/' .
97  $this->relativeClassPath . '/' .
98  $this->guiScope . 'gui/class.' . $this->getGUIClassName($gui) . '.php'
99  );
100  }
getGUIClassName(string $gui)
Builds gui classname using given $gui and returns it.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasGUI()

ilChatroomObjectDefinition::hasGUI ( string  $gui)

Definition at line 83 of file class.ilChatroomObjectDefinition.php.

References $path, getGUIClassName(), and getGUIPath().

83  : bool
84  {
85  $path = $this->getGUIPath($gui);
86 
87  return class_exists($this->getGUIClassName($gui)) && file_exists($path);
88  }
getGUIPath(string $gui)
Builds gui path using given $gui and returns it.
$path
Definition: ltiservices.php:29
getGUIClassName(string $gui)
Builds gui classname using given $gui and returns it.
+ Here is the call graph for this function:

Field Documentation

◆ $guiScope

readonly string ilChatroomObjectDefinition::$guiScope
private

◆ $moduleBasePath

readonly string ilChatroomObjectDefinition::$moduleBasePath
private

Definition at line 30 of file class.ilChatroomObjectDefinition.php.

◆ $relativeClassPath

readonly string ilChatroomObjectDefinition::$relativeClassPath
private

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


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