5 require_once
"./classes/class.ilObjectGUI.php";
6 require_once
"./Modules/Chatroom/classes/class.ilObjChatroom.php";
7 require_once
"./Modules/Chatroom/classes/class.ilChatroom.php";
8 require_once
"./Modules/Chatroom/classes/class.ilObjChatroomAccess.php";
9 require_once
'Modules/Chatroom/lib/DatabayHelper/databayHelperLoader.php';
35 public function __construct($a_data = null, $a_id = null, $a_call_by_reference =
true)
37 if (in_array(
$_REQUEST[
'cmd'], array(
'getOSDNotifications',
'removeOSDNotifications'))) {
38 require_once
'Services/Notifications/classes/class.ilNotificationGUI.php';
40 $notifications->{
$_REQUEST[
'cmd'] .
'Object'}();
47 if(
$_GET[
'serverInquiry'] )
49 require_once dirname( __FILE__ ) .
'/class.ilChatroomServerHandler.php';
57 $this->
ilObjectGUI( $a_data, $a_id, $a_call_by_reference,
false );
58 $this->lng->loadLanguageModule(
'chatroom' );
59 $this->lng->loadLanguageModule(
'chatroom_adm' );
68 protected function getObjectDefinition()
78 public function _forwards()
88 public function executeCommand()
90 global $ilAccess, $ilNavigationHistory,
$ilCtrl;
92 if (
'cancel' == $ilCtrl->getCmd() && $this->getCreationMode()) {
93 parent::cancelCreation();
98 if(!$this->getCreationMode() && $ilAccess->checkAccess(
'read',
'',
$_GET[
'ref_id']))
100 $ilNavigationHistory->addItem(
$_GET[
'ref_id'],
'./goto.php?target=' . $this->type .
'_' .
$_GET[
'ref_id'], $this->type);
103 $next_class = $ilCtrl->getNextClass();
105 require_once
'Modules/Chatroom/classes/class.ilChatroomTabFactory.php';
106 if (!$this->getCreationMode()) {
109 if(strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui") {
110 $tabFactory->getAdminTabsForCommand( $ilCtrl->getCmd() );
113 $tabFactory->getTabsForCommand( $ilCtrl->getCmd() );
118 if($next_class ==
"ilinfoscreengui" && $ilCtrl->getCmd() !=
"info")
120 $ilCtrl->setCmd(
"info-".$ilCtrl->getCmd());
123 if($ilCtrl->getCmd() ==
"infoScreen")
125 $ilCtrl->setCmdClass(
"ilinfoscreengui");
126 $ilCtrl->setCmd(
"info");
131 case 'ilpermissiongui':
132 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
133 $this->prepareOutput();
135 $ret = & $this->ctrl->forwardCommand( $perm_gui );
137 case 'ilobjectcopygui':
138 $this->prepareOutput();
139 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
141 $cp->setType(
'chtr');
142 $this->ctrl->forwardCommand($cp);
147 $res = split(
'-', $ilCtrl->getCmd(), 2 );
154 'reason' => $e->getMessage()
156 echo json_encode($error);
168 public function getConnector()
170 require_once
'Modules/Chatroom/classes/class.ilChatroomServerConnector.php';
171 require_once
'Modules/Chatroom/classes/class.ilChatroomServerSettings.php';
172 require_once
'Modules/Chatroom/classes/class.ilChatroomAdmin.php';
186 public function fallback()
188 $this->prepareOutput();
189 $this->tpl->setVariable(
'ADM_CONTENT', $this->lng->txt(
'invalid_operation' ) );
195 public function settings()
197 $this->prepareOutput();
212 public function insertObject()
214 global $rbacsystem, $objDefinition, $rbacreview;
216 $new_type = $this->type;
220 if( !$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"], $new_type ) )
222 $this->ilias->raiseError(
223 $this->lng->txt(
"no_create_permission" ),
224 $this->ilias->error_obj->MESSAGE
228 $location = $objDefinition->getLocation( $new_type );
231 $class_name =
"ilObj" . $objDefinition->getClassName( $new_type );
232 include_once(
$location .
"/class." . $class_name .
".php");
234 $newObj =
new $class_name();
235 $newObj->setType( $new_type );
239 $newObj->createReference();
240 $newObj->putInTree(
$_GET[
"ref_id"] );
241 $newObj->setPermissions(
$_GET[
"ref_id"] );
243 $objId = $newObj->getId();
249 'object_id' => $objId,
250 'autogen_usernames' =>
'Autogen #',
251 'display_past_msgs' => 20,
252 'private_rooms_enabled' => 0
256 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
257 $rbac_log_roles = $rbacreview->getParentRoleIds( $newObj->getRefId(), false );
261 $this->
object = $newObj;
271 public function getRefId()
273 return $this->
object->getRefId();
283 public static function _goto($params)
292 $parts = explode(
'_', $params);
296 if($ilAccess->checkAccess(
'read',
'',
$ref_id))
298 $_GET[
'cmd'] =
'view';
304 require
'repository.php';
307 else if($ilAccess->checkAccess(
'read',
'', ROOT_FOLDER_ID))
309 $_GET[
'target'] =
'';
310 $_GET[
'ref_id'] = ROOT_FOLDER_ID;
312 include
'repository.php';
319 protected function initCreationForms($a_new_type)
321 $forms = parent::initCreationForms($a_new_type);
323 unset($forms[self::CFORM_IMPORT]);
326 $forms[self::CFORM_NEW]->clearCommandButtons();
327 $forms[self::CFORM_NEW]->addCommandButton(
"create-save", $this->lng->txt($a_new_type.
"_add"));
328 $forms[self::CFORM_NEW]->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
332 function addLocatorItems()
336 if (is_object($this->
object))
338 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"view"),
"", $this->getRefId());