49 $tokens = (
array)explode(
'_', $value);
52 foreach($tokens as $token)
54 $value .= ucfirst($token);
57 if($upper_case_first === FALSE)
59 $value = strtolower($value, 0, 1) . substr($value, 1);
70 public function getAdminTabsForCommand($command)
79 $stopCommands =
array(
'create');
81 if(in_array($command, $stopCommands))
87 $public_room_ref = $settings->get(
'public_room_ref');
90 $firstObjId = current(array_keys($objIds));
92 $admin_ref = current($refIds);
94 $ilCtrl->setParameterByClass(
'ilObjChatroomAdminGUI',
'ref_id', $admin_ref);
99 'link' => $ilCtrl->getLinkTargetByClass(
'ilObjChatroomAdminGUI',
'view-clientsettings'),
100 'permission' =>
'read',
102 'clientsettings' =>
array(
103 'lng' =>
'client_settings',
104 'link' => $ilCtrl->getLinkTargetByClass(
'ilObjChatroomAdminGUI',
'view-clientsettings'),
105 'permission' =>
'read' 107 'serversettings' =>
array(
108 'lng' =>
'server_settings',
109 'link' => $ilCtrl->getLinkTargetByClass(
'ilObjChatroomAdminGUI',
'view-serversettings'),
110 'permission' =>
'read' 116 'link' => $ilCtrl->getLinkTargetByClass(
'ilObjChatroomAdminGUI',
'smiley'),
117 'permission' =>
'read' 120 $ilCtrl->setParameterByClass(
'ilObjChatroomGUI',
'ref_id', $public_room_ref);
123 'lng' =>
'public_chat_settings',
124 'link' => $ilCtrl->getLinkTargetByClass(
'ilObjChatroomGUI',
'settings-general'),
125 'permission' =>
'write',
129 'link' => $ilCtrl->getLinkTarget($this->gui,
'settings-general'),
130 'permission' =>
'write' 134 'link' => $ilCtrl->getLinkTargetByClass(
'ilObjChatroomGUI',
'ban-show'),
135 'permission' =>
'moderate' 140 $ilCtrl->setParameterByClass(
'ilPermissionGUI',
'ref_id', $public_room_ref);
142 'lng' =>
'public_chat_permissions',
143 'link' => $ilCtrl->getLinkTargetByClass(
'ilPermissionGUI',
'perm'),
144 'permission' =>
'write',
146 $ilCtrl->clearParametersByClass(
'ilPermissionGUI');
148 $ilCtrl->setParameterByClass(
'ilPermissionGUI',
'ref_id', $admin_ref);
150 'lng' =>
'perm_settings',
151 'link' => $ilCtrl->getLinkTargetByClass(
'ilpermissiongui',
'perm'),
152 'permission' =>
'write',
154 $ilCtrl->clearParametersByClass(
'ilPermissionGUI');
156 $commandParts = explode(
'_', $command, 2);
157 if($command ==
'ban_show')
159 $commandParts[0] =
'settings';
160 $commandParts[1] =
'ban';
162 else if($command ==
'settings_general')
164 $commandParts[0] =
'settings';
165 $commandParts[1] =
'settings';
167 else if($command ==
'view_savesettings')
169 $commandParts[0] =
'view';
170 $commandParts[1] =
'serversettings';
172 else if($command ==
'view_saveclientsettings')
174 $commandParts[0] =
'view';
175 $commandParts[1] =
'clientsettings';
177 else if($ilCtrl->getCmdClass() ==
'ilpermissiongui' && $_REQUEST[
'ref_id'] == $public_room_ref)
179 $commandParts[0] =
'perm';
180 $ilCtrl->setParameterByClass(
'ilPermissionGUI',
'ref_id', $public_room_ref);
182 else if($ilCtrl->getCmdClass() ==
'ilpermissiongui' && $_REQUEST[
'ref_id'] == $admin_ref)
184 $commandParts[0] =
'perm_settings';
185 $ilCtrl->setParameterByClass(
'ilPermissionGUI',
'ref_id', $admin_ref);
188 $this->buildTabs($ilTabs,
$config, $commandParts);
189 $this->activateTab($commandParts,
$config);
199 return strtolower(preg_replace(
'/(.*?)-(.*?)/',
'$1_$2', $value));
216 require_once
'Modules/Chatroom/classes/class.ilChatroom.php';
217 foreach(
$config as $id => $tabDefinition)
223 else if(isset($tabDefinition[
'enabled']) && !$tabDefinition[
'enabled'])
228 $tabs->
addTab($id, $this->
getLabel($tabDefinition, $id), $tabDefinition[
'link']);
230 if($command[0] == $id && isset($tabDefinition[
'subtabs']) &&
231 is_array($tabDefinition[
'subtabs'])
234 foreach($tabDefinition[
'subtabs'] as $subid => $subTabDefinition)
236 if(!$rbacsystem->checkAccess($subTabDefinition[
'permission'], $this->gui->getRefId()))
240 else if(isset($subTabDefinition[
'enabled']) && !$subTabDefinition[
'enabled'])
245 $subid, $this->
getLabel($subTabDefinition, $subid),
246 $subTabDefinition[
'link']
264 if(isset($tabDefinition[
'lng']))
265 return $this->lng->txt($tabDefinition[
'lng']);
267 return $this->lng->txt($id);
276 private function activateTab(
array $commandParts,
$config)
283 if(count($commandParts) > 1)
285 if(isset(
$config[$commandParts[0]]))
287 $ilTabs->activateTab($commandParts[0]);
289 if(isset(
$config[$commandParts[0]][
'subtabs'][$commandParts[1]]))
291 $ilTabs->activateSubTab($commandParts[1]);
295 else if(count($commandParts) == 1)
297 $ilTabs->activateTab($commandParts[0]);
306 public function getTabsForCommand($command)
315 $stopCommands =
array(
'create');
317 if(in_array($command, $stopCommands))
322 require_once
'Modules/Chatroom/classes/class.ilChatroom.php';
328 'link' => $ilCtrl->getLinkTarget($this->gui,
'view'),
329 'permission' =>
'read' 333 'link' => $ilCtrl->getLinkTarget($this->gui,
'history-byday'),
334 'permission' =>
'read',
335 'enabled' => $room ? $room->getSetting(
'enable_history') :
false,
338 'lng' =>
'history_by_day',
339 'link' => $ilCtrl->getLinkTarget($this->gui,
'history-byday'),
340 'permission' =>
'read' 342 'bysession' =>
array(
343 'lng' =>
'history_by_session',
344 'link' => $ilCtrl->getLinkTarget($this->gui,
'history-bysession'),
345 'permission' =>
'read' 350 'lng' =>
'info_short',
351 'link' => $ilCtrl->getLinkTargetByClass(
array(get_class($this->gui),
'ilinfoscreengui'),
'info'),
352 'permission' =>
'read' 356 'link' => $ilCtrl->getLinkTarget($this->gui,
'settings-general'),
357 'permission' =>
'write',
360 'lng' =>
'settings_general',
361 'link' => $ilCtrl->getLinkTarget($this->gui,
'settings-general'),
362 'permission' =>
'write' 368 'link' => $ilCtrl->getLinkTarget($this->gui,
'ban-show'),
369 'permission' =>
'moderate',
372 'lng' =>
'bans_table',
373 'link' => $ilCtrl->getLinkTarget($this->gui,
'ban-show'),
374 'permission' =>
'moderate' 379 'lng' =>
'permissions',
380 'link' => $ilCtrl->getLinkTargetByClass(
'ilpermissiongui',
'perm'),
381 'permission' =>
'write' 385 $commandParts = explode(
'_', $command, 2);
387 if($ilCtrl->getCmdClass() ==
'ilpermissiongui')
389 $commandParts[0] =
'perm';
392 $this->buildTabs($ilTabs, $config, $commandParts);
393 $this->activateTab($commandParts, $config);
getLabel($tabDefinition, $id)
Returns label for tab by $tabDefinition or $id.
static _getObjectsByType($a_obj_type="", $a_owner="")
Get objects by type.
static _getAllReferences($a_id)
get all reference ids of object
static checkUserPermissions($permissions, $ref_id, $send_info=true)
Checks user permissions by given array and ref_id.
Class ilObjectGUI Basic methods of all Output classes.
addSubTab($a_id, $a_text, $a_link, $a_frame="")
Add a Subtab.
Create styles array
The data for the language used.
Class ilChatroomTabGUIFactory.
static convertUnderscoreCaseToLowerCamelCaseConversion($value, $upper_case_first=FALSE)
Convert a value given in underscore case conversion to lower camel case conversion (e...
static convertLowerCamelCaseToUnderscoreCaseConversion($value)
Convert a value given in lower camel case conversion to underscore case conversion (e...
addTab($a_id, $a_text, $a_link, $a_frame="")
Add a Tab.
static byObjectId($object_id)
Returns ilChatroom object by given $object_id.