ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjChatroom Class Reference
+ Inheritance diagram for ilObjChatroom:
+ Collaboration diagram for ilObjChatroom:

Public Member Functions

 __construct (int $a_id=0, bool $a_call_by_reference=true)
 
 getPersonalInformation (ilChatroomUser $user)
 
 initDefaultRoles ()
 
 cloneObject (int $target_id, int $copy_id=0, bool $omit_tree=false)
 
 delete ()
 
- Public Member Functions inherited from ilObject
 getObjectProperties ()
 
 flushObjectProperties ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $description)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static _getPublicRefId ()
 
static _getPublicObjId ()
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId (string $import_id)
 Get (latest) object id for an import id. More...
 
static _lookupImportId (int $obj_id)
 
static _lookupOwnerName (int $owner_id)
 Lookup owner name for owner id. More...
 
static _getIdForImportId (string $import_id)
 
static _getAllReferences (int $id)
 get all reference ids for object ID More...
 
static _lookupTitle (int $obj_id)
 
static lookupOfflineStatus (int $obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner (int $obj_id)
 Lookup owner user ID for object ID. More...
 
static _getIdsForTitle (string $title, string $type='', bool $partial_match=false)
 
static _lookupDescription (int $obj_id)
 
static _lookupLastUpdate (int $obj_id, bool $formatted=false)
 
static _getLastUpdateOfObjects (array $obj_ids)
 
static _lookupObjId (int $ref_id)
 
static _setDeletedDate (int $ref_id, int $deleted_by)
 
static setDeletedDates (array $ref_ids, int $user_id)
 
static _resetDeletedDate (int $ref_id)
 
static _lookupDeletedDate (int $ref_id)
 
static _writeTitle (int $obj_id, string $title)
 write title to db (static) More...
 
static _writeDescription (int $obj_id, string $desc)
 write description to db (static) More...
 
static _writeImportId (int $obj_id, string $import_id)
 write import id to db (static) More...
 
static _lookupType (int $id, bool $reference=false)
 
static _isInTrash (int $ref_id)
 
static _hasUntrashedReference (int $obj_id)
 checks whether an object has at least one reference that is not in trash More...
 
static _lookupObjectId (int $ref_id)
 
static _getObjectsDataForType (string $type, bool $omit_trash=false)
 get all objects of a certain type More...
 
static _exists (int $id, bool $reference=false, ?string $type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType (string $obj_type="", ?int $owner=null)
 
static _prepareCloneSelection (array $ref_ids, string $new_type, bool $show_path=true)
 Prepare copy wizard object selection. More...
 
static getIconForType (string $type)
 
static _getIcon (int $obj_id=0, string $size="big", string $type="", bool $offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies (int $obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $obj_ids)
 
static getAllOwnedRepositoryObjects (int $user_id)
 
static fixMissingTitles ($type, array &$obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate (int $obj_id)
 
static _getObjectTypeIdByTitle (string $type, ?\ilDBInterface $ilDB=null)
 

Protected Member Functions

 createDefaultRole ()
 
- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 

Additional Inherited Members

- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 
const DESC_LENGTH = 128
 
const LONG_DESC_LENGTH = 4000
 
const TABLE_OBJECT_DATA = "object_data"
 
array $objectList
 
string $untranslatedTitle
 
- Protected Attributes inherited from ilObject
ilLogger $obj_log
 
ILIAS $ilias
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilLogger $log
 
ilErrorHandling $error
 
ilTree $tree
 
ilAppEventHandler $app_event_handler
 
ilRbacAdmin $rbac_admin
 
ilRbacReview $rbac_review
 
ilObjUser $user
 
ilLanguage $lng
 
LOMServices $lom_services
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Detailed Description

Definition at line 21 of file class.ilObjChatroom.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjChatroom::__construct ( int  $a_id = 0,
bool  $a_call_by_reference = true 
)

Definition at line 23 of file class.ilObjChatroom.php.

References ILIAS\GlobalScreen\Provider\__construct().

24  {
25  $this->type = 'chtr';
26  parent::__construct($a_id, $a_call_by_reference);
27  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _getPublicObjId()

static ilObjChatroom::_getPublicObjId ( )
static

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

References $DIC.

Referenced by ilObjChatroomListGUI\__construct().

36  : int
37  {
38  global $DIC;
39 
40  $rset = $DIC->database()->query(
41  'SELECT object_id FROM chatroom_settings WHERE room_type = ' . $DIC->database()->quote('default', 'text')
42  );
43  if ($row = $DIC->database()->fetchAssoc($rset)) {
44  return (int) $row['object_id'];
45  }
46 
47  return 0;
48  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ _getPublicRefId()

static ilObjChatroom::_getPublicRefId ( )
static

Definition at line 29 of file class.ilObjChatroom.php.

Referenced by ilChatUserActionProvider\__construct(), ilChatroom\checkPermissions(), ilChatroomAdminViewGUI\forcePublicRoom(), and ILIAS\GlobalScreen\Provider\Provider\ChatMainBarProvider\getStaticSubItems().

29  : int
30  {
31  $settings = new ilSetting('chatroom');
32 
33  return (int) $settings->get('public_room_ref', '0');
34  }
+ Here is the caller graph for this function:

◆ cloneObject()

ilObjChatroom::cloneObject ( int  $target_id,
int  $copy_id = 0,
bool  $omit_tree = false 
)

Definition at line 74 of file class.ilObjChatroom.php.

References $objId, ilRbacLog\add(), ilChatroom\byObjectId(), ilRbacLog\CREATE_OBJECT, ilRbacLog\gatherFaPa(), ilChatroomAdmin\getDefaultConfiguration(), and ilObject\getId().

74  : ?ilObject
75  {
76  $original_room = ilChatroom::byObjectId($this->getId());
77 
78  $newObj = parent::cloneObject($target_id, $copy_id, $omit_tree);
79 
80  $objId = $newObj->getId();
81 
82  $original_settings = $original_room->getSettings();
83  $room = new ilChatroom();
84 
85  $original_settings['object_id'] = $objId;
86 
87  $room->saveSettings($original_settings);
88 
89  $rbac_log_roles = $this->rbac_review->getParentRoleIds($newObj->getRefId(), false);
90  $rbac_log = ilRbacLog::gatherFaPa($newObj->getRefId(), array_keys($rbac_log_roles), true);
91  ilRbacLog::add(ilRbacLog::CREATE_OBJECT, $newObj->getRefId(), $rbac_log);
92 
93  $settings = ilChatroomAdmin::getDefaultConfiguration()->getServerSettings();
94  $connector = new ilChatroomServerConnector($settings);
95 
96  $connector->sendCreatePrivateRoom($room->getRoomId(), $newObj->getOwner(), $newObj->getTitle());
97 
98  return $newObj;
99  }
static getDefaultConfiguration()
Instantiates and returns ilChatroomAdmin object using instance_id and settings from settingsTable...
$objId
Definition: xapitoken.php:57
static gatherFaPa(int $ref_id, array $role_ids, bool $add_action=false)
const CREATE_OBJECT
Class ilChatroomServerConnector.
static add(int $action, int $ref_id, array $diff, bool $source_ref_id=false)
static byObjectId(int $object_id)
+ Here is the call graph for this function:

◆ createDefaultRole()

ilObjChatroom::createDefaultRole ( )
protected

Definition at line 64 of file class.ilObjChatroom.php.

References ilObjRole\createDefaultRole(), ilObject\getId(), and ilObject\getRefId().

Referenced by initDefaultRoles().

64  : ilObjRole
65  {
67  'il_chat_moderator_' . $this->getRefId(),
68  'Moderator of chat obj_no.' . $this->getId(),
69  'il_chat_moderator',
70  $this->getRefId()
71  );
72  }
Class ilObjRole.
static createDefaultRole(string $a_title, string $a_description, string $a_tpl_name, int $a_ref_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilObjChatroom::delete ( )

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

References ilObject\getId().

101  : bool
102  {
103  $this->db->manipulateF(
104  'DELETE FROM chatroom_users WHERE chatroom_users.room_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
105  ['integer'],
106  [$this->getId()]
107  );
108 
109  $this->db->manipulateF(
110  'DELETE FROM chatroom_history WHERE chatroom_history.room_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
111  ['integer'],
112  [$this->getId()]
113  );
114 
115  $this->db->manipulateF(
116  'DELETE FROM chatroom_bans WHERE chatroom_bans.room_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
117  ['integer'],
118  [$this->getId()]
119  );
120 
121  $this->db->manipulateF(
122  'DELETE FROM chatroom_sessions WHERE chatroom_sessions.room_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
123  ['integer'],
124  [$this->getId()]
125  );
126 
127  // Finally delete rooms
128  $this->db->manipulateF(
129  'DELETE FROM chatroom_settings WHERE object_id = %s',
130  ['integer'],
131  [$this->getId()]
132  );
133 
134  return parent::delete();
135  }
+ Here is the call graph for this function:

◆ getPersonalInformation()

ilObjChatroom::getPersonalInformation ( ilChatroomUser  $user)

Definition at line 50 of file class.ilObjChatroom.php.

References ilChatroomUser\getUserId(), and ilChatroomUser\getUsername().

50  : stdClass
51  {
52  $userInfo = new stdClass();
53  $userInfo->username = $user->getUsername();
54  $userInfo->id = $user->getUserId();
55 
56  return $userInfo;
57  }
getUserId()
Returns Ilias User ID.
getUsername()
Returns username from Object or SESSION.
+ Here is the call graph for this function:

◆ initDefaultRoles()

ilObjChatroom::initDefaultRoles ( )

Definition at line 59 of file class.ilObjChatroom.php.

References createDefaultRole().

59  : void
60  {
61  $this->createDefaultRole();
62  }
+ Here is the call graph for this function:

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