4 require_once
'Services/Object/classes/class.ilObject2GUI.php';
5 require_once
'Services/Contact/BuddySystem/classes/class.ilBuddySystem.php';
38 public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
43 $this->rbacsystem = $this->dic->rbac()->system();
44 $this->lng = $this->dic->language();
47 $this->lng->loadLanguageModule(
'buddysystem');
64 $this->tabs_gui->addTarget(
'settings', $this->ctrl->getLinkTarget($this,
'showConfigurationForm'), array(
'',
'view',
'showConfigurationForm',
'saveConfigurationForm'), __CLASS__);
68 $this->tabs_gui->addTarget(
'perm_settings', $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
'perm'), array(
'perm',
'info',
'owner'),
'ilpermissiongui');
77 $next_class = $this->ctrl->getNextClass($this);
78 $cmd = $this->ctrl->getCmd();
81 switch ($next_class) {
82 case 'ilpermissiongui':
83 require_once
'Services/AccessControl/classes/class.ilPermissionGUI.php';
85 $this->ctrl->forwardCommand($perm_gui);
89 if ($cmd ==
'' || $cmd ==
'view') {
90 $cmd =
'showConfigurationForm';
102 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
104 $form->setTitle($this->lng->txt(
'settings'));
105 $form->setFormAction($this->ctrl->getFormAction($this,
'saveConfigurationForm'));
109 $enabled->setInfo($this->lng->txt(
'buddy_enable_info'));
114 $notification->setInfo($this->lng->txt(
'buddy_use_osd_info'));
116 $enabled->addSubItem($notification);
118 $form->addItem($enabled);
121 $form->addCommandButton(
'saveConfigurationForm', $this->lng->txt(
'save'));
132 if (!$this->rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
133 $this->error->raiseError($this->lng->txt(
"no_permission"), $this->error->WARNING);
137 require_once
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
141 $form->setValuesByArray(array(
143 'use_osd' => isset($cfg[
'buddysystem_request']) && array_search(
'osd', $cfg[
'buddysystem_request']) !==
false 147 $this->tpl->setContent($form->getHTML());
158 if (!$form->checkInput()) {
159 $form->setValuesByPost();
166 require_once
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
170 foreach ($cfg as
$type => $channels) {
171 $new_cfg[
$type] = array();
172 foreach ($channels as $channel) {
173 $new_cfg[
$type][$channel] =
true;
177 if (!isset($new_cfg[
'buddysystem_request']) || !is_array($new_cfg[
'buddysystem_request'])) {
178 $new_cfg[
'buddysystem_request'] = array();
181 if ((
bool) $form->getInput(
'use_osd') && !array_key_exists(
'osd', $new_cfg[
'buddysystem_request'])) {
182 $new_cfg[
'buddysystem_request'][
'osd'] =
true;
183 } elseif (!(
bool) $form->getInput(
'use_osd') && array_key_exists(
'osd', $new_cfg[
'buddysystem_request'])) {
184 $new_cfg[
'buddysystem_request'][
'osd'] =
false;
189 ilUtil::sendSuccess($this->lng->txt(
'saved_successfully'),
true);
190 $this->ctrl->redirect($this);
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
New implementation of ilObjectGUI.
__construct(Container $dic, ilPlugin $plugin)
static setUserConfig($userid, array $configArray)
Sets the configuration for all given configurations.
prepareOutput($a_show_subobjects=true)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static loadUserConfig($userid)