ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjChatroomListGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once "Services/Object/classes/class.ilObjectListGUI.php";
6 
16 {
17 
18  private static $publicRoomObjId;
19 
25  public function __construct()
26  {
27  $this->ilObjectListGUI();
28 
29  require_once 'Modules/Chatroom/classes/class.ilObjChatroom.php';
30 
31  self::$publicRoomObjId = ilObjChatroom::_getPublicObjId();
32  }
33 
37  public function init()
38  {
39  $this->delete_enabled = true;
40  $this->cut_enabled = true;
41  $this->copy_enabled = true;
42  $this->subscribe_enabled = true;
43  $this->link_enabled = true;
44  $this->payment_enabled = true;
45  $this->info_screen_enabled = true;
46  $this->type = "chtr";
47  $this->gui_class_name = "ilobjchatroomgui";
48 
49  // general commands array
50  include_once('./Modules/Chatroom/classes/class.ilObjChatroomAccess.php');
51  $this->commands = ilObjChatroomAccess::_getCommands();
52  }
53 
54  private static $chat_enabled = null;
55 
64  public function getProperties()
65  {
69  global $lng;
70 
71  $props = array();
72 
73  require_once 'Modules/Chatroom/classes/class.ilChatroom.php';
74  $room = ilChatroom::byObjectId($this->obj_id);
75  if($room)
76  {
77  $props[] = array(
78  "alert" => false, "property" => $lng->txt("chat_users_active"),
79  "value" => $room->countActiveUsers()
80  );
81 
82  if($this->obj_id == self::$publicRoomObjId)
83  {
84  $props[] = array("alert" => false, "property" => $lng->txt("notice"), 'value' => $lng->txt('public_room'));
85  }
86 
87  if(self::$chat_enabled === null)
88  {
89  $chatSetting = new ilSetting('chatroom');
90  self::$chat_enabled = (boolean)$chatSetting->get('chat_enabled');
91  }
92 
93  if(!self::$chat_enabled)
94  {
95  $props[] = array("alert" => true, "property" => $lng->txt("status"), 'value' => $lng->txt("server_disabled"));
96  }
97  }
98 
99  return $props;
100  }
101 
109  /*
110  function getCommandLink($a_cmd)
111  {
112  // separate method for this line
113  $cmd_link = "repo.php?ref_id=".$this->ref_id."&cmd=$a_cmd";
114 
115  return $cmd_link;
116  } */
117 
124  public function getCommandImage($a_cmd)
125  {
126  switch ($a_cmd)
127  {
128  case "versions":
129  return ilUtil::getImagePath("cmd_versions_s.png");
130 
131  default:
132  return "";
133  }
134  }
135 
136 }
137 
138 ?>