4 require_once
'Services/Object/classes/class.ilObjectGUI.php';
5 require_once
'Modules/Chatroom/classes/class.ilObjChatroom.php';
6 require_once
'Modules/Chatroom/classes/class.ilChatroom.php';
7 require_once
'Modules/Chatroom/classes/class.ilObjChatroomAccess.php';
8 require_once
'Modules/Chatroom/lib/DatabayHelper/databayHelperLoader.php';
27 public function __construct($a_data = null, $a_id = null, $a_call_by_reference =
true)
29 if(in_array(
$_REQUEST[
'cmd'], array(
'getOSDNotifications',
'removeOSDNotifications')))
31 require_once
'Services/Notifications/classes/class.ilNotificationGUI.php';
33 $notifications->{
$_REQUEST[
'cmd'] .
'Object'}();
39 if(
$_GET[
'serverInquiry'])
41 require_once dirname(__FILE__) .
'/class.ilChatroomServerHandler.php';
49 $this->lng->loadLanguageModule(
'chatroom');
50 $this->lng->loadLanguageModule(
'chatroom_adm');
58 protected function getObjectDefinition()
67 public function _forwards()
75 public function executeCommand()
83 global $ilNavigationHistory,
$ilCtrl, $ilHelp, $ilAccess;
85 if(
'cancel' == $ilCtrl->getCmd() && $this->getCreationMode())
87 parent::cancelCreation();
92 if(!$this->getCreationMode() && $ilAccess->checkAccess(
'read',
'', (
int)
$_GET[
'ref_id']))
94 $ilNavigationHistory->addItem($_GET[
'ref_id'],
'./goto.php?target=' . $this->type .
'_' . $_GET[
'ref_id'], $this->type);
97 $next_class = $ilCtrl->getNextClass();
99 require_once
'Modules/Chatroom/classes/class.ilChatroomTabFactory.php';
100 if(!$this->getCreationMode())
104 if(strtolower($_GET[
'baseClass']) ==
'iladministrationgui')
106 $tabFactory->getAdminTabsForCommand($ilCtrl->getCmd());
110 $ilHelp->setScreenIdComponent(
"chtr");
111 $tabFactory->getTabsForCommand($ilCtrl->getCmd());
116 if($next_class ==
'ilinfoscreengui' && $ilCtrl->getCmd() !=
'info')
118 $ilCtrl->setCmd(
'info-' . $ilCtrl->getCmd());
121 if($ilCtrl->getCmd() ==
'infoScreen')
123 $ilCtrl->setCmdClass(
'ilinfoscreengui');
124 $ilCtrl->setCmd(
'info');
129 case 'ilpermissiongui':
130 include_once
'Services/AccessControl/classes/class.ilPermissionGUI.php';
131 $this->prepareOutput();
133 $ilCtrl->forwardCommand($perm_gui);
135 case 'ilobjectcopygui':
136 $this->prepareOutput();
137 include_once
'Services/Object/classes/class.ilObjectCopyGUI.php';
139 $cp->setType(
'chtr');
140 $ilCtrl->forwardCommand($cp);
143 case "ilcommonactiondispatchergui":
144 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
146 $this->ctrl->forwardCommand($gui);
152 $res = explode(
'-', $ilCtrl->getCmd(), 2);
159 'reason' => $e->getMessage()
161 echo json_encode($error);
170 public function getConnector()
172 require_once
'Modules/Chatroom/classes/class.ilChatroomServerConnector.php';
173 require_once
'Modules/Chatroom/classes/class.ilChatroomServerSettings.php';
174 require_once
'Modules/Chatroom/classes/class.ilChatroomAdmin.php';
176 $settings = ilChatroomAdmin::getDefaultConfiguration()->getServerSettings();
185 public function fallback()
187 $this->prepareOutput();
188 $this->tpl->setVariable(
'ADM_CONTENT', $this->lng->txt(
'invalid_operation'));
194 public function settings()
196 $this->prepareOutput();
206 public function insertObject()
213 global $rbacsystem, $objDefinition, $rbacreview;
215 $new_type = $this->type;
219 if(!$rbacsystem->checkAccess(
'create', $_GET[
'ref_id'], $new_type))
221 $this->ilias->raiseError(
222 $this->lng->txt(
'no_create_permission'),
223 $this->ilias->error_obj->MESSAGE
227 $location = $objDefinition->getLocation($new_type);
230 $class_name =
'ilObj' . $objDefinition->getClassName($new_type);
231 include_once
$location .
'/class.' . $class_name .
'.php';
236 $newObj =
new $class_name();
237 $newObj->setType($new_type);
241 $newObj->createReference();
242 $newObj->putInTree($_GET[
'ref_id']);
243 $newObj->setPermissions($_GET[
'ref_id']);
245 $objId = $newObj->getId();
251 'object_id' => $objId,
252 'autogen_usernames' =>
'Autogen #',
253 'display_past_msgs' => 20,
254 'private_rooms_enabled' => 0
258 include_once
'Services/AccessControl/classes/class.ilRbacLog.php';
259 $rbac_log_roles = $rbacreview->getParentRoleIds($newObj->getRefId(),
false);
263 $this->
object = $newObj;
272 public function getRefId()
274 return $this->
object->getRefId();
281 public static function _goto($params)
290 $parts = explode(
'_', $params);
294 if($rbacsystem->checkAccess(
'read',
$ref_id))
298 $_REQUEST[
'sub'] = $_GET[
'sub'] = (int)$sub;
300 include_once
'Services/Object/classes/class.ilObjectGUI.php';
303 else if($rbacsystem->checkAccess(
'read', ROOT_FOLDER_ID))
306 include_once
'Services/Object/classes/class.ilObjectGUI.php';
317 protected function initCreationForms($a_new_type)
319 $forms = parent::initCreationForms($a_new_type);
321 unset($forms[self::CFORM_IMPORT]);
322 $forms[self::CFORM_NEW]->clearCommandButtons();
323 $forms[self::CFORM_NEW]->addCommandButton(
'create-save', $this->lng->txt($a_new_type .
'_add'));
324 $forms[self::CFORM_NEW]->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
328 function addLocatorItems()
335 if(is_object($this->
object))
337 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
'view'),
'', $this->getRefId());