19 declare(strict_types=1);
35 $this->
lng->loadLanguageModule(
'chatroom');
36 $this->
lng->loadLanguageModule(
'chatroom_adm');
42 $main_tpl = $DIC->ui()->mainTemplate();
50 $DIC->ctrl()->setParameterByClass(self::class,
'sub', $sub);
53 $DIC->ctrl()->setParameterByClass(self::class,
'ref_id',
$ref_id);
54 $DIC->ctrl()->redirectByClass(
56 ilRepositoryGUI::class,
62 $DIC->ctrl()->setParameterByClass(ilInfoScreenGUI::class,
'ref_id',
$ref_id);
63 $DIC->ctrl()->redirectByClass(
65 ilRepositoryGUI::class,
67 ilInfoScreenGUI::class
71 } elseif ($DIC->rbac()->system()->checkAccess(
'read',
ROOT_FOLDER_ID)) {
72 $main_tpl->setOnScreenMessage(
'info', sprintf(
73 $DIC->language()->txt(
'msg_no_perm_read_item'),
79 $DIC[
'ilErr']->raiseError(
81 $DIC->language()->txt(
'msg_no_perm_read_item'),
95 if (is_object($this->
object)) {
98 $this->
ctrl->getLinkTarget($this,
'view'),
107 return $this->
object->getRefId();
118 'view-toggleAutoMessageDisplayState',
131 $refId = $this->
http->wrapper()->query()->retrieve(
'ref_id', $this->
refinery->kindlyTo()->int());
133 $DIC[
'ilNavigationHistory']->addItem(
135 './goto.php?target=' . $this->type .
'_' .
$refId,
140 $next_class = $this->
ctrl->getNextClass() ??
'';
146 $baseClass = $this->
http->wrapper()->query()->retrieve(
149 $this->refinery->kindlyTo()->string(),
153 if (strtolower($baseClass) === strtolower(ilAdministrationGUI::class)) {
154 $tabFactory->getAdminTabsForCommand($this->
ctrl->getCmd());
156 $DIC[
'ilHelp']->setScreenIdComponent(
'chtr');
157 $tabFactory->getTabsForCommand($this->
ctrl->getCmd());
161 switch (strtolower($next_class)) {
162 case strtolower(ilInfoScreenGUI::class):
166 case strtolower(ilPropertyFormGUI::class):
168 $form = $factory->getClientSettingsForm();
169 $this->
ctrl->forwardCommand($form);
172 case strtolower(ilPermissionGUI::class):
175 $this->
ctrl->forwardCommand($perm_gui);
178 case strtolower(ilExportGUI::class):
181 $GLOBALS[
'DIC']->tabs()->setTabActive(
'export');
184 $exp->addFormat(
'xml');
185 $this->
ctrl->forwardCommand($exp);
188 case strtolower(ilObjectCopyGUI::class):
191 $cp->setType(
'chtr');
192 $this->
ctrl->forwardCommand($cp);
195 case strtolower(ilCommonActionDispatcherGUI::class):
198 $this->
ctrl->forwardCommand($gui);
203 $res = explode(
'-', (
string) $this->
ctrl->getCmd(
''), 2);
205 if (!$result && method_exists($this, $this->
ctrl->getCmd() .
'Object')) {
207 $this->{$this->
ctrl->getCmd() .
'Object'}();
210 if ($this->
ctrl->isAsynch()) {
211 $responseStream = Streams::ofString(json_encode([
213 'reason' => $e->getMessage()
214 ], JSON_THROW_ON_ERROR));
215 $this->
http->saveResponse(
216 $this->
http->response()
217 ->withBody($responseStream)
218 ->withHeader(ResponseHeader::CONTENT_TYPE,
'application/json')
220 $this->
http->sendResponse();
221 $this->
http->close();
229 if ($this->
object?->getType() !==
'chta') {
233 if ($tabFactory !==
null &&
234 $tabFactory->getActivatedTab() !==
null &&
235 $this->tabs_gui->getActiveTab() !== $tabFactory->getActivatedTab()) {
236 $this->tabs_gui->activateTab($tabFactory->getActivatedTab());
249 $this->
object->getId()
255 if (strtolower($this->
ctrl->getCmd() ??
'') ===
'info') {
256 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
'showSummary');
263 $info->enablePrivateNotes();
265 $refId = $this->request_wrapper->retrieve(
273 $info->addMetaDataSections(
278 $this->
ctrl->forwardCommand($info);
289 $this->tpl->setVariable(
'ADM_CONTENT', $this->
lng->txt(
'invalid_operation'));
303 parent::afterImport($new_object);
309 $room->saveSettings([
310 'object_id' => $new_object->
getId(),
311 'autogen_usernames' =>
'Autogen #',
312 'display_past_msgs' => 100,
316 $response = $connector->sendCreatePrivateRoom(
322 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'object_added'),
true);
323 $this->
ctrl->setParameter($this,
'ref_id', $new_object->
getRefId());
324 $this->
ctrl->redirect($this,
'settings-general');
static checkUserPermissions($permissions, int $ref_id, bool $send_info=true)
Checks user permissions by given array and ref_id.
getSafePostCommands()
This method must return a list of safe POST commands.
__construct($data=null, ?int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
cancelCreation()
cancel create action and go back to repository parent
GUI class for the workflow of copying objects.
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
prepareOutput(bool $show_sub_objects=true)
static getDefaultConfiguration()
Instantiates and returns ilChatroomAdmin object using instance_id and settings from settingsTable...
afterImport(ilObject $new_object)
static _gotoRepositoryNode(int $ref_id, string $cmd="")
static _lookupObjId(int $ref_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
createActionDispatcherGUI()
static http()
Fetches the global http state from ILIAS.
static _lookupTitle(int $obj_id)
static checkPermissionsOfUser(int $usr_id, $permissions, int $ref_id)
Checks user permissions in question for a given user id in relation to a given ref_id.
Class ilChatroomServerConnector.
dispatchCall(string $gui, string $method)
Class ilChatroomTabGUIFactory.
afterSave(ilObject $new_object)
static getDefaultDefinition(string $moduleName)
Returns an Instance of ilChatroomObjectDefinition, using given $moduleName as parameter.
__construct(Container $dic, ilPlugin $plugin)
static byObjectId(int $object_id)
getUnsafeGetCommands()
This method must return a list of unsafe GET commands.
addHeaderAction()
Add header action menu.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCommonActionDispatcherGUI.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call