5 include_once(
"Services/Block/classes/class.ilBlockGUI.php");
6 include_once
'./Services/PersonalDesktop/interfaces/interface.ilDesktopItemHandling.php';
25 private $view = self::VIEW_SELECTED_ITEMS;
37 $lng->loadLanguageModule(
'pd');
38 $lng->loadLanguageModule(
'cntr');
46 $this->allow_moving =
false;
48 $this->determineViewSettings();
61 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view', $this->view);
62 parent::fillDetailRow();
63 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view',
'');
73 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
76 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view', $this->view);
77 $ilCtrl->redirectByClass(
'ilpersonaldesktopgui',
'show');
87 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
90 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view', $this->view);
91 $ilCtrl->redirectByClass(
'ilpersonaldesktopgui',
'show');
97 public function changeView()
104 if(in_array((
int)
$_GET[
'view'], $this->allowed_views))
106 $view = (int)$_GET[
'view'];
110 reset($this->allowed_views);
111 $view = (int)current($this->allowed_views);
114 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view',
$view);
115 $ilCtrl->redirectByClass(
'ilpersonaldesktopgui',
'show');
121 protected function determineViewSettings()
129 $this->allowed_views = array(self::VIEW_MY_STUDYPROGRAMME);
132 if($ilSetting->get(
'disable_my_offers') == 1 &&
133 $ilSetting->get(
'disable_my_memberships') == 1)
136 $ilSetting->set(
'personal_items_default_view', self::VIEW_SELECTED_ITEMS);
137 $this->allowed_views[] = self::VIEW_SELECTED_ITEMS;
140 else if($ilSetting->get(
'disable_my_offers') == 0 &&
141 $ilSetting->get(
'disable_my_memberships') == 0)
143 $this->allowed_views[] = self::VIEW_SELECTED_ITEMS;
144 $this->allowed_views[] = self::VIEW_MY_MEMBERSHIPS;
146 else if($ilSetting->get(
'disable_my_offers') == 0 &&
147 $ilSetting->get(
'disable_my_memberships') == 1)
149 $this->allowed_views[] = self::VIEW_SELECTED_ITEMS;
153 $this->allowed_views[] = self::VIEW_MY_MEMBERSHIPS;
156 $this->view = (int)
$_GET[
'view'];
159 $_GET[
'view'] = $this->view = (int)$ilSetting->get(
'personal_items_default_view');
162 $ilCtrl->saveParameter($this,
'view');
172 return self::$block_type;
181 $cmd = array_shift(array_keys(
$cmd));
186 case "confirmRemove":
210 $ilDB->useSlave(
true);
213 $this->
setData(array(
"dummy"));
215 include_once
"Services/Object/classes/class.ilObjectListGUI.php";
216 ilObjectListGUI::prepareJSLinks(
"",
217 $ilCtrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"ilnotegui"),
"",
"",
true,
false),
218 $ilCtrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false));
222 case self::VIEW_MY_MEMBERSHIPS:
224 if ($ilSetting->get(
'disable_my_offers') == 0)
226 $tpl->setTitle($lng->txt(
"my_courses_groups"));
228 $this->
setTitle($this->lng->txt(
'pd_my_memberships'));
232 case self::VIEW_SELECTED_ITEMS:
235 if(!in_array(self::VIEW_MY_MEMBERSHIPS, $this->allowed_views))
237 $this->
setTitle($this->lng->txt(
'selected_items'));
241 $this->
setTitle($this->lng->txt(
'pd_my_offers'));
252 $ilCtrl->clearParametersByClass(
"ilpersonaldesktopgui");
253 $ilCtrl->clearParameters($this);
255 $ilDB->useSlave(
false);
257 return parent::getHTML();
265 if((
int)$this->view == self::VIEW_MY_STUDYPROGRAMME) {
268 return parent::getFooterLinks();
278 $next_class = $ilCtrl->getNextClass();
279 $cmd = $ilCtrl->getCmd(
"getHTML");
283 case "ilcommonactiondispatchergui":
284 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
286 $ilCtrl->forwardCommand($gui);
290 if(method_exists($this,
$cmd))
292 return $this->
$cmd();
297 return $this->
$cmd();
304 return $this->content;
309 $this->content = $a_content;
321 $this->tpl->setVariable(
"BLOCK_ROW", $this->
getContent());
339 $this->tpl->setVariable(
"FCOLSPAN", $this->
getColSpan());
340 if ($this->tpl->blockExists(
"block_footer"))
342 $this->tpl->setCurrentBlock(
"block_footer");
343 $this->tpl->parseCurrentBlock();
369 $ilCtrl->getLinkTarget($this,
"orderPDItemsByType"),
370 $ilCtrl->getLinkTarget($this,
"orderPDItemsByType",
"",
true),
372 false,
false, ($ilUser->getPref(
"pd_order_items") !=
'location')
388 $ilCtrl->getLinkTarget($this,
"orderPDItemsByLocation"),
389 $ilCtrl->getLinkTarget($this,
"orderPDItemsByLocation",
"",
true),
391 false,
false, ($ilUser->getPref(
"pd_order_items") ==
'location')
395 $this->
addFooterLink(($this->view == self::VIEW_SELECTED_ITEMS) ?
396 $lng->txt(
"pd_remove_multiple") :
397 $lng->txt(
"pd_unsubscribe_multiple_memberships"),
398 $ilCtrl->getLinkTarget($this,
"manage"),
412 global $tree,
$ilUser, $ilObjDataCache;
414 include_once
'Services/Membership/classes/class.ilParticipants.php';
417 if(is_array($types) && count($types))
419 foreach($types as $type)
438 $items = array_merge($crs_mbs, $grp_mbs);
441 $references = array();
442 foreach($items as $key => $obj_id)
445 foreach($item_references as
$ref_id)
447 if($tree->isInTree($ref_id))
449 $title = $ilObjDataCache->lookupTitle($obj_id);
450 $type = $ilObjDataCache->lookupType($obj_id);
452 $parent_ref_id = $tree->getParentId($ref_id);
453 $par_left = $tree->getLeftValue($parent_ref_id);
454 $par_left = sprintf(
"%010d", $par_left);
456 $references[$par_left . $title .
$ref_id] = array(
461 'description' => $ilObjDataCache->lookupDescription($obj_id),
462 'parent_ref' => $parent_ref_id
468 return is_array($references) ? $references : array();
483 $item_html = array();
484 if(count($items) > 0)
486 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
488 foreach($items as $item)
490 $preloader->addItem($item[
"obj_id"], $item[
"type"], $item[
"ref_id"]);
492 $preloader->preload();
496 foreach($items as $item)
500 if ($cur_obj_type != $item[
"type"])
509 $item_list_gui->enableNotes(
false);
510 $item_list_gui->enableComments(
false);
511 $item_list_gui->enableTags(
false);
513 $item_list_gui->enableIcon(
true);
514 $item_list_gui->enableDelete(
false);
515 $item_list_gui->enableCut(
false);
516 $item_list_gui->enableCopy(
false);
517 $item_list_gui->enablePayment(
false);
518 $item_list_gui->enableLink(
false);
519 $item_list_gui->enableInfoScreen(
true);
520 if ($ilSetting->get(
'disable_my_offers') == 1)
522 $item_list_gui->enableSubscribe(
false);
526 $item_list_gui->enableSubscribe(
true);
528 $item_list_gui->setContainerObject($this);
532 $item_list_gui->enableDescription(
false);
533 $item_list_gui->enableProperties(
false);
534 $item_list_gui->enablePreconditions(
false);
538 $item_list_gui->enableCommands(
true,
true);
542 $ilBench->start(
"ilPersonalDesktopGUI",
"getListHTML");
544 if (is_object($item_list_gui))
551 if(!$rbacsystem->checkAccess(
"leave", $item[
"ref_id"]))
553 $item_list_gui->enableCheckbox(
false);
557 $item_list_gui->enableCheckbox(
true);
561 $html = $item_list_gui->getListItemHTML($item[
"ref_id"],
562 $item[
"obj_id"], $item[
"title"], $item[
"description"]);
563 $ilBench->stop(
"ilPersonalDesktopGUI",
"getListHTML");
567 $item_html[] = array(
569 "item_ref_id" => $item[
"ref_id"],
570 "item_obj_id" => $item[
"obj_id"],
571 "parent_ref" => $item[
"parent_ref"],
572 "type" => $item[
"type"],
573 'item_icon_image_type' => $item_list_gui->getIconImageType()
581 if (count($item_html) > 0)
586 foreach($item_html as $item)
589 if ($cur_parent_ref != $item[
"parent_ref"])
591 if ($ilSetting->get(
"icon_position_in_lists") ==
"item_rows")
600 $cur_parent_ref = $item[
"parent_ref"];
604 $this->
addStandardRow(
$tpl, $item[
"html"], $item[
"item_ref_id"], $item[
"item_obj_id"],
605 $item[
'item_icon_image_type'],
606 "th_".$cur_parent_ref);
628 $objtype_groups = $objDefinition->getGroupedRepositoryObjectTypes(
629 array(
"cat",
"crs",
"grp",
"fold"));
632 foreach($objtype_groups as $grp => $grpdata)
636 "title" => $this->lng->txt(
"objs_".$grp),
637 "types" => $grpdata[
"objs"]);
640 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
642 foreach ($types as
$t)
645 $title = $t[
"title"];
650 if (count($items) > 0)
653 foreach($items as $item)
655 $preloader->addItem($item[
"obj_id"], $item[
"type"], $item[
"ref_id"]);
657 $preloader->preload();
663 $item_html = array();
667 $rel_header =
"th_".$grp;
676 if (strcmp($a_type,
"tst") == 0) {
677 $items = $this->multiarray_sort($items,
"used_tries; title");
678 foreach ($items as $tst_item) {
679 if (!isset($tst_item[
"used_tries"])) {
682 elseif ($tst_item[
"used_tries"] == 0) {
688 foreach($items as $item)
691 if ($cur_obj_type != $item[
"type"])
693 $class = $objDefinition->getClassName($item[
"type"]);
694 $location = $objDefinition->getLocation($item[
"type"]);
695 $full_class =
"ilObj".$class.
"ListGUI";
696 include_once(
$location.
"/class.".$full_class.
".php");
697 $item_list_gui =
new $full_class();
700 $item_list_gui->enableNotes(
false);
701 $item_list_gui->enableComments(
false);
702 $item_list_gui->enableTags(
false);
704 $item_list_gui->enableIcon(
true);
705 $item_list_gui->enableDelete(
false);
706 $item_list_gui->enableCut(
false);
707 $item_list_gui->enableCopy(
false);
708 $item_list_gui->enablePayment(
false);
709 $item_list_gui->enableLink(
false);
710 $item_list_gui->enableInfoScreen(
true);
711 if ($ilSetting->get(
'disable_my_offers') == 1)
713 $item_list_gui->enableSubscribe(
false);
717 $item_list_gui->enableSubscribe(
true);
720 $item_list_gui->setContainerObject($this);
723 $item_list_gui->enableCheckbox(
true);
727 $item_list_gui->enableDescription(
false);
728 $item_list_gui->enableProperties(
false);
729 $item_list_gui->enablePreconditions(
false);
730 $item_list_gui->enableNoticeProperties(
false);
734 $item_list_gui->enableCommands(
true,
true);
738 $ilBench->start(
"ilPersonalDesktopGUI",
"getListHTML");
745 if(!$rbacsystem->checkAccess(
"leave", $item[
"ref_id"]))
747 $item_list_gui->enableCheckbox(
false);
751 $item_list_gui->enableCheckbox(
true);
755 $html = $item_list_gui->getListItemHTML($item[
"ref_id"],
756 $item[
"obj_id"], $item[
"title"], $item[
"description"]);
757 $ilBench->stop(
"ilPersonalDesktopGUI",
"getListHTML");
761 $item_html[] = array(
763 "item_ref_id" => $item[
"ref_id"],
764 "item_obj_id" => $item[
"obj_id"],
765 'item_icon_image_type' => (method_exists($item_list_gui,
'getIconImageType')) ?
766 $item_list_gui->getIconImageType() :
774 if (count($item_html) > 0)
779 if ($ilSetting->get(
"icon_position_in_lists") ==
"item_rows")
791 foreach($item_html as $item)
794 $ilSetting->get(
"icon_position_in_lists") ==
"item_rows")
797 $this->
addStandardRow(
$tpl, $item[
"html"], $item[
"item_ref_id"], $item[
"item_obj_id"],
798 $item[
'item_icon_image_type'],
804 $this->
addStandardRow(
$tpl, $item[
"html"], $item[
"item_ref_id"], $item[
"item_obj_id"],
"", $rel_header);
827 switch($ilUser->getPref(
'pd_order_items'))
850 switch ($ilUser->getPref(
"pd_order_items"))
864 $tpl->setCurrentBlock(
"select_all_row");
865 $tpl->setVariable(
"CHECKBOXNAME",
"ilToolbarSelectAll");
866 $tpl->setVariable(
"SEL_ALL_PARENT",
"ilToolbar");
867 $tpl->setVariable(
"SEL_ALL_CB_NAME",
"id");
868 $tpl->setVariable(
"TXT_SELECT_ALL", $this->lng->txt(
"select_all"));
869 $tpl->parseCurrentBlock();
882 $items = $ilUser->getDesktopItems();
883 if (count($items) > 0)
885 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
887 foreach($items as $item)
889 $preloader->addItem($item[
"obj_id"], $item[
"type"], $item[
"ref_id"]);
891 $preloader->preload();
899 $objtype_groups = $objDefinition->getGroupedRepositoryObjectTypes(
900 array(
"cat",
"crs",
"grp",
"fold"));
903 foreach($objtype_groups as $grp => $grpdata)
907 "title" => $this->lng->txt(
"objs_".$grp),
908 "types" => $grpdata[
"objs"]);
911 foreach ($types as
$t)
915 $title = $t[
"title"];
918 $items = $ilUser->getDesktopItems($type);
919 $item_html = array();
923 $rel_header =
"th_".$grp;
926 if (count($items) > 0)
934 if (strcmp($a_type,
"tst") == 0) {
935 $items = $this->multiarray_sort($items,
"used_tries; title");
936 foreach ($items as $tst_item) {
937 if (!isset($tst_item[
"used_tries"])) {
940 elseif ($tst_item[
"used_tries"] == 0) {
946 foreach($items as $item)
949 if ($cur_obj_type != $item[
"type"])
951 $class = $objDefinition->getClassName($item[
"type"]);
952 $location = $objDefinition->getLocation($item[
"type"]);
953 $full_class =
"ilObj".$class.
"ListGUI";
954 include_once(
$location.
"/class.".$full_class.
".php");
955 $item_list_gui =
new $full_class();
958 $item_list_gui->enableNotes(
false);
959 $item_list_gui->enableComments(
false);
960 $item_list_gui->enableTags(
false);
962 $item_list_gui->enableIcon(
true);
963 $item_list_gui->enableDelete(
false);
964 $item_list_gui->enableCut(
false);
965 $item_list_gui->enableCopy(
false);
966 $item_list_gui->enablePayment(
false);
967 $item_list_gui->enableLink(
false);
968 $item_list_gui->enableInfoScreen(
true);
969 $item_list_gui->setContainerObject($this);
973 $item_list_gui->enableCheckbox(
true);
978 $item_list_gui->enableDescription(
false);
979 $item_list_gui->enableProperties(
false);
980 $item_list_gui->enablePreconditions(
false);
981 $item_list_gui->enableNoticeProperties(
false);
985 $item_list_gui->enableCommands(
true,
true);
989 $ilBench->start(
"ilPersonalDesktopGUI",
"getListHTML");
991 include_once
'./Services/Object/classes/class.ilObjectActivation.php';
994 $html = $item_list_gui->getListItemHTML($item[
"ref_id"],
995 $item[
"obj_id"], $item[
"title"], $item[
"description"]);
996 $ilBench->stop(
"ilPersonalDesktopGUI",
"getListHTML");
1000 $item_html[] = array(
1002 "item_ref_id" => $item[
"ref_id"],
1003 "item_obj_id" => $item[
"obj_id"],
1004 'item_icon_image_type' => (method_exists($item_list_gui,
'getIconImageType')) ?
1005 $item_list_gui->getIconImageType() :
1013 if (count($item_html) > 0)
1018 if ($ilSetting->get(
"icon_position_in_lists") ==
"item_rows")
1030 foreach($item_html as $item)
1033 $ilSetting->get(
"icon_position_in_lists") ==
"item_rows")
1036 $this->
addStandardRow(
$tpl, $item[
"html"], $item[
"item_ref_id"], $item[
"item_obj_id"],
1037 $item[
'item_icon_image_type'],
1043 $this->
addStandardRow(
$tpl, $item[
"html"], $item[
"item_ref_id"], $item[
"item_obj_id"],
"", $rel_header);
1063 $items = $ilUser->getDesktopItems();
1064 $item_html = array();
1067 if (count($items) > 0)
1069 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
1071 foreach($items as $item)
1073 $preloader->addItem($item[
"obj_id"], $item[
"type"], $item[
"ref_id"]);
1075 $preloader->preload();
1079 foreach($items as $item)
1083 if ($cur_obj_type != $item[
"type"])
1092 $item_list_gui->enableNotes(
false);
1093 $item_list_gui->enableComments(
false);
1094 $item_list_gui->enableTags(
false);
1096 $item_list_gui->enableIcon(
true);
1097 $item_list_gui->enableDelete(
false);
1098 $item_list_gui->enableCut(
false);
1099 $item_list_gui->enableCopy(
false);
1100 $item_list_gui->enablePayment(
false);
1101 $item_list_gui->enableLink(
false);
1102 $item_list_gui->enableInfoScreen(
true);
1106 $item_list_gui->enableDescription(
false);
1107 $item_list_gui->enableProperties(
false);
1108 $item_list_gui->enablePreconditions(
false);
1112 $item_list_gui->enableCommands(
true,
true);
1116 $ilBench->start(
"ilPersonalDesktopGUI",
"getListHTML");
1120 $item_list_gui->setContainerObject($this);
1121 $html = $item_list_gui->getListItemHTML($item[
"ref_id"],
1122 $item[
"obj_id"], $item[
"title"], $item[
"description"]);
1123 $ilBench->stop(
"ilPersonalDesktopGUI",
"getListHTML");
1126 $item_html[] = array(
1128 "item_ref_id" => $item[
"ref_id"],
1129 "item_obj_id" => $item[
"obj_id"],
1130 "parent_ref" => $item[
"parent_ref"],
1131 "type" => $item[
"type"],
1132 'item_icon_image_type' => $item_list_gui->getIconImageType()
1138 if (count($item_html) > 0)
1140 $cur_parent_ref = 0;
1143 foreach($item_html as $item)
1146 if ($cur_parent_ref != $item[
"parent_ref"])
1148 if ($ilSetting->get(
"icon_position_in_lists") ==
"item_rows")
1157 $cur_parent_ref = $item[
"parent_ref"];
1160 $this->
addStandardRow(
$tpl, $item[
"html"], $item[
"item_ref_id"], $item[
"item_obj_id"],
1161 $item[
'item_icon_image_type'],
1162 "th_".$cur_parent_ref);
1173 $this->cur_row_type =
"";
1184 $tpl =
new ilTemplate(
"tpl.pd_list_block.html",
true,
true,
"Services/PersonalDesktop");
1185 $this->cur_row_type =
"";
1194 global $objDefinition;
1196 if (!isset($this->item_list_guis[$a_type]))
1198 $class = $objDefinition->getClassName($a_type);
1205 $location = $objDefinition->getLocation($a_type);
1211 $full_class =
"ilObj".$class.
"ListGUI";
1213 include_once(
$location.
"/class.".$full_class.
".php");
1214 $item_list_gui =
new $full_class();
1215 $this->item_list_guis[$a_type] =& $item_list_gui;
1219 $item_list_gui =& $this->item_list_guis[$a_type];
1224 $item_list_gui->enableCheckbox(
true);
1228 return $item_list_gui;
1240 global $objDefinition;
1243 if (!$objDefinition->isPlugin($a_type))
1245 $title = $this->lng->txt(
"objs_".$a_type);
1249 include_once(
"./Services/Component/classes/class.ilPlugin.php");
1254 $header_id =
"th_".$a_type;
1258 $a_tpl->setCurrentBlock(
"container_header_row_image");
1259 $a_tpl->setVariable(
"HEADER_IMG", $icon);
1260 $a_tpl->setVariable(
"HEADER_ALT", $title);
1264 $a_tpl->setCurrentBlock(
"container_header_row");
1267 $a_tpl->setVariable(
"BLOCK_HEADER_CONTENT", $title);
1268 $a_tpl->setVariable(
"BLOCK_HEADER_ID", $header_id);
1269 $a_tpl->parseCurrentBlock();
1270 $a_tpl->touchBlock(
"container_row");
1286 if (!in_array($type, array(
"lm",
"dbk",
"sahs",
"htlm")))
1296 if ($ilSetting->get(
"custom_icons") &&
1297 in_array($type, array(
"cat",
"grp",
"crs",
"root")))
1299 require_once(
"./Services/Container/classes/class.ilContainer.php");
1306 if ($tree->getRootId() != $par_id)
1312 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
1313 $title =
$nd[
"title"];
1314 if ($title ==
"ILIAS")
1316 $title = $this->lng->txt(
"repository");
1345 $a_tpl->setCurrentBlock(
"container_header_row");
1348 $a_tpl->setVariable(
"BLOCK_HEADER_CONTENT", $title);
1351 $a_tpl->parseCurrentBlock();
1352 $a_tpl->touchBlock(
"container_row");
1363 $a_image_type =
"", $a_related_header =
"")
1367 $this->cur_row_type = ($this->cur_row_type ==
"row_type_1")
1370 $a_tpl->touchBlock($this->cur_row_type);
1372 if ($a_image_type !=
"")
1374 if (!is_array($a_image_type) && !in_array($a_image_type, array(
"lm",
"dbk",
"htlm",
"sahs")))
1377 $title = $this->lng->txt(
"obj_".$a_image_type);
1382 $title = $this->lng->txt(
"learning_resource");
1386 if ($ilSetting->get(
"custom_icons") &&
1387 in_array($a_image_type, array(
"cat",
"grp",
"crs")))
1389 require_once(
"./Services/Container/classes/class.ilContainer.php");
1396 $a_tpl->setCurrentBlock(
"block_row_image");
1397 $a_tpl->setVariable(
"ROW_IMG", $icon);
1398 $a_tpl->setVariable(
"ROW_ALT", $title);
1399 $a_tpl->parseCurrentBlock();
1403 $a_tpl->setVariable(
"ROW_NBSP",
" ");
1405 $a_tpl->setCurrentBlock(
"container_standard_row");
1406 $a_tpl->setVariable(
"BLOCK_ROW_CONTENT", $a_html);
1407 $rel_headers = ($a_related_header !=
"")
1408 ?
"th_selected_items ".$a_related_header
1409 :
"th_selected_items";
1410 $a_tpl->setVariable(
"BLOCK_ROW_HEADERS", $rel_headers);
1411 $a_tpl->parseCurrentBlock();
1412 $a_tpl->touchBlock(
"container_row");
1422 switch((
int)$this->view)
1424 case self::VIEW_MY_MEMBERSHIPS:
1425 $tpl =
new ilTemplate(
'tpl.pd_my_memberships_intro.html',
true,
true,
'Services/PersonalDesktop');
1427 $tpl->setVariable(
'TXT_WELCOME', $lng->txt(
'pd_my_memberships_intro'));
1428 $tpl->setVariable(
'TXT_INTRO_1', $lng->txt(
'pd_my_memberships_intro2'));
1431 case self::VIEW_SELECTED_ITEMS:
1434 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
1435 $title =
$nd[
"title"];
1436 if ($title ==
"ILIAS")
1438 $title = $lng->txt(
"repository");
1441 $tpl =
new ilTemplate(
"tpl.pd_intro.html",
true,
true,
"Services/PersonalDesktop");
1443 $tpl->setVariable(
"TXT_WELCOME", $lng->txt(
"pdesk_intro"));
1444 $tpl->setVariable(
"TXT_INTRO_1", sprintf($lng->txt(
"pdesk_intro2"), $lng->txt(
"to_desktop")));
1445 include_once(
"./Services/Link/classes/class.ilLink.php");
1446 $tpl->setVariable(
"TXT_INTRO_2", sprintf($lng->txt(
"pdesk_intro3"),
1447 '<a href="'.ilLink::_getStaticLink(1,
'root',
true).
'">'.$title.
'</a>'));
1448 $tpl->setVariable(
"TXT_INTRO_3", $lng->txt(
"pdesk_intro4"));
1462 $ilUser->writePref(
"pd_order_items",
"location");
1464 if ($ilCtrl->isAsynch())
1471 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view', $this->view);
1472 $ilCtrl->redirectByClass(
"ilpersonaldesktopgui",
"show");
1483 $ilUser->writePref(
"pd_order_items",
"type");
1485 if ($ilCtrl->isAsynch())
1492 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view', $this->view);
1493 $ilCtrl->redirectByClass(
"ilpersonaldesktopgui",
"show");
1503 $this->manage =
true;
1507 $top_tb->setFormAction($ilCtrl->getFormAction($this));
1511 if($this->view == self::VIEW_SELECTED_ITEMS)
1513 $button->setCaption(
"remove");
1517 $button->setCaption(
"pd_unsubscribe_memberships");
1519 $button->setCommand(
"confirmRemove");
1520 $top_tb->addStickyItem($button);
1523 $button2->setCaption(
"cancel");
1524 $button2->setCommand(
"getHTML");
1525 $top_tb->addStickyItem($button2);
1527 $top_tb->setCloseFormTag(
false);
1531 $bot_tb->addStickyItem($button);
1532 $bot_tb->addStickyItem($button2);
1533 $bot_tb->setOpenFormTag(
false);
1535 return $top_tb->getHTML().$this->getHTML().$bot_tb->getHTML();
1542 $ilCtrl->setParameter($this,
'view', $this->view);
1543 if(!
sizeof(
$_POST[
"id"]))
1546 $ilCtrl->redirect($this,
"manage");
1549 if($this->view == self::VIEW_SELECTED_ITEMS)
1551 $question = $this->lng->txt(
"pd_info_delete_sure_remove");
1552 $cmd =
"confirmedRemove";
1556 $question = $this->lng->txt(
"pd_info_delete_sure_unsubscribe");
1557 $cmd =
"confirmedUnsubscribe";
1560 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1562 $cgui->setHeaderText($question);
1564 $cgui->setFormAction($ilCtrl->getFormAction($this));
1565 $cgui->setCancel($this->lng->txt(
"cancel"),
"manage");
1566 $cgui->setConfirm($this->lng->txt(
"confirm"),
$cmd);
1574 $cgui->addItem(
"ref_id[]", $ref_id, $title,
1576 $this->lng->txt(
"icon").
" ".$this->lng->txt(
"obj_".$type));
1579 return $cgui->getHTML();
1586 if(!
sizeof(
$_POST[
"ref_id"]))
1588 $ilCtrl->redirect($this,
"manage");
1599 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view', $this->view);
1600 $ilCtrl->redirectByClass(
"ilpersonaldesktopgui",
"show");
1607 if(!
sizeof(
$_POST[
"ref_id"]))
1609 $ilCtrl->redirect($this,
"manage");
1614 if($ilAccess->checkAccess(
"leave",
"", $ref_id))
1620 include_once
"Modules/Course/classes/class.ilCourseParticipants.php";
1622 $members->delete($ilUser->getId());
1624 $members->sendUnsubscribeNotificationToAdmins($ilUser->getId());
1625 $members->sendNotification(
1626 $members->NOTIFY_UNSUBSCRIBE,
1633 include_once
"Modules/Group/classes/class.ilGroupParticipants.php";
1635 $members->delete($ilUser->getId());
1637 include_once
'./Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1638 $members->sendNotification(
1642 $members->sendNotification(
1653 include_once
'./Modules/Forum/classes/class.ilForumNotification.php';
1660 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view', $this->view);
1661 $ilCtrl->redirectByClass(
"ilpersonaldesktopgui",
"show");
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
getSelectedItemsBlockHTML()
get selected item block
const TYPE_NOTIFICATION_UNSUBSCRIBE
__construct()
Constructor.
addFooterLink($a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false, $a_checked=false)
Add a footer text/link.
& executeCommand()
execute command
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
getMembershipItemsPerType($tpl)
Generates the block html string by type ordering.
getObjectsByMembership($types=array())
Gets all objects the current user is member of.
const VIEW_MY_STUDYPROGRAMME
static _getMembershipByType($a_usr_id, $a_type, $a_only_member_role=false)
get membership by type Get course or group membership
getSelectedItemsPerType(&$tpl)
get selected items per type
fillFooterLinks($a_top=false, $a_numinfo="")
Fill footer links.
static _lookupTitle($a_id)
lookup object title
addParentRow(&$a_tpl, $a_ref_id, $a_show_image=true)
adds a header row to a block template
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
const VIEW_MY_MEMBERSHIPS
setFooterLinks()
Set footer links.
static addToDesktop()
Add desktop item public.
addStandardRow(&$a_tpl, $a_html, $a_item_ref_id="", $a_item_obj_id="", $a_image_type="", $a_related_header="")
adds a standard row to a block template
static _getAllReferences($a_id)
get all reference ids of object
_lookupIconPath($a_id, $a_size="big")
lookup icon path
static _lookupObjectId($a_ref_id)
lookup object id
orderPDItemsByLocation()
order desktop items by location
fillDetailRow()
Fill Detail Setting Row.
Preloader for object list GUIs.
fillDataSection()
Fill data section.
static lookupTxt($a_mod_prefix, $a_pl_id, $a_lang_var)
Lookup language text.
getIntroduction()
Get overview.
setTitle($a_title)
Set Title.
const CONTEXT_PERSONAL_DESKTOP
getSelectedItemsPerLocation(&$tpl)
get selected items per type
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
setData($a_data)
Set Data.
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
static getBlockType()
Get block type.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
orderPDItemsByType()
order desktop items by Type
static _dropDesktopItem($a_usr_id, $a_item_id, $a_type)
drop an item from user's personal desktop
const TYPE_UNSUBSCRIBE_MEMBER
addHeaderRow(&$a_tpl, $a_type, $a_show_image=true)
adds a header row to a block template
static addListGUIActivationProperty(ilObjectListGUI $a_list_gui, array &$a_item)
Get timing details for list gui.
static _lookupType($a_id, $a_reference=false)
lookup object type
& newBlockTemplate()
returns a new list block template
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static checkForumsExistsDelete($ref_id, $user_id=0)
const VIEW_SELECTED_ITEMS
static removeFromDesktop()
Remove item from personal desktop public.
setLimit($a_limit)
Set Limit.
Interface for gui classes (e.g ilLuceneSearchGUI) that offer add/remove to/from desktop.
BlockGUI class for Selected Items on Personal Desktop.
getMembershipItemsBlockHTML()
Gateway method to distinguish between sorting type.
getColSpan()
Get Columns Span.
& getItemListGUI($a_type)
get item list gui class for type
getMembershipItemsPerLocation($tpl)
Generates the block html string by location ordering.
This class represents a block method of a block.
setEnableDetailRow($a_enabledetailrow)
Set EnableDetailRow.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static isRepositoryObject()
Get block type.
getCurrentDetailLevel()
Get Current Detail Level.
Confirmation screen class.