5 include_once(
"Services/Block/classes/class.ilBlockGUI.php");
6 include_once
'./Services/PersonalDesktop/interfaces/interface.ilDesktopItemHandling.php';
36 $lng->loadLanguageModule(
'pd');
37 $lng->loadLanguageModule(
'cntr');
45 $this->allow_moving =
false;
47 $this->determineViewSettings();
60 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view', $this->view);
62 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view',
'');
72 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
75 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view', $this->view);
76 $ilCtrl->redirectByClass(
'ilpersonaldesktopgui',
'show');
86 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
89 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view', $this->view);
90 $ilCtrl->redirectByClass(
'ilpersonaldesktopgui',
'show');
96 public function changeView()
103 if(in_array((
int)
$_GET[
'view'], $this->allowed_views))
105 $view = (int)$_GET[
'view'];
109 reset($this->allowed_views);
110 $view = (int)current($this->allowed_views);
113 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view',
$view);
114 $ilCtrl->redirectByClass(
'ilpersonaldesktopgui',
'show');
120 protected function determineViewSettings()
128 $this->allowed_views = array();
131 if($ilSetting->get(
'disable_my_offers') == 1 &&
132 $ilSetting->get(
'disable_my_memberships') == 1)
135 $ilSetting->set(
'personal_items_default_view', self::VIEW_SELECTED_ITEMS);
139 else if($ilSetting->get(
'disable_my_offers') == 0 &&
140 $ilSetting->get(
'disable_my_memberships') == 0)
145 else if($ilSetting->get(
'disable_my_offers') == 0 &&
146 $ilSetting->get(
'disable_my_memberships') == 1)
155 $this->view = (int)$_GET[
'view'];
158 $_GET[
'view'] = $this->view = (int)$ilSetting->get(
'personal_items_default_view');
161 $ilCtrl->saveParameter($this,
'view');
180 $cmd = array_shift(array_keys(
$cmd));
185 case "confirmRemove":
209 $ilDB->useSlave(
true);
212 $this->
setData(array(
"dummy"));
214 include_once
"Services/Object/classes/class.ilObjectListGUI.php";
215 ilObjectListGUI::prepareJSLinks(
"",
216 $ilCtrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"ilnotegui"),
"",
"",
true,
false),
217 $ilCtrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false));
221 case self::VIEW_MY_MEMBERSHIPS:
223 if ($ilSetting->get(
'disable_my_offers') == 0)
225 $tpl->setTitle($lng->txt(
"my_courses_groups"));
227 $this->
setTitle($this->lng->txt(
'pd_my_memberships'));
231 case self::VIEW_SELECTED_ITEMS:
234 if(!in_array(self::VIEW_MY_MEMBERSHIPS, $this->allowed_views))
236 $this->
setTitle($this->lng->txt(
'selected_items'));
240 $this->
setTitle($this->lng->txt(
'pd_my_offers'));
251 $ilCtrl->clearParametersByClass(
"ilpersonaldesktopgui");
252 $ilCtrl->clearParameters($this);
254 $ilDB->useSlave(
false);
266 $next_class = $ilCtrl->getNextClass();
267 $cmd = $ilCtrl->getCmd(
"getHTML");
271 case "ilcommonactiondispatchergui":
272 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
274 $ilCtrl->forwardCommand($gui);
278 if(method_exists($this,
$cmd))
280 return $this->
$cmd();
285 return $this->
$cmd();
292 return $this->content;
297 $this->content = $a_content;
309 $this->tpl->setVariable(
"BLOCK_ROW", $this->
getContent());
327 $this->tpl->setVariable(
"FCOLSPAN", $this->
getColSpan());
328 if ($this->tpl->blockExists(
"block_footer"))
330 $this->tpl->setCurrentBlock(
"block_footer");
331 $this->tpl->parseCurrentBlock();
357 $ilCtrl->getLinkTarget($this,
"orderPDItemsByType"),
358 $ilCtrl->getLinkTarget($this,
"orderPDItemsByType",
"",
true),
360 false,
false, ($ilUser->getPref(
"pd_order_items") !=
'location')
376 $ilCtrl->getLinkTarget($this,
"orderPDItemsByLocation"),
377 $ilCtrl->getLinkTarget($this,
"orderPDItemsByLocation",
"",
true),
379 false,
false, ($ilUser->getPref(
"pd_order_items") ==
'location')
383 $this->
addFooterLink(($this->view == self::VIEW_SELECTED_ITEMS) ?
384 $lng->txt(
"pd_remove_multiple") :
385 $lng->txt(
"pd_unsubscribe_multiple_memberships"),
386 $ilCtrl->getLinkTarget($this,
"manage"),
400 global $tree,
$ilUser, $ilObjDataCache;
402 include_once
'Services/Membership/classes/class.ilParticipants.php';
405 if(is_array($types) && count($types))
407 foreach($types as $type)
426 $items = array_merge($crs_mbs, $grp_mbs);
429 $references = array();
430 foreach($items as $key => $obj_id)
433 foreach($item_references as
$ref_id)
435 if($tree->isInTree($ref_id))
437 $title = $ilObjDataCache->lookupTitle($obj_id);
438 $type = $ilObjDataCache->lookupType($obj_id);
440 $parent_ref_id = $tree->getParentId($ref_id);
441 $par_left = $tree->getLeftValue($parent_ref_id);
442 $par_left = sprintf(
"%010d", $par_left);
444 $references[$par_left . $title .
$ref_id] = array(
449 'description' => $ilObjDataCache->lookupDescription($obj_id),
450 'parent_ref' => $parent_ref_id
456 return is_array($references) ? $references : array();
471 $item_html = array();
472 if(count($items) > 0)
474 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
476 foreach($items as $item)
478 $preloader->addItem($item[
"obj_id"], $item[
"type"], $item[
"ref_id"]);
480 $preloader->preload();
484 foreach($items as $item)
488 if ($cur_obj_type != $item[
"type"])
497 $item_list_gui->enableNotes(
false);
498 $item_list_gui->enableComments(
false);
499 $item_list_gui->enableTags(
false);
501 $item_list_gui->enableIcon(
true);
502 $item_list_gui->enableDelete(
false);
503 $item_list_gui->enableCut(
false);
504 $item_list_gui->enableCopy(
false);
505 $item_list_gui->enablePayment(
false);
506 $item_list_gui->enableLink(
false);
507 $item_list_gui->enableInfoScreen(
true);
508 if ($ilSetting->get(
'disable_my_offers') == 1)
510 $item_list_gui->enableSubscribe(
false);
514 $item_list_gui->enableSubscribe(
true);
516 $item_list_gui->setContainerObject($this);
520 $item_list_gui->enableDescription(
false);
521 $item_list_gui->enableProperties(
false);
522 $item_list_gui->enablePreconditions(
false);
526 $item_list_gui->enableCommands(
true,
true);
530 $ilBench->start(
"ilPersonalDesktopGUI",
"getListHTML");
532 if (is_object($item_list_gui))
539 if(!$rbacsystem->checkAccess(
"leave", $item[
"ref_id"]))
541 $item_list_gui->enableCheckbox(
false);
545 $item_list_gui->enableCheckbox(
true);
549 $html = $item_list_gui->getListItemHTML($item[
"ref_id"],
550 $item[
"obj_id"], $item[
"title"], $item[
"description"]);
551 $ilBench->stop(
"ilPersonalDesktopGUI",
"getListHTML");
555 $item_html[] = array(
557 "item_ref_id" => $item[
"ref_id"],
558 "item_obj_id" => $item[
"obj_id"],
559 "parent_ref" => $item[
"parent_ref"],
560 "type" => $item[
"type"],
561 'item_icon_image_type' => $item_list_gui->getIconImageType()
569 if (count($item_html) > 0)
574 foreach($item_html as $item)
577 if ($cur_parent_ref != $item[
"parent_ref"])
579 if ($ilSetting->get(
"icon_position_in_lists") ==
"item_rows")
588 $cur_parent_ref = $item[
"parent_ref"];
592 $this->
addStandardRow(
$tpl, $item[
"html"], $item[
"item_ref_id"], $item[
"item_obj_id"],
593 $item[
'item_icon_image_type'],
594 "th_".$cur_parent_ref);
616 $objtype_groups = $objDefinition->getGroupedRepositoryObjectTypes(
617 array(
"cat",
"crs",
"grp",
"fold"));
620 foreach($objtype_groups as $grp => $grpdata)
624 "title" => $this->lng->txt(
"objs_".$grp),
625 "types" => $grpdata[
"objs"]);
628 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
630 foreach ($types as
$t)
633 $title = $t[
"title"];
638 if (count($items) > 0)
641 foreach($items as $item)
643 $preloader->addItem($item[
"obj_id"], $item[
"type"], $item[
"ref_id"]);
645 $preloader->preload();
651 $item_html = array();
655 $rel_header =
"th_".$grp;
664 if (strcmp($a_type,
"tst") == 0) {
665 $items = $this->multiarray_sort($items,
"used_tries; title");
666 foreach ($items as $tst_item) {
667 if (!isset($tst_item[
"used_tries"])) {
670 elseif ($tst_item[
"used_tries"] == 0) {
676 foreach($items as $item)
679 if ($cur_obj_type != $item[
"type"])
681 $class = $objDefinition->getClassName($item[
"type"]);
682 $location = $objDefinition->getLocation($item[
"type"]);
683 $full_class =
"ilObj".$class.
"ListGUI";
684 include_once(
$location.
"/class.".$full_class.
".php");
685 $item_list_gui =
new $full_class();
688 $item_list_gui->enableNotes(
false);
689 $item_list_gui->enableComments(
false);
690 $item_list_gui->enableTags(
false);
692 $item_list_gui->enableIcon(
true);
693 $item_list_gui->enableDelete(
false);
694 $item_list_gui->enableCut(
false);
695 $item_list_gui->enableCopy(
false);
696 $item_list_gui->enablePayment(
false);
697 $item_list_gui->enableLink(
false);
698 $item_list_gui->enableInfoScreen(
true);
699 if ($ilSetting->get(
'disable_my_offers') == 1)
701 $item_list_gui->enableSubscribe(
false);
705 $item_list_gui->enableSubscribe(
true);
708 $item_list_gui->setContainerObject($this);
711 $item_list_gui->enableCheckbox(
true);
715 $item_list_gui->enableDescription(
false);
716 $item_list_gui->enableProperties(
false);
717 $item_list_gui->enablePreconditions(
false);
718 $item_list_gui->enableNoticeProperties(
false);
722 $item_list_gui->enableCommands(
true,
true);
726 $ilBench->start(
"ilPersonalDesktopGUI",
"getListHTML");
733 if(!$rbacsystem->checkAccess(
"leave", $item[
"ref_id"]))
735 $item_list_gui->enableCheckbox(
false);
739 $item_list_gui->enableCheckbox(
true);
743 $html = $item_list_gui->getListItemHTML($item[
"ref_id"],
744 $item[
"obj_id"], $item[
"title"], $item[
"description"]);
745 $ilBench->stop(
"ilPersonalDesktopGUI",
"getListHTML");
749 $item_html[] = array(
751 "item_ref_id" => $item[
"ref_id"],
752 "item_obj_id" => $item[
"obj_id"],
753 'item_icon_image_type' => (method_exists($item_list_gui,
'getIconImageType')) ?
754 $item_list_gui->getIconImageType() :
762 if (count($item_html) > 0)
767 if ($ilSetting->get(
"icon_position_in_lists") ==
"item_rows")
779 foreach($item_html as $item)
782 $ilSetting->get(
"icon_position_in_lists") ==
"item_rows")
785 $this->
addStandardRow(
$tpl, $item[
"html"], $item[
"item_ref_id"], $item[
"item_obj_id"],
786 $item[
'item_icon_image_type'],
792 $this->
addStandardRow(
$tpl, $item[
"html"], $item[
"item_ref_id"], $item[
"item_obj_id"],
"", $rel_header);
815 switch($ilUser->getPref(
'pd_order_items'))
838 switch ($ilUser->getPref(
"pd_order_items"))
852 $tpl->setCurrentBlock(
"select_all_row");
853 $tpl->setVariable(
"CHECKBOXNAME",
"ilToolbarSelectAll");
854 $tpl->setVariable(
"SEL_ALL_PARENT",
"ilToolbar");
855 $tpl->setVariable(
"SEL_ALL_CB_NAME",
"id");
856 $tpl->setVariable(
"TXT_SELECT_ALL", $this->lng->txt(
"select_all"));
857 $tpl->parseCurrentBlock();
870 $items = $ilUser->getDesktopItems();
871 if (count($items) > 0)
873 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
875 foreach($items as $item)
877 $preloader->addItem($item[
"obj_id"], $item[
"type"], $item[
"ref_id"]);
879 $preloader->preload();
887 $objtype_groups = $objDefinition->getGroupedRepositoryObjectTypes(
888 array(
"cat",
"crs",
"grp",
"fold"));
891 foreach($objtype_groups as $grp => $grpdata)
895 "title" => $this->lng->txt(
"objs_".$grp),
896 "types" => $grpdata[
"objs"]);
899 foreach ($types as
$t)
903 $title = $t[
"title"];
906 $items = $ilUser->getDesktopItems($type);
907 $item_html = array();
911 $rel_header =
"th_".$grp;
914 if (count($items) > 0)
922 if (strcmp($a_type,
"tst") == 0) {
923 $items = $this->multiarray_sort($items,
"used_tries; title");
924 foreach ($items as $tst_item) {
925 if (!isset($tst_item[
"used_tries"])) {
928 elseif ($tst_item[
"used_tries"] == 0) {
934 foreach($items as $item)
937 if ($cur_obj_type != $item[
"type"])
939 $class = $objDefinition->getClassName($item[
"type"]);
940 $location = $objDefinition->getLocation($item[
"type"]);
941 $full_class =
"ilObj".$class.
"ListGUI";
942 include_once(
$location.
"/class.".$full_class.
".php");
943 $item_list_gui =
new $full_class();
946 $item_list_gui->enableNotes(
false);
947 $item_list_gui->enableComments(
false);
948 $item_list_gui->enableTags(
false);
950 $item_list_gui->enableIcon(
true);
951 $item_list_gui->enableDelete(
false);
952 $item_list_gui->enableCut(
false);
953 $item_list_gui->enableCopy(
false);
954 $item_list_gui->enablePayment(
false);
955 $item_list_gui->enableLink(
false);
956 $item_list_gui->enableInfoScreen(
true);
957 $item_list_gui->setContainerObject($this);
961 $item_list_gui->enableCheckbox(
true);
966 $item_list_gui->enableDescription(
false);
967 $item_list_gui->enableProperties(
false);
968 $item_list_gui->enablePreconditions(
false);
969 $item_list_gui->enableNoticeProperties(
false);
973 $item_list_gui->enableCommands(
true,
true);
977 $ilBench->start(
"ilPersonalDesktopGUI",
"getListHTML");
981 $html = $item_list_gui->getListItemHTML($item[
"ref_id"],
982 $item[
"obj_id"], $item[
"title"], $item[
"description"]);
983 $ilBench->stop(
"ilPersonalDesktopGUI",
"getListHTML");
987 $item_html[] = array(
989 "item_ref_id" => $item[
"ref_id"],
990 "item_obj_id" => $item[
"obj_id"],
991 'item_icon_image_type' => (method_exists($item_list_gui,
'getIconImageType')) ?
992 $item_list_gui->getIconImageType() :
1000 if (count($item_html) > 0)
1005 if ($ilSetting->get(
"icon_position_in_lists") ==
"item_rows")
1017 foreach($item_html as $item)
1020 $ilSetting->get(
"icon_position_in_lists") ==
"item_rows")
1023 $this->
addStandardRow(
$tpl, $item[
"html"], $item[
"item_ref_id"], $item[
"item_obj_id"],
1024 $item[
'item_icon_image_type'],
1030 $this->
addStandardRow(
$tpl, $item[
"html"], $item[
"item_ref_id"], $item[
"item_obj_id"],
"", $rel_header);
1050 $items = $ilUser->getDesktopItems();
1051 $item_html = array();
1054 if (count($items) > 0)
1056 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
1058 foreach($items as $item)
1060 $preloader->addItem($item[
"obj_id"], $item[
"type"], $item[
"ref_id"]);
1062 $preloader->preload();
1066 foreach($items as $item)
1070 if ($cur_obj_type != $item[
"type"])
1079 $item_list_gui->enableNotes(
false);
1080 $item_list_gui->enableComments(
false);
1081 $item_list_gui->enableTags(
false);
1083 $item_list_gui->enableIcon(
true);
1084 $item_list_gui->enableDelete(
false);
1085 $item_list_gui->enableCut(
false);
1086 $item_list_gui->enableCopy(
false);
1087 $item_list_gui->enablePayment(
false);
1088 $item_list_gui->enableLink(
false);
1089 $item_list_gui->enableInfoScreen(
true);
1093 $item_list_gui->enableDescription(
false);
1094 $item_list_gui->enableProperties(
false);
1095 $item_list_gui->enablePreconditions(
false);
1099 $item_list_gui->enableCommands(
true,
true);
1103 $ilBench->start(
"ilPersonalDesktopGUI",
"getListHTML");
1107 $item_list_gui->setContainerObject($this);
1108 $html = $item_list_gui->getListItemHTML($item[
"ref_id"],
1109 $item[
"obj_id"], $item[
"title"], $item[
"description"]);
1110 $ilBench->stop(
"ilPersonalDesktopGUI",
"getListHTML");
1113 $item_html[] = array(
1115 "item_ref_id" => $item[
"ref_id"],
1116 "item_obj_id" => $item[
"obj_id"],
1117 "parent_ref" => $item[
"parent_ref"],
1118 "type" => $item[
"type"],
1119 'item_icon_image_type' => $item_list_gui->getIconImageType()
1125 if (count($item_html) > 0)
1127 $cur_parent_ref = 0;
1130 foreach($item_html as $item)
1133 if ($cur_parent_ref != $item[
"parent_ref"])
1135 if ($ilSetting->get(
"icon_position_in_lists") ==
"item_rows")
1144 $cur_parent_ref = $item[
"parent_ref"];
1147 $this->
addStandardRow(
$tpl, $item[
"html"], $item[
"item_ref_id"], $item[
"item_obj_id"],
1148 $item[
'item_icon_image_type'],
1149 "th_".$cur_parent_ref);
1160 $this->cur_row_type =
"";
1171 $tpl =
new ilTemplate(
"tpl.pd_list_block.html",
true,
true,
"Services/PersonalDesktop");
1172 $this->cur_row_type =
"";
1181 global $objDefinition;
1183 if (!isset($this->item_list_guis[$a_type]))
1185 $class = $objDefinition->getClassName($a_type);
1192 $location = $objDefinition->getLocation($a_type);
1198 $full_class =
"ilObj".$class.
"ListGUI";
1200 include_once(
$location.
"/class.".$full_class.
".php");
1201 $item_list_gui =
new $full_class();
1202 $this->item_list_guis[$a_type] =& $item_list_gui;
1206 $item_list_gui =& $this->item_list_guis[$a_type];
1211 $item_list_gui->enableCheckbox(
true);
1215 return $item_list_gui;
1227 global $objDefinition;
1230 if (!$objDefinition->isPlugin($a_type))
1232 $title = $this->lng->txt(
"objs_".$a_type);
1236 include_once(
"./Services/Component/classes/class.ilPlugin.php");
1241 $header_id =
"th_".$a_type;
1245 $a_tpl->setCurrentBlock(
"container_header_row_image");
1246 $a_tpl->setVariable(
"HEADER_IMG", $icon);
1247 $a_tpl->setVariable(
"HEADER_ALT", $title);
1251 $a_tpl->setCurrentBlock(
"container_header_row");
1254 $a_tpl->setVariable(
"BLOCK_HEADER_CONTENT", $title);
1255 $a_tpl->setVariable(
"BLOCK_HEADER_ID", $header_id);
1256 $a_tpl->parseCurrentBlock();
1257 $a_tpl->touchBlock(
"container_row");
1273 if (!in_array($type, array(
"lm",
"dbk",
"sahs",
"htlm")))
1283 if ($ilSetting->get(
"custom_icons") &&
1284 in_array($type, array(
"cat",
"grp",
"crs",
"root")))
1286 require_once(
"./Services/Container/classes/class.ilContainer.php");
1293 if ($tree->getRootId() != $par_id)
1299 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
1300 $title =
$nd[
"title"];
1301 if ($title ==
"ILIAS")
1303 $title = $this->lng->txt(
"repository");
1332 $a_tpl->setCurrentBlock(
"container_header_row");
1335 $a_tpl->setVariable(
"BLOCK_HEADER_CONTENT", $title);
1338 $a_tpl->parseCurrentBlock();
1339 $a_tpl->touchBlock(
"container_row");
1350 $a_image_type =
"", $a_related_header =
"")
1354 $this->cur_row_type = ($this->cur_row_type ==
"row_type_1")
1357 $a_tpl->touchBlock($this->cur_row_type);
1359 if ($a_image_type !=
"")
1361 if (!is_array($a_image_type) && !in_array($a_image_type, array(
"lm",
"dbk",
"htlm",
"sahs")))
1364 $title = $this->lng->txt(
"obj_".$a_image_type);
1369 $title = $this->lng->txt(
"learning_resource");
1373 if ($ilSetting->get(
"custom_icons") &&
1374 in_array($a_image_type, array(
"cat",
"grp",
"crs")))
1376 require_once(
"./Services/Container/classes/class.ilContainer.php");
1383 $a_tpl->setCurrentBlock(
"block_row_image");
1384 $a_tpl->setVariable(
"ROW_IMG", $icon);
1385 $a_tpl->setVariable(
"ROW_ALT", $title);
1386 $a_tpl->parseCurrentBlock();
1390 $a_tpl->setVariable(
"ROW_NBSP",
" ");
1392 $a_tpl->setCurrentBlock(
"container_standard_row");
1393 $a_tpl->setVariable(
"BLOCK_ROW_CONTENT", $a_html);
1394 $rel_headers = ($a_related_header !=
"")
1395 ?
"th_selected_items ".$a_related_header
1396 :
"th_selected_items";
1397 $a_tpl->setVariable(
"BLOCK_ROW_HEADERS", $rel_headers);
1398 $a_tpl->parseCurrentBlock();
1399 $a_tpl->touchBlock(
"container_row");
1409 switch((
int)$this->view)
1411 case self::VIEW_MY_MEMBERSHIPS:
1412 $tpl =
new ilTemplate(
'tpl.pd_my_memberships_intro.html',
true,
true,
'Services/PersonalDesktop');
1414 $tpl->setVariable(
'TXT_WELCOME', $lng->txt(
'pd_my_memberships_intro'));
1415 $tpl->setVariable(
'TXT_INTRO_1', $lng->txt(
'pd_my_memberships_intro2'));
1418 case self::VIEW_SELECTED_ITEMS:
1421 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
1422 $title =
$nd[
"title"];
1423 if ($title ==
"ILIAS")
1425 $title = $lng->txt(
"repository");
1428 $tpl =
new ilTemplate(
"tpl.pd_intro.html",
true,
true,
"Services/PersonalDesktop");
1430 $tpl->setVariable(
"TXT_WELCOME", $lng->txt(
"pdesk_intro"));
1431 $tpl->setVariable(
"TXT_INTRO_1", sprintf($lng->txt(
"pdesk_intro2"), $lng->txt(
"to_desktop")));
1432 include_once(
"./Services/Link/classes/class.ilLink.php");
1433 $tpl->setVariable(
"TXT_INTRO_2", sprintf($lng->txt(
"pdesk_intro3"),
1434 '<a href="'.ilLink::_getStaticLink(1,
'root',
true).
'">'.$title.
'</a>'));
1435 $tpl->setVariable(
"TXT_INTRO_3", $lng->txt(
"pdesk_intro4"));
1449 $ilUser->writePref(
"pd_order_items",
"location");
1451 if ($ilCtrl->isAsynch())
1458 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view', $this->view);
1459 $ilCtrl->redirectByClass(
"ilpersonaldesktopgui",
"show");
1470 $ilUser->writePref(
"pd_order_items",
"type");
1472 if ($ilCtrl->isAsynch())
1479 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view', $this->view);
1480 $ilCtrl->redirectByClass(
"ilpersonaldesktopgui",
"show");
1490 $this->manage =
true;
1494 $top_tb->setFormAction($ilCtrl->getFormAction($this));
1496 if($this->view == self::VIEW_SELECTED_ITEMS)
1498 $top_tb->addFormButton($lng->txt(
"remove"),
"confirmRemove");
1502 $top_tb->addFormButton($lng->txt(
"pd_unsubscribe_memberships"),
"confirmRemove");
1504 $top_tb->addSeparator();
1505 $top_tb->addFormButton($lng->txt(
"cancel"),
"getHTML");
1506 $top_tb->setCloseFormTag(
false);
1510 if($this->view == self::VIEW_SELECTED_ITEMS)
1512 $bot_tb->addFormButton($lng->txt(
"remove"),
"confirmRemove");
1516 $bot_tb->addFormButton($lng->txt(
"pd_unsubscribe_memberships"),
"confirmRemove");
1518 $bot_tb->addSeparator();
1519 $bot_tb->addFormButton($lng->txt(
"cancel"),
"getHTML");
1520 $bot_tb->setOpenFormTag(
false);
1522 return $top_tb->getHTML().$this->getHTML().$bot_tb->getHTML();
1529 $ilCtrl->setParameter($this,
'view', $this->view);
1530 if(!
sizeof(
$_POST[
"id"]))
1533 $ilCtrl->redirect($this,
"manage");
1536 if($this->view == self::VIEW_SELECTED_ITEMS)
1538 $question = $this->lng->txt(
"pd_info_delete_sure_remove");
1539 $cmd =
"confirmedRemove";
1543 $question = $this->lng->txt(
"pd_info_delete_sure_unsubscribe");
1544 $cmd =
"confirmedUnsubscribe";
1547 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1549 $cgui->setHeaderText($question);
1551 $cgui->setFormAction($ilCtrl->getFormAction($this));
1552 $cgui->setCancel($this->lng->txt(
"cancel"),
"manage");
1553 $cgui->setConfirm($this->lng->txt(
"confirm"),
$cmd);
1561 $cgui->addItem(
"ref_id[]", $ref_id, $title,
1563 $this->lng->txt(
"icon").
" ".$this->lng->txt(
"obj_".$type));
1566 return $cgui->getHTML();
1573 if(!
sizeof(
$_POST[
"ref_id"]))
1575 $ilCtrl->redirect($this,
"manage");
1586 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view', $this->view);
1587 $ilCtrl->redirectByClass(
"ilpersonaldesktopgui",
"show");
1594 if(!
sizeof(
$_POST[
"ref_id"]))
1596 $ilCtrl->redirect($this,
"manage");
1601 if($ilAccess->checkAccess(
"leave",
"", $ref_id))
1607 include_once
"Modules/Course/classes/class.ilCourseParticipants.php";
1609 $members->delete($ilUser->getId());
1611 $members->sendUnsubscribeNotificationToAdmins($ilUser->getId());
1612 $members->sendNotification(
1613 $members->NOTIFY_UNSUBSCRIBE,
1620 include_once
"Modules/Group/classes/class.ilGroupParticipants.php";
1622 $members->delete($ilUser->getId());
1624 include_once
'./Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1625 $members->sendNotification(
1629 $members->sendNotification(
1640 include_once
'./Modules/Forum/classes/class.ilForumNotification.php';
1647 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view', $this->view);
1648 $ilCtrl->redirectByClass(
"ilpersonaldesktopgui",
"show");