ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjChatroomGUI Class Reference

Class ilObjChatroomGUI GUI class for chatroom objects. More...

+ Inheritance diagram for ilObjChatroomGUI:
+ Collaboration diagram for ilObjChatroomGUI:

Public Member Functions

 __construct ($data=null, ?int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 getUnsafeGetCommands ()
 
 getSafePostCommands ()
 
 executeCommand ()
 
 getConnector ()
 
 fallback ()
 Calls $this->prepareOutput method and sets template variable. More...
 
 settings ()
 Calls prepareOutput method. More...
 
 insertObject ()
 
- Public Member Functions inherited from ilChatroomObjectGUI
 getConnector ()
 
 switchToVisibleMode ()
 Calls $this->prepareOutput() method. More...
 
 getAdminTabs ()
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _goto ($params)
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Protected Member Functions

 getObjectDefinition ()
 
 initCreationForms (string $new_type)
 
 addLocatorItems ()
 
 createActionDispatcherGUI ()
 
 afterImport (ilObject $new_object)
 
- Protected Member Functions inherited from ilChatroomObjectGUI
 dispatchCall (string $gui, string $method)
 
 getObjectDefinition ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 addAdoptContentLinkToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
- Protected Attributes inherited from ilChatroomObjectGUI
GlobalHttpState $http
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Detailed Description

Class ilObjChatroomGUI GUI class for chatroom objects.

Author
Jan Posselt <jposselt at databay.de>
Version
$Id$ ilObjChatroomGUI: ilMDEditorGUI, ilInfoScreenGUI, ilPermissionGUI, ilObjectCopyGUI ilObjChatroomGUI: ilExportGUI, ilCommonActionDispatcherGUI, ilPropertyFormGUI, ilExportGUI

Definition at line 34 of file class.ilObjChatroomGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjChatroomGUI::__construct (   $data = null,
?int  $id = 0,
bool  $call_by_reference = true,
bool  $prepare_output = true 
)

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

References ilObjectGUI\$call_by_reference, ilObjectGUI\$data, ilObjectGUI\$id, ILIAS\MetaData\Repository\Validation\Data\__construct(), and ILIAS\Repository\lng().

37  {
38  $this->type = 'chtr';
40  $this->lng->loadLanguageModule('chatroom');
41  $this->lng->loadLanguageModule('chatroom_adm');
42  }
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjChatroomGUI::_goto (   $params)
static

Definition at line 47 of file class.ilObjChatroomGUI.php.

References $DIC, $params, $parts, ilObjectGUI\$ref_id, ilObjectGUI\_gotoRepositoryNode(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilChatroom\checkUserPermissions(), ILIAS\Repository\int(), and ROOT_FOLDER_ID.

47  : void
48  {
49  global $DIC;
50  $main_tpl = $DIC->ui()->mainTemplate();
51 
52  $parts = array_filter(explode('_', (string) $params));
53  $ref_id = (int) $parts[0];
54  $sub = (int) ($parts[1] ?? 0);
55 
56  if (ilChatroom::checkUserPermissions('read', $ref_id, false)) {
57  if ($sub) {
58  $DIC->ctrl()->setParameterByClass(self::class, 'sub', $sub);
59  }
60 
61  $DIC->ctrl()->setParameterByClass(self::class, 'ref_id', $ref_id);
62  $DIC->ctrl()->redirectByClass(
63  [
64  ilRepositoryGUI::class,
65  self::class,
66  ],
67  'view'
68  );
69  } elseif (ilChatroom::checkUserPermissions('visible', $ref_id, false)) {
70  $DIC->ctrl()->setParameterByClass(ilInfoScreenGUI::class, 'ref_id', $ref_id);
71  $DIC->ctrl()->redirectByClass(
72  [
73  ilRepositoryGUI::class,
74  self::class,
75  ilInfoScreenGUI::class
76  ],
77  'info'
78  );
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'),
83  ), true);
85  }
86 
87  $DIC['ilErr']->raiseError(
88  sprintf(
89  $DIC->language()->txt('msg_no_perm_read_item'),
91  ),
92  $DIC['ilErr']->FATAL
93  );
94  }
static checkUserPermissions($permissions, int $ref_id, bool $send_info=true)
Checks user permissions by given array and ref_id.
const ROOT_FOLDER_ID
Definition: constants.php:32
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
static _gotoRepositoryNode(int $ref_id, string $cmd="")
static _lookupObjId(int $ref_id)
global $DIC
Definition: feed.php:28
static _lookupTitle(int $obj_id)
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjChatroomGUI::addLocatorItems ( )
protected

