19 declare(strict_types=1);
40 $this->
lng->loadLanguageModule(
'chatroom');
41 $this->
lng->loadLanguageModule(
'chatroom_adm');
50 $main_tpl = $DIC->ui()->mainTemplate();
58 $DIC->ctrl()->setParameterByClass(self::class,
'sub', $sub);
61 $DIC->ctrl()->setParameterByClass(self::class,
'ref_id',
$ref_id);
62 $DIC->ctrl()->redirectByClass(
64 ilRepositoryGUI::class,
70 $DIC->ctrl()->setParameterByClass(ilInfoScreenGUI::class,
'ref_id',
$ref_id);
71 $DIC->ctrl()->redirectByClass(
73 ilRepositoryGUI::class,
75 ilInfoScreenGUI::class
79 } elseif ($DIC->rbac()->system()->checkAccess(
'read',
ROOT_FOLDER_ID)) {
80 $main_tpl->setOnScreenMessage(
'info', sprintf(
81 $DIC->language()->txt(
'msg_no_perm_read_item'),
87 $DIC[
'ilErr']->raiseError(
89 $DIC->language()->txt(
'msg_no_perm_read_item'),
103 $forms = parent::initCreationForms($new_type);
105 $forms[self::CFORM_NEW]->clearCommandButtons();
106 $forms[self::CFORM_NEW]->addCommandButton(
'create-save', $this->
lng->txt($new_type .
'_add'));
107 $forms[self::CFORM_NEW]->addCommandButton(
'cancel', $this->
lng->txt(
'cancel'));
114 if (is_object($this->
object)) {
116 $this->
object->getTitle(),
117 $this->
ctrl->getLinkTarget($this,
'view'),
126 return $this->
object->getRefId();
143 'view-toggleAutoMessageDisplayState',
156 $refId = $this->
http->wrapper()->query()->retrieve(
'ref_id', $this->
refinery->kindlyTo()->int());
158 $DIC[
'ilNavigationHistory']->addItem(
160 './goto.php?target=' . $this->type .
'_' .
$refId,
165 $next_class = $this->
ctrl->getNextClass();
172 if ($this->
http->wrapper()->query()->has(
'baseClass')) {
173 $baseClass = $this->
http->wrapper()->query()->retrieve(
175 $this->
refinery->kindlyTo()->string()
178 if (strtolower($baseClass) === strtolower(ilAdministrationGUI::class)) {
179 $tabFactory->getAdminTabsForCommand($this->
ctrl->getCmd());
181 $DIC[
'ilHelp']->setScreenIdComponent(
'chtr');
182 $tabFactory->getTabsForCommand($this->
ctrl->getCmd());
187 if ($this->
ctrl->getCmd() !==
'info' && strtolower($next_class) === strtolower(ilInfoScreenGUI::class)) {
188 $this->
ctrl->setCmd(
'info-' . $this->
ctrl->getCmd());
192 if ($this->
ctrl->getCmd() ===
'infoScreen') {
193 $this->
ctrl->setCmdClass(ilInfoScreenGUI::class);
194 $this->
ctrl->setCmd(
'info');
197 switch (strtolower($next_class)) {
198 case strtolower(ilPropertyFormGUI::class):
200 $form = $factory->getClientSettingsForm();
201 $this->
ctrl->forwardCommand($form);
204 case strtolower(ilPermissionGUI::class):
207 $this->
ctrl->forwardCommand($perm_gui);
210 case strtolower(ilExportGUI::class):
213 $GLOBALS[
'DIC']->tabs()->setTabActive(
'export');
216 $exp->addFormat(
'xml');
217 $this->
ctrl->forwardCommand($exp);
220 case strtolower(ilObjectCopyGUI::class):
223 $cp->setType(
'chtr');
224 $this->
ctrl->forwardCommand($cp);
227 case strtolower(ilCommonActionDispatcherGUI::class):
230 $this->
ctrl->forwardCommand($gui);
235 $res = explode(
'-', (
string) $this->
ctrl->getCmd(
''), 2);
237 if (!$result && method_exists($this, $this->
ctrl->getCmd() .
'Object')) {
239 $this->{$this->
ctrl->getCmd() .
'Object'}();
242 if ($this->
ctrl->isAsynch()) {
243 $responseStream = Streams::ofString(json_encode([
245 'reason' => $e->getMessage()
246 ], JSON_THROW_ON_ERROR));
247 $this->
http->saveResponse(
248 $this->
http->response()
249 ->withBody($responseStream)
250 ->withHeader(ResponseHeader::CONTENT_TYPE,
'application/json')
252 $this->
http->sendResponse();
253 $this->
http->close();
261 if ($this->
object?->getType() !==
'chta') {
265 if ($tabFactory !== null &&
266 $tabFactory->getActivatedTab() !== null &&
267 $this->tabs_gui->getActiveTab() !== $tabFactory->getActivatedTab()) {
268 $this->tabs_gui->activateTab($tabFactory->getActivatedTab());
281 $this->
object->getId()
296 $this->tpl->setVariable(
'ADM_CONTENT', $this->
lng->txt(
'invalid_operation'));
310 $refId = $this->
http->wrapper()->query()->retrieve(
'ref_id', $this->
refinery->kindlyTo()->int());
312 if ($this->
http->wrapper()->post()->has(
'title')) {
314 $this->
http->wrapper()->post()->retrieve(
316 $this->
refinery->kindlyTo()->string()
321 if ($this->
http->wrapper()->post()->has(
'desc')) {
323 $this->
http->wrapper()->post()->retrieve(
325 $this->
refinery->kindlyTo()->string()
332 if (!$this->rbac_system->checkAccess(
'create',
$refId, $new_type)) {
333 $this->
ilias->raiseError(
334 $this->
lng->txt(
'no_create_permission'),
335 $this->
ilias->error_obj->MESSAGE
340 $class_name =
'ilObj' . $this->obj_definition->getClassName($new_type);
342 $newObj =
new $class_name();
343 $newObj->setType($new_type);
344 $newObj->setTitle($title);
345 $newObj->setDescription($desc);
347 $newObj->createReference();
348 $newObj->putInTree(
$refId);
349 $newObj->setPermissions(
$refId);
351 $objId = $newObj->getId();
354 $room->saveSettings([
356 'autogen_usernames' =>
'Autogen #',
357 'display_past_msgs' => 20,
360 $rbac_log_roles = $this->rbac_review->getParentRoleIds($newObj->getRefId());
364 $this->
object = $newObj;
378 parent::afterImport($new_object);
static checkUserPermissions($permissions, int $ref_id, bool $send_info=true)
Checks user permissions by given array and ref_id.
static gatherFaPa(int $a_ref_id, array $a_role_ids, bool $a_add_action=false)
__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...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
afterImport(ilObject $new_object)
static _gotoRepositoryNode(int $ref_id, string $cmd="")
settings()
Calls prepareOutput method.
static _lookupObjId(int $ref_id)
createActionDispatcherGUI()
Export User Interface Class.
static http()
Fetches the global http state from ILIAS.
static add(int $a_action, int $a_ref_id, array $a_diff, bool $a_source_ref_id=false)
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.
header include for all ilias files.
dispatchCall(string $gui, string $method)
Class ilChatroomTabGUIFactory.
static getDefaultDefinition(string $moduleName)
Returns an Instance of ilChatroomObjectDefinition, using given $moduleName as parameter.
static byObjectId(int $object_id)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
addHeaderAction()
Add header action menu.
Interface ilCtrlSecurityInterface provides ilCtrl security information.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initCreationForms(string $new_type)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
fallback()
Calls $this->prepareOutput method and sets template variable.