ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilObjChatroomListGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Services/Object/classes/class.ilObjectListGUI.php';
5
13{
17 private static $publicRoomObjId;
18
22 private static $chat_enabled = null;
23
27 public function __construct($a_context = self::CONTEXT_REPOSITORY)
28 {
29 parent::__construct($a_context);
30
31 require_once 'Modules/Chatroom/classes/class.ilObjChatroom.php';
32
33 self::$publicRoomObjId = ilObjChatroom::_getPublicObjId();
34 }
35
39 public function init()
40 {
41 $this->delete_enabled = true;
42 $this->cut_enabled = true;
43 $this->copy_enabled = true;
44 $this->subscribe_enabled = true;
45 $this->link_enabled = true;
46 $this->info_screen_enabled = true;
47 $this->type = 'chtr';
48 $this->gui_class_name = 'ilobjchatroomgui';
49
50 require_once 'Modules/Chatroom/classes/class.ilObjChatroomAccess.php';
51 $this->commands = ilObjChatroomAccess::_getCommands();
52 }
53
57 public function getProperties()
58 {
62 global $lng;
63
64 $props = array();
65
66 require_once 'Modules/Chatroom/classes/class.ilChatroom.php';
67 $room = ilChatroom::byObjectId($this->obj_id);
68 if($room)
69 {
70 $props[] = array(
71 'alert' => false, 'property' => $lng->txt('chat_users_active'),
72 'value' => $room->countActiveUsers()
73 );
74
75 if($this->obj_id == self::$publicRoomObjId)
76 {
77 $props[] = array('alert' => false, 'property' => $lng->txt('notice'), 'value' => $lng->txt('public_room'));
78 }
79
80 if(self::$chat_enabled === null)
81 {
82 $chatSetting = new ilSetting('chatroom');
83 self::$chat_enabled = (boolean)$chatSetting->get('chat_enabled');
84 }
85
86 if(!self::$chat_enabled)
87 {
88 $props[] = array('alert' => true, 'property' => $lng->txt('status'), 'value' => $lng->txt('server_disabled'));
89 }
90 }
91
92 return $props;
93 }
94}
An exception for terminatinating execution or to throw for unit testing.
static byObjectId($object_id)
Returns ilChatroom object by given $object_id.
static _getCommands()
{get commandsthis method returns an array of all possible commands/permission combinationsexample: ...
Class ilObjChatlistListGUI.
init()
{initialisationthis method should be overwritten by derived classes}
__construct($a_context=self::CONTEXT_REPOSITORY)
{constructor}
Class ilObjectListGUI.
getProperties()
Get item properties.
ILIAS Setting Class.
global $lng
Definition: privfeed.php:17