Definition at line 112 of file class.ilObjChatroomGUI.php.

References ILIAS\Repository\ctrl(), getRefId(), ILIAS\Repository\locator(), and ILIAS\Repository\object().

112  : void
113  {
114  if (is_object($this->object)) {
115  $this->locator->addItem(
116  $this->object->getTitle(),
117  $this->ctrl->getLinkTarget($this, 'view'),
118  '',
119  $this->getRefId()
120  );
121  }
122  }
+ Here is the call graph for this function:

◆ afterImport()

ilObjChatroomGUI::afterImport ( ilObject  $new_object)
protected
Parameters
ilObjChatroom$new_object

Definition at line 372 of file class.ilObjChatroomGUI.php.

References $response, ilChatroom\byObjectId(), getConnector(), ilObject\getId(), ilObject\getOwner(), and ilObject\getTitle().

372  : void
373  {
374  $room = ilChatroom::byObjectId($new_object->getId());
375  $connector = $this->getConnector();
376  $response = $connector->sendCreatePrivateRoom($room->getRoomId(), $new_object->getOwner(), $new_object->getTitle());
377 
378  parent::afterImport($new_object);
379  }
$response
Definition: xapitoken.php:93
static byObjectId(int $object_id)
+ Here is the call graph for this function:

◆ createActionDispatcherGUI()

ilObjChatroomGUI::createActionDispatcherGUI ( )
protected

Definition at line 272 of file class.ilObjChatroomGUI.php.

References $DIC, ilObjectGUI\$ref_id, ILIAS\Repository\object(), and ilCommonActionDispatcherGUI\TYPE_REPOSITORY.

273  {
274  global $DIC;
275 
276  return new ilCommonActionDispatcherGUI(
278  new AccessBridge($DIC->rbac()->system()),
279  $this->object->getType(),
281  $this->object->getId()
282  );
283  }
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ executeCommand()

ilObjChatroomGUI::executeCommand ( )

Definition at line 147 of file class.ilObjChatroomGUI.php.

References $DIC, Vendor\Package\$e, $GLOBALS, $refId, $res, ilObjectGUI\addHeaderAction(), ilObjectGUI\cancelCreation(), ilChatroom\checkPermissionsOfUser(), ILIAS\Repository\ctrl(), ilChatroomObjectGUI\dispatchCall(), ilObjectGUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ILIAS\FileDelivery\http(), ilObjectGUI\prepareOutput(), ILIAS\Repository\refinery(), and ILIAS\Repository\user().

