19declare(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
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();
113 'ban-handleTableActions',
120 'view-toggleAutoMessageDisplayState',
128 if (
'cancel' === $this->
ctrl->getCmd() && $this->getCreationMode()) {
133 $refId = $this->
http->wrapper()->query()->retrieve(
'ref_id', $this->
refinery->kindlyTo()->int());
135 $DIC[
'ilNavigationHistory']->addItem(
137 './goto.php?target=' . $this->type .
'_' .
$refId,
142 $next_class = $this->
ctrl->getNextClass() ??
'';
148 $baseClass = $this->
http->wrapper()->query()->retrieve(
151 $this->refinery->kindlyTo()->string(),
152 $this->refinery->always(
'')
155 if (strtolower($baseClass) === strtolower(ilAdministrationGUI::class)) {
156 $tabFactory->getAdminTabsForCommand($this->
ctrl->getCmd());
158 $DIC[
'ilHelp']->setScreenIdComponent(
'chtr');
159 $tabFactory->getTabsForCommand($this->
ctrl->getCmd());
163 switch (strtolower($next_class)) {
164 case strtolower(ilInfoScreenGUI::class):
168 case strtolower(ilPropertyFormGUI::class):
170 $form = $factory->getClientSettingsForm();
171 $this->
ctrl->forwardCommand($form);
174 case strtolower(ilPermissionGUI::class):
177 $this->
ctrl->forwardCommand($perm_gui);
180 case strtolower(ilExportGUI::class):
183 $GLOBALS[
'DIC']->tabs()->setTabActive(
'export');
186 $this->
ctrl->forwardCommand($exp);
189 case strtolower(ilObjectCopyGUI::class):
192 $cp->setType(
'chtr');
193 $this->
ctrl->forwardCommand($cp);
196 case strtolower(ilCommonActionDispatcherGUI::class):
199 $this->
ctrl->forwardCommand($gui);
204 $res = explode(
'-', (
string) $this->
ctrl->getCmd(
'infoScreen'), 2);
206 if (!$result && method_exists($this, $this->
ctrl->getCmd() .
'Object')) {
208 $this->{$this->
ctrl->getCmd() .
'Object'}();
210 }
catch (Exception
$e) {
211 if ($this->
ctrl->isAsynch()) {
212 $responseStream = Streams::ofString(json_encode([
214 'reason' =>
$e->getMessage()
215 ], JSON_THROW_ON_ERROR));
216 $this->
http->saveResponse(
217 $this->
http->response()
218 ->withBody($responseStream)
219 ->withHeader(ResponseHeader::CONTENT_TYPE,
'application/json')
221 $this->
http->sendResponse();
222 $this->
http->close();
230 if ($this->
object?->getType() !==
'chta') {
234 if ($tabFactory !==
null &&
235 $tabFactory->getActivatedTab() !==
null &&
236 $this->tabs_gui->getActiveTab() !== $tabFactory->getActivatedTab()) {
237 $this->tabs_gui->activateTab($tabFactory->getActivatedTab());
248 $this->object->getType(),
250 $this->object->getId()
256 if (strtolower($this->
ctrl->getCmd() ??
'') ===
'info') {
257 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
'showSummary');
264 $info->enablePrivateNotes();
266 $refId = $this->request_wrapper->retrieve(
285 $this->tpl->setVariable(
'ADM_CONTENT', $this->
lng->txt(
'invalid_operation'));
299 parent::afterImport($new_object);
305 $room->saveSettings([
306 'object_id' => $new_object->
getId(),
307 'autogen_usernames' =>
'Autogen #',
308 'display_past_msgs' => 100,
312 $response = $connector->sendCreatePrivateRoom(
318 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'object_added'),
true);
319 $this->
ctrl->setParameter($this,
'ref_id', $new_object->
getRefId());
320 $this->
ctrl->redirect($this,
'settings-general');
Stream factory which enables the user to create streams without the knowledge of the concrete class.
static getDefaultConfiguration()
Instantiates and returns ilChatroomAdmin object using instance_id and settings from settingsTable.
static getDefaultDefinition(string $moduleName)
Returns an Instance of ilChatroomObjectDefinition, using given $moduleName as parameter.
dispatchCall(string $gui, string $method)
Class ilChatroomServerConnector.
Class ilChatroomTabGUIFactory.
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.
static checkUserPermissions($permissions, int $ref_id, bool $send_info=true)
Checks user permissions by given array and ref_id.
static byObjectId(int $object_id)
Class ilCommonActionDispatcherGUI.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Export User Interface Class.
@ilCtrl_Calls ilObjChatroomGUI: ilMDEditorGUI, ilInfoScreenGUI, ilPermissionGUI, ilObjectCopyGUI @ilC...
afterImport(ilObject $new_object)
Post (successful) object import hook.
createActionDispatcherGUI()
afterSave(ilObject $new_object)
Post (successful) object creation hook.
getSafePostCommands()
This method must return a list of safe POST commands.
addLocatorItems()
should be overwritten to add object specific items (repository items are preloaded)
__construct($data=null, ?int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
getUnsafeGetCommands()
This method must return a list of unsafe GET commands.
GUI class for the workflow of copying objects.
cancelCreation()
cancel create action and go back to repository parent
addHeaderAction()
Add header action menu.
static _gotoRepositoryNode(int $ref_id, string $cmd="")
prepareOutput(bool $show_sub_objects=true)
Class ilObject Basic functions for all objects.
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc