5 include_once(
"Services/Block/classes/class.ilBlockGUI.php");
6 include_once
'./Services/PersonalDesktop/interfaces/interface.ilDesktopItemHandling.php';
7 require_once(
'./Services/Repository/classes/class.ilObjectPlugin.php');
26 private $view = self::VIEW_SELECTED_ITEMS;
36 parent::__construct();
38 $lng->loadLanguageModule(
'pd');
39 $lng->loadLanguageModule(
'cntr');
47 $this->allow_moving =
false;
49 $this->determineViewSettings();
63 parent::fillDetailRow();
74 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
77 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view', $this->view);
78 $ilCtrl->redirectByClass(
'ilpersonaldesktopgui',
'show');
88 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
91 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view', $this->view);
92 $ilCtrl->redirectByClass(
'ilpersonaldesktopgui',
'show');
98 public function changeView()
105 if(in_array((
int)
$_GET[
'view'], $this->allowed_views))
107 $view = (int)$_GET[
'view'];
111 reset($this->allowed_views);
112 $view = (int)current($this->allowed_views);
115 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view',
$view);
116 $ilCtrl->redirectByClass(
'ilpersonaldesktopgui',
'show');
122 protected function determineViewSettings()
130 $this->allowed_views =
array(self::VIEW_MY_STUDYPROGRAMME);
133 if($ilSetting->get(
'disable_my_offers') == 1 &&
134 $ilSetting->get(
'disable_my_memberships') == 1)
137 $ilSetting->set(
'personal_items_default_view', self::VIEW_SELECTED_ITEMS);
138 $this->allowed_views[] = self::VIEW_SELECTED_ITEMS;
141 else if($ilSetting->get(
'disable_my_offers') == 0 &&
142 $ilSetting->get(
'disable_my_memberships') == 0)
144 $this->allowed_views[] = self::VIEW_SELECTED_ITEMS;
145 $this->allowed_views[] = self::VIEW_MY_MEMBERSHIPS;
147 else if($ilSetting->get(
'disable_my_offers') == 0 &&
148 $ilSetting->get(
'disable_my_memberships') == 1)
150 $this->allowed_views[] = self::VIEW_SELECTED_ITEMS;
154 $this->allowed_views[] = self::VIEW_MY_MEMBERSHIPS;
157 $this->view = (int)
$_GET[
'view'];
160 $_GET[
'view'] = $this->view = (int)$ilSetting->get(
'personal_items_default_view');
163 $ilCtrl->saveParameter($this,
'view');
173 return self::$block_type;
182 $cmd = array_shift(array_keys(
$cmd));
187 case "confirmRemove":
211 $ilDB->useSlave(
true);
216 include_once
"Services/Object/classes/class.ilObjectListGUI.php";
217 ilObjectListGUI::prepareJSLinks(
"",
218 $ilCtrl->getLinkTargetByClass(
array(
"ilcommonactiondispatchergui",
"ilnotegui"),
"",
"",
true,
false),
219 $ilCtrl->getLinkTargetByClass(
array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false));
223 case self::VIEW_MY_MEMBERSHIPS:
225 if ($ilSetting->get(
'disable_my_offers') == 0)
227 $tpl->setTitle($lng->txt(
"my_courses_groups"));
229 $this->
setTitle($this->lng->txt(
'pd_my_memberships'));
233 case self::VIEW_SELECTED_ITEMS:
236 if(!in_array(self::VIEW_MY_MEMBERSHIPS, $this->allowed_views))
238 $this->
setTitle($this->lng->txt(
'selected_items'));
242 $this->
setTitle($this->lng->txt(
'pd_my_offers'));
254 $ilCtrl->clearParameters($this);
256 $ilDB->useSlave(
false);
258 return parent::getHTML();
266 if((
int)$this->view == self::VIEW_MY_STUDYPROGRAMME) {
269 return parent::getFooterLinks();
279 $next_class = $ilCtrl->getNextClass();
280 $cmd = $ilCtrl->getCmd(
"getHTML");
284 case "ilcommonactiondispatchergui":
285 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
287 $ilCtrl->forwardCommand($gui);
291 if(method_exists($this,
$cmd))
293 return $this->
$cmd();
298 return $this->
$cmd();
305 return $this->content;
322 $this->tpl->setVariable(
"BLOCK_ROW", $this->
getContent());
340 $this->tpl->setVariable(
"FCOLSPAN", $this->
getColSpan());
341 if ($this->tpl->blockExists(
"block_footer"))
343 $this->tpl->setCurrentBlock(
"block_footer");
344 $this->tpl->parseCurrentBlock();
370 $ilCtrl->getLinkTarget($this,
"orderPDItemsByType"),
371 $ilCtrl->getLinkTarget($this,
"orderPDItemsByType",
"",
true),
373 false,
false, ($ilUser->getPref(
"pd_order_items") !=
'location')
389 $ilCtrl->getLinkTarget($this,
"orderPDItemsByLocation"),
390 $ilCtrl->getLinkTarget($this,
"orderPDItemsByLocation",
"",
true),
392 false,
false, ($ilUser->getPref(
"pd_order_items") ==
'location')
396 $this->
addFooterLink(($this->view == self::VIEW_SELECTED_ITEMS) ?
397 $lng->txt(
"pd_remove_multiple") :
398 $lng->txt(
"pd_unsubscribe_multiple_memberships"),
399 $ilCtrl->getLinkTarget($this,
"manage"),
413 global $tree,
$ilUser, $ilObjDataCache;
415 include_once
'Services/Membership/classes/class.ilParticipants.php';
418 if(is_array($types) && count($types))
420 foreach($types as $type)
439 $items = array_merge($crs_mbs, $grp_mbs);
442 $references =
array();
443 foreach($items as $key => $obj_id)
446 foreach($item_references as
$ref_id)
448 if($tree->isInTree($ref_id))
450 $title = $ilObjDataCache->lookupTitle($obj_id);
451 $type = $ilObjDataCache->lookupType($obj_id);
453 $parent_ref_id = $tree->getParentId($ref_id);
454 $par_left = $tree->getLeftValue($parent_ref_id);
455 $par_left = sprintf(
"%010d", $par_left);
462 'description' => $ilObjDataCache->lookupDescription($obj_id),
463 'parent_ref' => $parent_ref_id
469 return is_array($references) ? $references :
array();
484 $item_html =
array();
485 if(count($items) > 0)
487 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
489 foreach($items as $item)
491 $preloader->addItem($item[
"obj_id"], $item[
"type"], $item[
"ref_id"]);
493 $preloader->preload();
497 foreach($items as $item)
501 if ($cur_obj_type != $item[
"type"])
510 $item_list_gui->enableNotes(
false);
511 $item_list_gui->enableComments(
false);
512 $item_list_gui->enableTags(
false);
514 $item_list_gui->enableIcon(
true);
515 $item_list_gui->enableDelete(
false);
516 $item_list_gui->enableCut(
false);
517 $item_list_gui->enableCopy(
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)
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->enableLink(
false);
709 $item_list_gui->enableInfoScreen(
true);
710 if ($ilSetting->get(
'disable_my_offers') == 1)
712 $item_list_gui->enableSubscribe(
false);
716 $item_list_gui->enableSubscribe(
true);
719 $item_list_gui->setContainerObject($this);
722 $item_list_gui->enableCheckbox(
true);
726 $item_list_gui->enableDescription(
false);
727 $item_list_gui->enableProperties(
false);
728 $item_list_gui->enablePreconditions(
false);
729 $item_list_gui->enableNoticeProperties(
false);
733 $item_list_gui->enableCommands(
true,
true);
737 $ilBench->start(
"ilPersonalDesktopGUI",
"getListHTML");
744 if(!$rbacsystem->checkAccess(
"leave", $item[
"ref_id"]))
746 $item_list_gui->enableCheckbox(
false);
750 $item_list_gui->enableCheckbox(
true);
754 $html = $item_list_gui->getListItemHTML($item[
"ref_id"],
755 $item[
"obj_id"], $item[
"title"], $item[
"description"]);
756 $ilBench->stop(
"ilPersonalDesktopGUI",
"getListHTML");
760 $item_html[] =
array(
762 "item_ref_id" => $item[
"ref_id"],
763 "item_obj_id" => $item[
"obj_id"],
764 'item_icon_image_type' => (method_exists($item_list_gui,
'getIconImageType')) ?
765 $item_list_gui->getIconImageType() :
773 if (count($item_html) > 0)
778 if ($ilSetting->get(
"icon_position_in_lists") ==
"item_rows")
790 foreach($item_html as $item)
793 $ilSetting->get(
"icon_position_in_lists") ==
"item_rows")
796 $this->
addStandardRow(
$tpl, $item[
"html"], $item[
"item_ref_id"], $item[
"item_obj_id"],
797 $item[
'item_icon_image_type'],
803 $this->
addStandardRow(
$tpl, $item[
"html"], $item[
"item_ref_id"], $item[
"item_obj_id"],
"", $rel_header);
826 switch($ilUser->getPref(
'pd_order_items'))
849 switch ($ilUser->getPref(
"pd_order_items"))
863 $tpl->setCurrentBlock(
"select_all_row");
864 $tpl->setVariable(
"CHECKBOXNAME",
"ilToolbarSelectAll");
865 $tpl->setVariable(
"SEL_ALL_PARENT",
"ilToolbar");
866 $tpl->setVariable(
"SEL_ALL_CB_NAME",
"id");
867 $tpl->setVariable(
"TXT_SELECT_ALL", $this->lng->txt(
"select_all"));
868 $tpl->parseCurrentBlock();
881 $items = $ilUser->getDesktopItems();
882 if (count($items) > 0)
884 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
886 foreach($items as $item)
888 $preloader->addItem($item[
"obj_id"], $item[
"type"], $item[
"ref_id"]);
890 $preloader->preload();
898 $objtype_groups = $objDefinition->getGroupedRepositoryObjectTypes(
899 array(
"cat",
"crs",
"grp",
"fold"));
902 foreach($objtype_groups as $grp => $grpdata)
906 "title" => $this->lng->txt(
"objs_".$grp),
907 "types" => $grpdata[
"objs"]);
910 foreach ($types as
$t)
917 $items = $ilUser->getDesktopItems($type);
918 $item_html =
array();
922 $rel_header =
"th_".$grp;
925 if (count($items) > 0)
933 if (strcmp(
$a_type,
"tst") == 0) {
934 $items = $this->multiarray_sort($items,
"used_tries; title");
935 foreach ($items as $tst_item) {
936 if (!isset($tst_item[
"used_tries"])) {
939 elseif ($tst_item[
"used_tries"] == 0) {
945 foreach($items as $item)
948 if ($cur_obj_type != $item[
"type"])
950 $class = $objDefinition->getClassName($item[
"type"]);
951 $location = $objDefinition->getLocation($item[
"type"]);
952 $full_class =
"ilObj".$class.
"ListGUI";
953 include_once(
$location.
"/class.".$full_class.
".php");
954 $item_list_gui =
new $full_class();
957 $item_list_gui->enableNotes(
false);
958 $item_list_gui->enableComments(
false);
959 $item_list_gui->enableTags(
false);
961 $item_list_gui->enableIcon(
true);
962 $item_list_gui->enableDelete(
false);
963 $item_list_gui->enableCut(
false);
964 $item_list_gui->enableCopy(
false);
965 $item_list_gui->enableLink(
false);
966 $item_list_gui->enableInfoScreen(
true);
967 $item_list_gui->setContainerObject($this);
971 $item_list_gui->enableCheckbox(
true);
976 $item_list_gui->enableDescription(
false);
977 $item_list_gui->enableProperties(
false);
978 $item_list_gui->enablePreconditions(
false);
979 $item_list_gui->enableNoticeProperties(
false);
983 $item_list_gui->enableCommands(
true,
true);
987 $ilBench->start(
"ilPersonalDesktopGUI",
"getListHTML");
989 include_once
'./Services/Object/classes/class.ilObjectActivation.php';
992 $html = $item_list_gui->getListItemHTML($item[
"ref_id"],
993 $item[
"obj_id"], $item[
"title"], $item[
"description"]);
994 $ilBench->stop(
"ilPersonalDesktopGUI",
"getListHTML");
998 $item_html[] =
array(
1000 "item_ref_id" => $item[
"ref_id"],
1001 "item_obj_id" => $item[
"obj_id"],
1002 'item_icon_image_type' => (method_exists($item_list_gui,
'getIconImageType')) ?
1003 $item_list_gui->getIconImageType() :
1011 if (count($item_html) > 0)
1016 if ($ilSetting->get(
"icon_position_in_lists") ==
"item_rows")
1028 foreach($item_html as $item)
1031 $ilSetting->get(
"icon_position_in_lists") ==
"item_rows")
1034 $this->
addStandardRow(
$tpl, $item[
"html"], $item[
"item_ref_id"], $item[
"item_obj_id"],
1035 $item[
'item_icon_image_type'],
1041 $this->
addStandardRow(
$tpl, $item[
"html"], $item[
"item_ref_id"], $item[
"item_obj_id"],
"", $rel_header);
1061 $items = $ilUser->getDesktopItems();
1062 $item_html =
array();
1065 if (count($items) > 0)
1067 include_once(
"./Services/Object/classes/class.ilObjectListGUIPreloader.php");
1069 foreach($items as $item)
1071 $preloader->addItem($item[
"obj_id"], $item[
"type"], $item[
"ref_id"]);
1073 $preloader->preload();
1077 foreach($items as $item)
1081 if ($cur_obj_type != $item[
"type"])
1090 $item_list_gui->enableNotes(
false);
1091 $item_list_gui->enableComments(
false);
1092 $item_list_gui->enableTags(
false);
1094 $item_list_gui->enableIcon(
true);
1095 $item_list_gui->enableDelete(
false);
1096 $item_list_gui->enableCut(
false);
1097 $item_list_gui->enableCopy(
false);
1098 $item_list_gui->enableLink(
false);
1099 $item_list_gui->enableInfoScreen(
true);
1103 $item_list_gui->enableDescription(
false);
1104 $item_list_gui->enableProperties(
false);
1105 $item_list_gui->enablePreconditions(
false);
1109 $item_list_gui->enableCommands(
true,
true);
1113 $ilBench->start(
"ilPersonalDesktopGUI",
"getListHTML");
1117 $item_list_gui->setContainerObject($this);
1118 $html = $item_list_gui->getListItemHTML($item[
"ref_id"],
1119 $item[
"obj_id"], $item[
"title"], $item[
"description"]);
1120 $ilBench->stop(
"ilPersonalDesktopGUI",
"getListHTML");
1123 $item_html[] =
array(
1125 "item_ref_id" => $item[
"ref_id"],
1126 "item_obj_id" => $item[
"obj_id"],
1127 "parent_ref" => $item[
"parent_ref"],
1128 "type" => $item[
"type"],
1129 'item_icon_image_type' => $item_list_gui->getIconImageType()
1135 if (count($item_html) > 0)
1137 $cur_parent_ref = 0;
1140 foreach($item_html as $item)
1143 if ($cur_parent_ref != $item[
"parent_ref"])
1145 if ($ilSetting->get(
"icon_position_in_lists") ==
"item_rows")
1154 $cur_parent_ref = $item[
"parent_ref"];
1157 $this->
addStandardRow(
$tpl, $item[
"html"], $item[
"item_ref_id"], $item[
"item_obj_id"],
1158 $item[
'item_icon_image_type'],
1159 "th_".$cur_parent_ref);
1170 $this->cur_row_type =
"";
1181 $tpl =
new ilTemplate(
"tpl.pd_list_block.html",
true,
true,
"Services/PersonalDesktop");
1182 $this->cur_row_type =
"";
1191 global $objDefinition;
1193 if (!isset($this->item_list_guis[
$a_type]))
1195 $class = $objDefinition->getClassName($a_type);
1202 $location = $objDefinition->getLocation($a_type);
1208 $full_class =
"ilObj".$class.
"ListGUI";
1210 include_once(
$location.
"/class.".$full_class.
".php");
1211 $item_list_gui =
new $full_class();
1212 $this->item_list_guis[
$a_type] = $item_list_gui;
1216 $item_list_gui = $this->item_list_guis[
$a_type];
1221 $item_list_gui->enableCheckbox(
true);
1225 return $item_list_gui;
1237 global $objDefinition;
1240 if (!$objDefinition->isPlugin(
$a_type))
1246 include_once(
"./Services/Component/classes/class.ilPlugin.php");
1251 $header_id =
"th_".$a_type;
1255 $a_tpl->setCurrentBlock(
"container_header_row_image");
1256 $a_tpl->setVariable(
"HEADER_IMG", $icon);
1257 $a_tpl->setVariable(
"HEADER_ALT",
$title);
1261 $a_tpl->setCurrentBlock(
"container_header_row");
1264 $a_tpl->setVariable(
"BLOCK_HEADER_CONTENT",
$title);
1265 $a_tpl->setVariable(
"BLOCK_HEADER_ID", $header_id);
1266 $a_tpl->parseCurrentBlock();
1267 $a_tpl->touchBlock(
"container_row");
1283 if (!in_array($type,
array(
"lm",
"sahs",
"htlm")))
1293 if ($ilSetting->get(
"custom_icons") &&
1294 in_array($type,
array(
"cat",
"grp",
"crs",
"root")))
1296 require_once(
"./Services/Container/classes/class.ilContainer.php");
1303 if ($tree->getRootId() != $par_id)
1309 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
1313 $title = $this->lng->txt(
"repository");
1341 $a_tpl->setCurrentBlock(
"container_header_row");
1344 $a_tpl->setVariable(
"BLOCK_HEADER_CONTENT",
$title);
1347 $a_tpl->parseCurrentBlock();
1348 $a_tpl->touchBlock(
"container_row");
1359 $a_image_type =
"", $a_related_header =
"")
1363 $this->cur_row_type = ($this->cur_row_type ==
"row_type_1")
1366 $a_tpl->touchBlock($this->cur_row_type);
1368 if ($a_image_type !=
"")
1370 if (!is_array($a_image_type) && !in_array($a_image_type,
array(
"lm",
"htlm",
"sahs")))
1373 $title = $this->lng->txt(
"obj_".$a_image_type);
1378 $title = $this->lng->txt(
"learning_resource");
1382 if ($ilSetting->get(
"custom_icons") &&
1383 in_array($a_image_type,
array(
"cat",
"grp",
"crs")))
1385 require_once(
"./Services/Container/classes/class.ilContainer.php");
1392 $a_tpl->setCurrentBlock(
"block_row_image");
1393 $a_tpl->setVariable(
"ROW_IMG", $icon);
1394 $a_tpl->setVariable(
"ROW_ALT",
$title);
1395 $a_tpl->parseCurrentBlock();
1399 $a_tpl->setVariable(
"ROW_NBSP",
" ");
1401 $a_tpl->setCurrentBlock(
"container_standard_row");
1402 $a_tpl->setVariable(
"BLOCK_ROW_CONTENT", $a_html);
1403 $rel_headers = ($a_related_header !=
"")
1404 ?
"th_selected_items ".$a_related_header
1405 :
"th_selected_items";
1406 $a_tpl->setVariable(
"BLOCK_ROW_HEADERS", $rel_headers);
1407 $a_tpl->parseCurrentBlock();
1408 $a_tpl->touchBlock(
"container_row");
1418 switch((
int)$this->view)
1420 case self::VIEW_MY_MEMBERSHIPS:
1421 $tpl =
new ilTemplate(
'tpl.pd_my_memberships_intro.html',
true,
true,
'Services/PersonalDesktop');
1423 $tpl->setVariable(
'TXT_WELCOME', $lng->txt(
'pd_my_memberships_intro'));
1424 $tpl->setVariable(
'TXT_INTRO_1', $lng->txt(
'pd_my_memberships_intro2'));
1427 case self::VIEW_SELECTED_ITEMS:
1430 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
1434 $title = $lng->txt(
"repository");
1437 $tpl =
new ilTemplate(
"tpl.pd_intro.html",
true,
true,
"Services/PersonalDesktop");
1439 $tpl->setVariable(
"TXT_WELCOME", $lng->txt(
"pdesk_intro"));
1440 $tpl->setVariable(
"TXT_INTRO_1", sprintf($lng->txt(
"pdesk_intro2"), $lng->txt(
"to_desktop")));
1441 include_once(
"./Services/Link/classes/class.ilLink.php");
1442 $tpl->setVariable(
"TXT_INTRO_2", sprintf($lng->txt(
"pdesk_intro3"),
1443 '<a href="'.ilLink::_getStaticLink(1,
'root',
true).
'">'.
$title.
'</a>'));
1444 $tpl->setVariable(
"TXT_INTRO_3", $lng->txt(
"pdesk_intro4"));
1458 $ilUser->writePref(
"pd_order_items",
"location");
1460 if ($ilCtrl->isAsynch())
1467 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view', $this->view);
1468 $ilCtrl->redirectByClass(
"ilpersonaldesktopgui",
"show");
1479 $ilUser->writePref(
"pd_order_items",
"type");
1481 if ($ilCtrl->isAsynch())
1488 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view', $this->view);
1489 $ilCtrl->redirectByClass(
"ilpersonaldesktopgui",
"show");
1499 $this->manage =
true;
1503 $top_tb->setFormAction($ilCtrl->getFormAction($this));
1507 if($this->view == self::VIEW_SELECTED_ITEMS)
1509 $button->setCaption(
"remove");
1513 $button->setCaption(
"pd_unsubscribe_memberships");
1515 $button->setCommand(
"confirmRemove");
1516 $top_tb->addStickyItem($button);
1519 $button2->setCaption(
"cancel");
1520 $button2->setCommand(
"getHTML");
1521 $top_tb->addStickyItem($button2);
1523 $top_tb->setCloseFormTag(
false);
1527 $bot_tb->addStickyItem($button);
1528 $bot_tb->addStickyItem($button2);
1529 $bot_tb->setOpenFormTag(
false);
1531 return $top_tb->getHTML().$this->getHTML().$bot_tb->getHTML();
1538 $ilCtrl->setParameter($this,
'view', $this->view);
1539 if(!
sizeof(
$_POST[
"id"]))
1542 $ilCtrl->redirect($this,
"manage");
1545 if($this->view == self::VIEW_SELECTED_ITEMS)
1547 $question = $this->lng->txt(
"pd_info_delete_sure_remove");
1548 $cmd =
"confirmedRemove";
1552 $question = $this->lng->txt(
"pd_info_delete_sure_unsubscribe");
1553 $cmd =
"confirmedUnsubscribe";
1556 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1558 $cgui->setHeaderText($question);
1560 $cgui->setFormAction($ilCtrl->getFormAction($this));
1561 $cgui->setCancel($this->lng->txt(
"cancel"),
"manage");
1562 $cgui->setConfirm($this->lng->txt(
"confirm"),
$cmd);
1570 $cgui->addItem(
"ref_id[]", $ref_id,
$title,
1572 $this->lng->txt(
"icon").
" ".$this->lng->txt(
"obj_".$type));
1575 return $cgui->getHTML();
1582 if(!
sizeof(
$_POST[
"ref_id"]))
1584 $ilCtrl->redirect($this,
"manage");
1595 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view', $this->view);
1596 $ilCtrl->redirectByClass(
"ilpersonaldesktopgui",
"show");
1603 if(!
sizeof(
$_POST[
"ref_id"]))
1605 $ilCtrl->redirect($this,
"manage");
1610 if($ilAccess->checkAccess(
"leave",
"", $ref_id))
1616 include_once
"Modules/Course/classes/class.ilCourseParticipants.php";
1618 $members->delete($ilUser->getId());
1620 $members->sendUnsubscribeNotificationToAdmins($ilUser->getId());
1621 $members->sendNotification(
1622 $members->NOTIFY_UNSUBSCRIBE,
1629 include_once
"Modules/Group/classes/class.ilGroupParticipants.php";
1631 $members->delete($ilUser->getId());
1633 include_once
'./Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1634 $members->sendNotification(
1638 $members->sendNotification(
1649 include_once
'./Modules/Forum/classes/class.ilForumNotification.php';
1656 $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui',
'view', $this->view);
1657 $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.
static lookupTxtById($plugin_id, $lang_var)
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.
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
static _lookupObjectId($a_ref_id)
lookup object id
static _lookupIconPath($a_id, $a_size="big")
lookup icon path
orderPDItemsByLocation()
order desktop items by location
fillDetailRow()
Fill Detail Setting Row.
Preloader for object list GUIs.
fillDataSection()
Fill data section.
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
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.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
& newBlockTemplate()
returns a new list block template
executeCommand()
execute command
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.