147  : void
148  {
149  global $DIC;
150 
151  if ('cancel' === $this->ctrl->getCmd() && $this->getCreationMode()) {
152  $this->cancelCreation();
153  return;
154  }
155 
156  $refId = $this->http->wrapper()->query()->retrieve('ref_id', $this->refinery->kindlyTo()->int());
157  if (!$this->getCreationMode() && ilChatroom::checkPermissionsOfUser($this->user->getId(), 'read', $refId)) {
158  $DIC['ilNavigationHistory']->addItem(
159  $refId,
160  './goto.php?target=' . $this->type . '_' . $refId,
161  $this->type
162  );
163  }
164 
165  $next_class = $this->ctrl->getNextClass();
166 
167  $tabFactory = null;
168  if (!$this->getCreationMode()) {
169  $tabFactory = new ilChatroomTabGUIFactory($this);
170 
171  $baseClass = '';
172  if ($this->http->wrapper()->query()->has('baseClass')) {
173  $baseClass = $this->http->wrapper()->query()->retrieve(
174  'baseClass',
175  $this->refinery->kindlyTo()->string()
176  );
177  }
178  if (strtolower($baseClass) === strtolower(ilAdministrationGUI::class)) {
179  $tabFactory->getAdminTabsForCommand($this->ctrl->getCmd());
180  } else {
181  $DIC['ilHelp']->setScreenIdComponent('chtr');
182  $tabFactory->getTabsForCommand($this->ctrl->getCmd());
183  }
184  }
185 
186  // #8701 - infoscreen actions
187  if ($this->ctrl->getCmd() !== 'info' && strtolower($next_class) === strtolower(ilInfoScreenGUI::class)) {
188  $this->ctrl->setCmd('info-' . $this->ctrl->getCmd());
189  }
190 
191  // repository info call
192  if ($this->ctrl->getCmd() === 'infoScreen') {
193  $this->ctrl->setCmdClass(ilInfoScreenGUI::class);
194  $this->ctrl->setCmd('info');
195  }
196 
197  switch (strtolower($next_class)) {
198  case strtolower(ilPropertyFormGUI::class):
199  $factory = new ilChatroomFormFactory();
200  $form = $factory->getClientSettingsForm();
201  $this->ctrl->forwardCommand($form);
202  break;
203 
204  case strtolower(ilPermissionGUI::class):
205  $this->prepareOutput();
206  $perm_gui = new ilPermissionGUI($this);
207  $this->ctrl->forwardCommand($perm_gui);
208  break;
209 
210  case strtolower(ilExportGUI::class):
211  $this->prepareOutput();
212 
213  $GLOBALS['DIC']->tabs()->setTabActive('export');
214 
215  $exp = new ilExportGUI($this);
216  $exp->addFormat('xml');
217  $this->ctrl->forwardCommand($exp);
218  break;
219 
220  case strtolower(ilObjectCopyGUI::class):
221  $this->prepareOutput();
222  $cp = new ilObjectCopyGUI($this);
223  $cp->setType('chtr');
224  $this->ctrl->forwardCommand($cp);
225  break;
226 
227  case strtolower(ilCommonActionDispatcherGUI::class):
228  $this->prepareOutput();
230  $this->ctrl->forwardCommand($gui);
231  break;
232 
233  default:
234  try {
235  $res = explode('-', (string) $this->ctrl->getCmd(''), 2);
236  $result = $this->dispatchCall($res[0], $res[1] ?? '');
237  if (!$result && method_exists($this, $this->ctrl->getCmd() . 'Object')) {
238  $this->prepareOutput();
239  $this->{$this->ctrl->getCmd() . 'Object'}();
240  }
241  } catch (Exception $e) {
242  if ($this->ctrl->isAsynch()) {
243  $responseStream = Streams::ofString(json_encode([
244  'success' => false,
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')
251  );
252  $this->http->sendResponse();
253  $this->http->close();
254  } else {
255  throw $e;
256  }
257  }
258  break;
259  }
260 
261  if ($this->object?->getType() !== 'chta') {
262  $this->addHeaderAction();
263  }
264 
265  if ($tabFactory !== null &&
266  $tabFactory->getActivatedTab() !== null &&
267  $this->tabs_gui->getActiveTab() !== $tabFactory->getActivatedTab()) {
268  $this->tabs_gui->activateTab($tabFactory->getActivatedTab());
269  }
270  }
$res
Definition: ltiservices.php:69
cancelCreation()
cancel create action and go back to repository parent
GUI class for the workflow of copying objects.
prepareOutput(bool $show_sub_objects=true)
$refId
Definition: xapitoken.php:58
global $DIC
Definition: feed.php:28
Export User Interface Class.
static http()
Fetches the global http state from ILIAS.
$GLOBALS["DIC"]
Definition: wac.php:31
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.
dispatchCall(string $gui, string $method)
Class ilChatroomTabGUIFactory.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
addHeaderAction()
Add header action menu.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ fallback()

ilObjChatroomGUI::fallback ( )

Calls $this->prepareOutput method and sets template variable.

Definition at line 293 of file class.ilObjChatroomGUI.php.

References ILIAS\Repository\lng(), and ilObjectGUI\prepareOutput().

293  : void
294  {
295  $this->prepareOutput();
296  $this->tpl->setVariable('ADM_CONTENT', $this->lng->txt('invalid_operation'));
297  }
prepareOutput(bool $show_sub_objects=true)
+ Here is the call graph for this function:

◆ getConnector()

ilObjChatroomGUI::getConnector ( )

Definition at line 285 of file class.ilObjChatroomGUI.php.

References ilChatroomAdmin\getDefaultConfiguration().

Referenced by afterImport().

286  {
287  return new ilChatroomServerConnector(ilChatroomAdmin::getDefaultConfiguration()->getServerSettings());
288  }
static getDefaultConfiguration()
Instantiates and returns ilChatroomAdmin object using instance_id and settings from settingsTable...
Class ilChatroomServerConnector.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getObjectDefinition()

ilObjChatroomGUI::getObjectDefinition ( )
protected

Definition at line 96 of file class.ilObjChatroomGUI.php.

References ilChatroomObjectDefinition\getDefaultDefinition().

97  {
99  }
static getDefaultDefinition(string $moduleName)
Returns an Instance of ilChatroomObjectDefinition, using given $moduleName as parameter.
+ Here is the call graph for this function:

◆ getRefId()

ilObjChatroomGUI::getRefId ( )

Definition at line 124 of file class.ilObjChatroomGUI.php.

Referenced by addLocatorItems().

124  : int
125  {
126  return $this->object->getRefId();
127  }
+ Here is the caller graph for this function:

◆ getSafePostCommands()

ilObjChatroomGUI::getSafePostCommands ( )

Implements ilCtrlSecurityInterface.

Definition at line 140 of file class.ilObjChatroomGUI.php.

140  : array
141  {
142  return [
143  'view-toggleAutoMessageDisplayState',
144  ];
145  }

◆ getUnsafeGetCommands()

ilObjChatroomGUI::getUnsafeGetCommands ( )

Implements ilCtrlSecurityInterface.

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

132  : array
133  {
134  return [];
135  }

◆ initCreationForms()

ilObjChatroomGUI::initCreationForms ( string  $new_type)
protected

Definition at line 101 of file class.ilObjChatroomGUI.php.

References ILIAS\Repository\lng().

101  : array
102  {
103  $forms = parent::initCreationForms($new_type);
104 
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'));
108 
109  return $forms;
110  }
+ Here is the call graph for this function:

◆ insertObject()

ilObjChatroomGUI::insertObject ( )

Definition at line 307 of file class.ilObjChatroomGUI.php.

References $objId, $refId, ilObjectGUI\$type, ilRbacLog\add(), ilRbacLog\CREATE_OBJECT, ilRbacLog\gatherFaPa(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ilUtil\stripSlashes().

307  : ilObjChatroom
308  {
309  $new_type = $this->type;
310  $refId = $this->http->wrapper()->query()->retrieve('ref_id', $this->refinery->kindlyTo()->int());
311  $title = '';
312  if ($this->http->wrapper()->post()->has('title')) {
313  $title = ilUtil::stripSlashes(
314  $this->http->wrapper()->post()->retrieve(
315  'title',
316  $this->refinery->kindlyTo()->string()
317  )
318  );
319  }
320  $desc = '';
321  if ($this->http->wrapper()->post()->has('desc')) {
322  $desc = ilUtil::stripSlashes(
323  $this->http->wrapper()->post()->retrieve(
324  'desc',
325  $this->refinery->kindlyTo()->string()
326  )
327  );
328  }
329 
330  // create permission is already checked in createObject.
331  // This check here is done to prevent hacking attempts
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
336  );
337  }
338 
339  // create and insert object in objecttree
340  $class_name = 'ilObj' . $this->obj_definition->getClassName($new_type);
341 
342  $newObj = new $class_name();
343  $newObj->setType($new_type);
344  $newObj->setTitle($title);
345  $newObj->setDescription($desc);
346  $newObj->create();
347  $newObj->createReference();
348  $newObj->putInTree($refId);
349  $newObj->setPermissions($refId);
350 
351  $objId = $newObj->getId();
352 
353  $room = new ilChatroom();
354  $room->saveSettings([
355  'object_id' => $objId,
356  'autogen_usernames' => 'Autogen #',
357  'display_past_msgs' => 20,
358  ]);
359 
360  $rbac_log_roles = $this->rbac_review->getParentRoleIds($newObj->getRefId());
361  $rbac_log = ilRbacLog::gatherFaPa($newObj->getRefId(), array_keys($rbac_log_roles), true);
362  ilRbacLog::add(ilRbacLog::CREATE_OBJECT, $newObj->getRefId(), $rbac_log);
363 
364  $this->object = $newObj;
365 
366  return $newObj;
367  }
static gatherFaPa(int $a_ref_id, array $a_role_ids, bool $a_add_action=false)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
$objId
Definition: xapitoken.php:57
$refId
Definition: xapitoken.php:58
const CREATE_OBJECT
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)
header include for all ilias files.
Class ilChatroom.
+ Here is the call graph for this function:

◆ settings()

ilObjChatroomGUI::settings ( )

Calls prepareOutput method.

Definition at line 302 of file class.ilObjChatroomGUI.php.

References ilObjectGUI\prepareOutput().

302  : void
303  {
304  $this->prepareOutput();
305  }
prepareOutput(bool $show_sub_objects=true)
+ Here is the call graph for this function:

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