ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilPDSelectedItemsBlockGUI Class Reference

BlockGUI class for Selected Items on Personal Desktop. More...

+ Inheritance diagram for ilPDSelectedItemsBlockGUI:
+ Collaboration diagram for ilPDSelectedItemsBlockGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
 getHTML ()
 
 getFooterLinks ()
 
executeCommand ()
 execute command More...
 
 getContent ()
 
 setContent ($a_content)
 
 fillDataSection ()
 Fill data section. More...
 
 fillFooter ()
 block footer More...
 
 setFooterLinks ()
 Set footer links. More...
 
 getMembershipItemsPerLocation ($tpl)
 Generates the block html string by location ordering. More...
 
 getMembershipItemsPerType ($tpl)
 Generates the block html string by type ordering. More...
 
 getMembershipItemsBlockHTML ()
 Gateway method to distinguish between sorting type. More...
 
 getSelectedItemsBlockHTML ()
 get selected item block More...
 
 getSelectedItemsPerType (&$tpl)
 get selected items per type More...
 
 getSelectedItemsPerLocation (&$tpl)
 get selected items per type More...
 
 resetRowType ()
 
newBlockTemplate ()
 returns a new list block template More...
 
getItemListGUI ($a_type)
 get item list gui class for type More...
 
 addHeaderRow (&$a_tpl, $a_type, $a_show_image=true)
 adds a header row to a block template More...
 
 addParentRow (&$a_tpl, $a_ref_id, $a_show_image=true)
 adds a header row to a block template More...
 
 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 More...
 
 getIntroduction ()
 Get overview. More...
 
 orderPDItemsByLocation ()
 order desktop items by location More...
 
 orderPDItemsByType ()
 order desktop items by Type More...
 
 manageObject ()
 
 confirmRemoveObject ()
 
 confirmedRemove ()
 
 confirmedUnsubscribe ()
 
- Public Member Functions inherited from ilBlockGUI
 ilBlockGUI ()
 Constructor. More...
 
 addHeaderLink ($a_href, $a_text, $status=true)
 
 getHeaderLinks ()
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setBigMode ($a_bigmode)
 Set Big Mode. More...
 
 getBigMode ()
 Get Big Mode. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setAvailableDetailLevels ($a_max, $a_min=0)
 Set Available Detail Levels. More...
 
 setCurrentDetailLevel ($a_currentdetaillevel)
 Set Current Detail Level. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 getCurrentDetailLevel ()
 Get Current Detail Level. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setImage ($a_image)
 Set Image. More...
 
 getImage ()
 Get Image. More...
 
 setOffset ($a_offset)
 Set Offset. More...
 
 getOffset ()
 Get Offset. More...
 
 correctOffset ()
 
 setLimit ($a_limit)
 Set Limit. More...
 
 getLimit ()
 Get Limit. More...
 
 setEnableEdit ($a_enableedit)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode. More...
 
 getRepositoryMode ()
 Get RepositoryMode. More...
 
 setFooterInfo ($a_footerinfo, $a_hide_and_icon=false)
 Set Footer Info. More...
 
 getFooterInfo ($a_hide_and_icon=false)
 Get Footer Info. More...
 
 setSubtitle ($a_subtitle)
 Set Subtitle. More...
 
 getSubtitle ()
 Get Subtitle. More...
 
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true). More...
 
 setAdminCommands ($a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. More...
 
 setColSpan ($a_colspan)
 Set Columns Span. More...
 
 getColSpan ()
 Get Columns Span. More...
 
 setEnableDetailRow ($a_enabledetailrow)
 Set EnableDetailRow. More...
 
 getEnableDetailRow ()
 Get EnableDetailRow. More...
 
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info. More...
 
 getEnableNumInfo ()
 Get Enable Item Number Info. More...
 
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty ($a_property)
 
 setProperty ($a_property, $a_value)
 
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getDetailParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand ($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 addHeaderCommand ($a_href, $a_text, $a_as_close=false)
 Add Header Block Command. More...
 
 getHeaderCommands ()
 Get Header Block commands. More...
 
 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. More...
 
 getFooterLinks ()
 Get footer links. More...
 
 clearFooterLinks ()
 Clear footer links. More...
 
 handleDetailLevel ()
 Handle read/write current detail level. More...
 
 getHTML ()
 Handle config status. More...
 
 fillHeaderCommands ()
 Fill header commands block. More...
 
 fillHeaderTitleBlock ()
 Fill header title block (title and. More...
 
 setDataSection ($a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used. More...
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 fillRow ($a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 Fill previous/next row. More...
 
 setPreviousNextLinks ()
 Get previous/next linkbar. More...
 
 fillFooterLinks ($a_top=false, $a_numinfo="")
 Fill footer links. More...
 
 fillDetailRow ()
 Fill Detail Setting Row. More...
 

Static Public Member Functions

static getBlockType ()
 Get block type. More...
 
static getScreenMode ()
 
static isRepositoryObject ()
 Get block type. More...
 
- Static Public Member Functions inherited from ilBlockGUI
static getBlockType ()
 
static isRepositoryObject ()
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Data Fields

const VIEW_SELECTED_ITEMS = 0
 
const VIEW_MY_MEMBERSHIPS = 1
 
const VIEW_MY_STUDYPROGRAMME = 2
 

Static Public Attributes

static $block_type = "pditems"
 

Protected Member Functions

 getObjectsByMembership ($types=array())
 Gets all objects the current user is member of. More...
 
- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 

Private Attributes

 $view = self::VIEW_SELECTED_ITEMS
 
 $allowed_views = array()
 

Additional Inherited Members

- Protected Attributes inherited from ilBlockGUI
 $data = array()
 
 $colspan = 1
 
 $enablenuminfo = true
 
 $detail_min = 0
 
 $detail_max = 0
 
 $bigmode = false
 
 $footer_links = array()
 
 $block_id = 0
 
 $header_commands = array()
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $enabledetailrow = true
 
 $header_links = array()
 
 $footerinfo = false
 
 $footerinfo_icon = false
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $dropdown
 

Detailed Description

BlockGUI class for Selected Items on Personal Desktop.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilPDSelectedItemsBlockGUI: ilColumnGUI ilPDSelectedItemsBlockGUI: ilCommonActionDispatcherGUI

Definition at line 17 of file class.ilPDSelectedItemsBlockGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPDSelectedItemsBlockGUI::__construct ( )

Constructor.

Definition at line 31 of file class.ilPDSelectedItemsBlockGUI.php.

References $ilCtrl, $ilUser, $lng, ilBlockGUI\fillDetailRow(), ilBlockGUI\setAvailableDetailLevels(), ilBlockGUI\setEnableNumInfo(), and ilBlockGUI\setLimit().

32  {
33  global $ilCtrl, $lng, $ilUser;
34 
35  parent::ilBlockGUI();
36 
37  $lng->loadLanguageModule('pd');
38  $lng->loadLanguageModule('cntr'); // #14158
39 
40  $this->setEnableNumInfo(false);
41  $this->setLimit(99999);
42 // $this->setColSpan(2);
43  $this->setAvailableDetailLevels(3, 1);
44 // $this->setBigMode(true);
45  $this->lng = $lng;
46  $this->allow_moving = false;
47 
48  $this->determineViewSettings();
49  }
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
global $ilCtrl
Definition: ilias.php:18
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
setLimit($a_limit)
Set Limit.
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

Member Function Documentation

◆ addHeaderRow()

ilPDSelectedItemsBlockGUI::addHeaderRow ( $a_tpl,
  $a_type,
  $a_show_image = true 
)

adds a header row to a block template

Parameters
object$a_tplblock template
string$a_typeobject type private

Definition at line 1238 of file class.ilPDSelectedItemsBlockGUI.php.

References ilUtil\getImagePath(), and ilPlugin\lookupTxt().

Referenced by getMembershipItemsPerType(), and getSelectedItemsPerType().

1239  {
1240  global $objDefinition;
1241 
1242  $icon = ilUtil::getImagePath("icon_".$a_type.".svg");
1243  if (!$objDefinition->isPlugin($a_type))
1244  {
1245  $title = $this->lng->txt("objs_".$a_type);
1246  }
1247  else
1248  {
1249  include_once("./Services/Component/classes/class.ilPlugin.php");
1250  $title =
1251  ilPlugin::lookupTxt("rep_robj", $a_type, "objs_".$a_type);
1252 
1253  }
1254  $header_id = "th_".$a_type;
1255 
1256  if ($a_show_image)
1257  {
1258  $a_tpl->setCurrentBlock("container_header_row_image");
1259  $a_tpl->setVariable("HEADER_IMG", $icon);
1260  $a_tpl->setVariable("HEADER_ALT", $title);
1261  }
1262  else
1263  {
1264  $a_tpl->setCurrentBlock("container_header_row");
1265  }
1266 
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");
1271  }
static lookupTxt($a_mod_prefix, $a_pl_id, $a_lang_var)
Lookup language text.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addParentRow()

ilPDSelectedItemsBlockGUI::addParentRow ( $a_tpl,
  $a_ref_id,
  $a_show_image = true 
)

adds a header row to a block template

Parameters
object$a_tplblock template
string$a_typeobject type private

Definition at line 1280 of file class.ilPDSelectedItemsBlockGUI.php.

References $ilSetting, $nd, $path, ilContainer\_lookupIconPath(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), and ilUtil\getImagePath().

Referenced by getMembershipItemsPerLocation(), and getSelectedItemsPerLocation().

1281  {
1282  global $tree, $ilSetting;
1283 
1284  $par_id = ilObject::_lookupObjId($a_ref_id);
1285  $type = ilObject::_lookupType($par_id);
1286  if (!in_array($type, array("lm", "dbk", "sahs", "htlm")))
1287  {
1288  $icon = ilUtil::getImagePath("icon_".$type.".svg");
1289  }
1290  else
1291  {
1292  $icon = ilUtil::getImagePath("icon_lm.svg");
1293  }
1294 
1295  // custom icon
1296  if ($ilSetting->get("custom_icons") &&
1297  in_array($type, array("cat","grp","crs", "root")))
1298  {
1299  require_once("./Services/Container/classes/class.ilContainer.php");
1300  if (($path = ilContainer::_lookupIconPath($par_id, "small")) != "")
1301  {
1302  $icon = $path;
1303  }
1304  }
1305 
1306  if ($tree->getRootId() != $par_id)
1307  {
1308  $title = ilObject::_lookupTitle($par_id);
1309  }
1310  else
1311  {
1312  $nd = $tree->getNodeData(ROOT_FOLDER_ID);
1313  $title = $nd["title"];
1314  if ($title == "ILIAS")
1315  {
1316  $title = $this->lng->txt("repository");
1317  }
1318  }
1319 
1320 /*
1321  $item_list_gui =& $this->getItemListGUI($type);
1322 
1323  $item_list_gui->enableIcon(false);
1324  $item_list_gui->enableDelete(false);
1325  $item_list_gui->enableCut(false);
1326  $item_list_gui->enablePayment(false);
1327  $item_list_gui->enableLink(false);
1328  $item_list_gui->enableDescription(false);
1329  $item_list_gui->enableProperties(false);
1330  $item_list_gui->enablePreconditions(false);
1331  $item_list_gui->enablePath(true);
1332  $item_list_gui->enableCommands(false);
1333  $html = $item_list_gui->getListItemHTML($a_ref_id,
1334  $par_id, $title, "");
1335 
1336  if ($a_show_image)
1337  {
1338  $a_tpl->setCurrentBlock("container_header_row_image");
1339  $a_tpl->setVariable("HEADER_IMG", $icon);
1340  $a_tpl->setVariable("HEADER_ALT", $title);
1341  }
1342 */
1343 // else
1344 // {
1345  $a_tpl->setCurrentBlock("container_header_row");
1346 // }
1347 
1348  $a_tpl->setVariable("BLOCK_HEADER_CONTENT", $title);
1349 /* $a_tpl->setVariable("BLOCK_HEADER_CONTENT", $html);
1350  $a_tpl->setVariable("BLOCK_HEADER_ID", "th_".$a_ref_id);*/
1351  $a_tpl->parseCurrentBlock();
1352  $a_tpl->touchBlock("container_row");
1353  }
static _lookupTitle($a_id)
lookup object title
_lookupIconPath($a_id, $a_size="big")
lookup icon path
$nd
Definition: error.php:11
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
global $ilSetting
Definition: privfeed.php:40
$path
Definition: index.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addStandardRow()

ilPDSelectedItemsBlockGUI::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

Parameters
object$a_tplblock template
string$a_htmlhtml code private

Definition at line 1362 of file class.ilPDSelectedItemsBlockGUI.php.

References $ilSetting, $path, ilContainer\_lookupIconPath(), and ilUtil\getImagePath().

Referenced by getMembershipItemsPerLocation(), getMembershipItemsPerType(), getSelectedItemsPerLocation(), and getSelectedItemsPerType().

1364  {
1365  global $ilSetting;
1366 
1367  $this->cur_row_type = ($this->cur_row_type == "row_type_1")
1368  ? "row_type_2"
1369  : "row_type_1";
1370  $a_tpl->touchBlock($this->cur_row_type);
1371 
1372  if ($a_image_type != "")
1373  {
1374  if (!is_array($a_image_type) && !in_array($a_image_type, array("lm", "dbk", "htlm", "sahs")))
1375  {
1376  $icon = ilUtil::getImagePath("icon_".$a_image_type.".svg");
1377  $title = $this->lng->txt("obj_".$a_image_type);
1378  }
1379  else
1380  {
1381  $icon = ilUtil::getImagePath("icon_lm.svg");
1382  $title = $this->lng->txt("learning_resource");
1383  }
1384 
1385  // custom icon
1386  if ($ilSetting->get("custom_icons") &&
1387  in_array($a_image_type, array("cat","grp","crs")))
1388  {
1389  require_once("./Services/Container/classes/class.ilContainer.php");
1390  if (($path = ilContainer::_lookupIconPath($a_item_obj_id, "small")) != "")
1391  {
1392  $icon = $path;
1393  }
1394  }
1395 
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();
1400  }
1401  else
1402  {
1403  $a_tpl->setVariable("ROW_NBSP", " ");
1404  }
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");
1413  }
_lookupIconPath($a_id, $a_size="big")
lookup icon path
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $ilSetting
Definition: privfeed.php:40
$path
Definition: index.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addToDeskObject()

ilPDSelectedItemsBlockGUI::addToDeskObject ( )
See also
ilDesktopItemHandling::addToDesk()

Implements ilDesktopItemHandling.

Definition at line 69 of file class.ilPDSelectedItemsBlockGUI.php.

References $ilCtrl, $lng, ilDesktopItemGUI\addToDesktop(), and ilUtil\sendSuccess().

70  {
71  global $ilCtrl, $lng;
72 
73  include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
75  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
76  $ilCtrl->setParameterByClass('ilpersonaldesktopgui', 'view', $this->view);
77  $ilCtrl->redirectByClass('ilpersonaldesktopgui', 'show');
78  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static addToDesktop()
Add desktop item public.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ confirmedRemove()

ilPDSelectedItemsBlockGUI::confirmedRemove ( )

Definition at line 1582 of file class.ilPDSelectedItemsBlockGUI.php.

References $_POST, $ilCtrl, $ilUser, $ref_id, ilObjUser\_dropDesktopItem(), ilObject\_lookupType(), and ilUtil\sendSuccess().

1583  {
1584  global $ilCtrl, $ilUser;
1585 
1586  if(!sizeof($_POST["ref_id"]))
1587  {
1588  $ilCtrl->redirect($this, "manage");
1589  }
1590 
1591  foreach($_POST["ref_id"] as $ref_id)
1592  {
1593  $type = ilObject::_lookupType($ref_id, true);
1594  ilObjUser::_dropDesktopItem($ilUser->getId(), $ref_id, $type);
1595  }
1596 
1597  // #12909
1598  ilUtil::sendSuccess($this->lng->txt("pd_remove_multi_confirm"), true);
1599  $ilCtrl->setParameterByClass('ilpersonaldesktopgui', 'view', $this->view);
1600  $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
1601  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
static _dropDesktopItem($a_usr_id, $a_item_id, $a_type)
drop an item from user's personal desktop
static _lookupType($a_id, $a_reference=false)
lookup object type
global $ilUser
Definition: imgupload.php:15
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:

◆ confirmedUnsubscribe()

ilPDSelectedItemsBlockGUI::confirmedUnsubscribe ( )

Definition at line 1603 of file class.ilPDSelectedItemsBlockGUI.php.

References $_POST, $ilCtrl, $ilUser, $ref_id, ilObject\_lookupObjId(), ilObject\_lookupType(), ilForumNotification\checkForumsExistsDelete(), ilUtil\sendSuccess(), ilGroupMembershipMailNotification\TYPE_NOTIFICATION_UNSUBSCRIBE, and ilGroupMembershipMailNotification\TYPE_UNSUBSCRIBE_MEMBER.

1604  {
1605  global $ilCtrl, $ilAccess, $ilUser;
1606 
1607  if(!sizeof($_POST["ref_id"]))
1608  {
1609  $ilCtrl->redirect($this, "manage");
1610  }
1611 
1612  foreach($_POST["ref_id"] as $ref_id)
1613  {
1614  if($ilAccess->checkAccess("leave", "", $ref_id))
1615  {
1616  switch(ilObject::_lookupType($ref_id, true))
1617  {
1618  case "crs":
1619  // see ilObjCourseGUI:performUnsubscribeObject()
1620  include_once "Modules/Course/classes/class.ilCourseParticipants.php";
1621  $members = new ilCourseParticipants(ilObject::_lookupObjId($ref_id));
1622  $members->delete($ilUser->getId());
1623 
1624  $members->sendUnsubscribeNotificationToAdmins($ilUser->getId());
1625  $members->sendNotification(
1626  $members->NOTIFY_UNSUBSCRIBE,
1627  $ilUser->getId()
1628  );
1629  break;
1630 
1631  case "grp":
1632  // see ilObjGroupGUI:performUnsubscribeObject()
1633  include_once "Modules/Group/classes/class.ilGroupParticipants.php";
1634  $members = new ilGroupParticipants(ilObject::_lookupObjId($ref_id));
1635  $members->delete($ilUser->getId());
1636 
1637  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1638  $members->sendNotification(
1640  $ilUser->getId()
1641  );
1642  $members->sendNotification(
1644  $ilUser->getId()
1645  );
1646  break;
1647 
1648  default:
1649  // do nothing
1650  continue;
1651  }
1652 
1653  include_once './Modules/Forum/classes/class.ilForumNotification.php';
1654  ilForumNotification::checkForumsExistsDelete($ref_id, $ilUser->getId());
1655  }
1656  }
1657 
1658 
1659  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
1660  $ilCtrl->setParameterByClass('ilpersonaldesktopgui', 'view', $this->view);
1661  $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
1662  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
static checkForumsExistsDelete($ref_id, $user_id=0)
global $ilUser
Definition: imgupload.php:15
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:

◆ confirmRemoveObject()

ilPDSelectedItemsBlockGUI::confirmRemoveObject ( )

Definition at line 1538 of file class.ilPDSelectedItemsBlockGUI.php.

References $_POST, $cmd, $ilCtrl, $ref_id, ilObject\_getIcon(), ilObject\_lookupObjectId(), ilObject\_lookupTitle(), ilObject\_lookupType(), and ilUtil\sendFailure().

1539  {
1540  global $ilCtrl;
1541 
1542  $ilCtrl->setParameter($this, 'view', $this->view);
1543  if(!sizeof($_POST["id"]))
1544  {
1545  ilUtil::sendFailure($this->lng->txt("select_one"), true);
1546  $ilCtrl->redirect($this, "manage");
1547  }
1548 
1549  if($this->view == self::VIEW_SELECTED_ITEMS)
1550  {
1551  $question = $this->lng->txt("pd_info_delete_sure_remove");
1552  $cmd = "confirmedRemove";
1553  }
1554  else
1555  {
1556  $question = $this->lng->txt("pd_info_delete_sure_unsubscribe");
1557  $cmd = "confirmedUnsubscribe";
1558  }
1559 
1560  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1561  $cgui = new ilConfirmationGUI();
1562  $cgui->setHeaderText($question);
1563 
1564  $cgui->setFormAction($ilCtrl->getFormAction($this));
1565  $cgui->setCancel($this->lng->txt("cancel"), "manage");
1566  $cgui->setConfirm($this->lng->txt("confirm"), $cmd);
1567 
1568  foreach ($_POST["id"] as $ref_id)
1569  {
1570  $obj_id = ilObject::_lookupObjectId($ref_id);
1571  $title = ilObject::_lookupTitle($obj_id);
1572  $type = ilObject::_lookupType($obj_id);
1573 
1574  $cgui->addItem("ref_id[]", $ref_id, $title,
1575  ilObject::_getIcon($obj_id, "small", $type),
1576  $this->lng->txt("icon")." ".$this->lng->txt("obj_".$type));
1577  }
1578 
1579  return $cgui->getHTML();
1580  }
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
$_POST['username']
Definition: cron.php:12
$cmd
Definition: sahs_server.php:35
static _lookupTitle($a_id)
lookup object title
static _lookupObjectId($a_ref_id)
lookup object id
global $ilCtrl
Definition: ilias.php:18
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$ref_id
Definition: sahs_server.php:39
Confirmation screen class.
+ Here is the call graph for this function:

◆ executeCommand()

& ilPDSelectedItemsBlockGUI::executeCommand ( )

execute command

Definition at line 274 of file class.ilPDSelectedItemsBlockGUI.php.

References $cmd, $ilCtrl, and ilCommonActionDispatcherGUI\getInstanceFromAjaxCall().

275  {
276  global $ilCtrl;
277 
278  $next_class = $ilCtrl->getNextClass();
279  $cmd = $ilCtrl->getCmd("getHTML");
280 
281  switch($next_class)
282  {
283  case "ilcommonactiondispatchergui":
284  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
286  $ilCtrl->forwardCommand($gui);
287  break;
288 
289  default:
290  if(method_exists($this, $cmd))
291  {
292  return $this->$cmd();
293  }
294  else
295  {
296  $cmd .= 'Object';
297  return $this->$cmd();
298  }
299  }
300  }
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ fillDataSection()

ilPDSelectedItemsBlockGUI::fillDataSection ( )

Fill data section.

Definition at line 315 of file class.ilPDSelectedItemsBlockGUI.php.

References $ilUser, getContent(), getIntroduction(), and ilBlockGUI\setDataSection().

316  {
317  global $ilUser;
318 
319  if ($this->getContent() != "")
320  {
321  $this->tpl->setVariable("BLOCK_ROW", $this->getContent());
322  }
323  else
324  {
325  $this->setDataSection($this->getIntroduction());
326  }
327  }
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ fillFooter()

ilPDSelectedItemsBlockGUI::fillFooter ( )

block footer

Definition at line 333 of file class.ilPDSelectedItemsBlockGUI.php.

References $ilCtrl, $ilUser, $lng, ilBlockGUI\fillFooterLinks(), ilBlockGUI\getColSpan(), and setFooterLinks().

334  {
335  global $ilCtrl, $lng, $ilUser;
336 
337  $this->setFooterLinks();
338  $this->fillFooterLinks();
339  $this->tpl->setVariable("FCOLSPAN", $this->getColSpan());
340  if ($this->tpl->blockExists("block_footer"))
341  {
342  $this->tpl->setCurrentBlock("block_footer");
343  $this->tpl->parseCurrentBlock();
344  }
345  }
fillFooterLinks($a_top=false, $a_numinfo="")
Fill footer links.
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
getColSpan()
Get Columns Span.
+ Here is the call graph for this function:

◆ getBlockType()

static ilPDSelectedItemsBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

Definition at line 170 of file class.ilPDSelectedItemsBlockGUI.php.

171  {
172  return self::$block_type;
173  }

◆ getContent()

ilPDSelectedItemsBlockGUI::getContent ( )

Definition at line 302 of file class.ilPDSelectedItemsBlockGUI.php.

Referenced by fillDataSection(), getHTML(), and setFooterLinks().

303  {
304  return $this->content;
305  }
+ Here is the caller graph for this function:

◆ getFooterLinks()

ilPDSelectedItemsBlockGUI::getFooterLinks ( )

Definition at line 263 of file class.ilPDSelectedItemsBlockGUI.php.

264  {
265  if((int)$this->view == self::VIEW_MY_STUDYPROGRAMME) {
266  return array();
267  }
268  return parent::getFooterLinks();
269  }

◆ getHTML()

ilPDSelectedItemsBlockGUI::getHTML ( )

Definition at line 206 of file class.ilPDSelectedItemsBlockGUI.php.

References $ilCtrl, $ilDB, $ilSetting, $lng, $tpl, $view, getContent(), getMembershipItemsBlockHTML(), getSelectedItemsBlockHTML(), ilHelpGUI\ID_PART_SCREEN, setContent(), ilBlockGUI\setData(), ilBlockGUI\setEnableDetailRow(), and ilBlockGUI\setTitle().

Referenced by orderPDItemsByLocation(), and orderPDItemsByType().

207  {
208  global $ilCtrl, $ilSetting, $tpl, $lng, $ilHelp, $ilDB;
209 
210  $ilDB->useSlave(true);
211 
212  // workaround to show details row
213  $this->setData(array("dummy"));
214 
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));
219 
220  switch((int)$this->view)
221  {
222  case self::VIEW_MY_MEMBERSHIPS:
223  $ilHelp->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, "crs_grp");
224  if ($ilSetting->get('disable_my_offers') == 0)
225  {
226  $tpl->setTitle($lng->txt("my_courses_groups"));
227  }
228  $this->setTitle($this->lng->txt('pd_my_memberships'));
229  $this->setContent($this->getMembershipItemsBlockHTML());
230  break;
231 
232  case self::VIEW_SELECTED_ITEMS:
233  default:
234  $ilHelp->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, "sel_items");
235  if(!in_array(self::VIEW_MY_MEMBERSHIPS, $this->allowed_views))
236  {
237  $this->setTitle($this->lng->txt('selected_items'));
238  }
239  else
240  {
241  $this->setTitle($this->lng->txt('pd_my_offers'));
242  }
243 
244  $this->setContent($this->getSelectedItemsBlockHTML());
245  break;
246  }
247 
248  if ($this->getContent() == "")
249  {
250  $this->setEnableDetailRow(false);
251  }
252  $ilCtrl->clearParametersByClass("ilpersonaldesktopgui");
253  $ilCtrl->clearParameters($this);
254 
255  $ilDB->useSlave(false);
256 
257  return parent::getHTML();
258  }
getSelectedItemsBlockHTML()
get selected item block
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title)
Set Title.
setData($a_data)
Set Data.
global $ilSetting
Definition: privfeed.php:40
getMembershipItemsBlockHTML()
Gateway method to distinguish between sorting type.
global $lng
Definition: privfeed.php:40
global $ilDB
setEnableDetailRow($a_enabledetailrow)
Set EnableDetailRow.
const ID_PART_SCREEN
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIntroduction()

ilPDSelectedItemsBlockGUI::getIntroduction ( )

Get overview.

Definition at line 1418 of file class.ilPDSelectedItemsBlockGUI.php.

References $ilCtrl, $ilUser, $lng, $nd, $tpl, and ilObject\_getIcon().

Referenced by fillDataSection().

1419  {
1420  global $ilUser, $lng, $ilCtrl, $tree;
1421 
1422  switch((int)$this->view)
1423  {
1424  case self::VIEW_MY_MEMBERSHIPS:
1425  $tpl = new ilTemplate('tpl.pd_my_memberships_intro.html', true, true, 'Services/PersonalDesktop');
1426  $tpl->setVariable('IMG_PD_LARGE', ilObject::_getIcon("", "big", "pd"));
1427  $tpl->setVariable('TXT_WELCOME', $lng->txt('pd_my_memberships_intro'));
1428  $tpl->setVariable('TXT_INTRO_1', $lng->txt('pd_my_memberships_intro2'));
1429  break;
1430 
1431  case self::VIEW_SELECTED_ITEMS:
1432  default:
1433  // get repository link
1434  $nd = $tree->getNodeData(ROOT_FOLDER_ID);
1435  $title = $nd["title"];
1436  if ($title == "ILIAS")
1437  {
1438  $title = $lng->txt("repository");
1439  }
1440 
1441  $tpl = new ilTemplate("tpl.pd_intro.html", true, true, "Services/PersonalDesktop");
1442  $tpl->setVariable('IMG_PD_LARGE', ilObject::_getIcon("", "big", "pd"));
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"));
1449  break;
1450  }
1451 
1452  return $tpl->get();
1453  }
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
$nd
Definition: error.php:11
special template class to simplify handling of ITX/PEAR
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getItemListGUI()

& ilPDSelectedItemsBlockGUI::getItemListGUI (   $a_type)

get item list gui class for type

Definition at line 1192 of file class.ilPDSelectedItemsBlockGUI.php.

References $location.

Referenced by getMembershipItemsPerLocation(), and getSelectedItemsPerLocation().

1193  {
1194  global $objDefinition;
1195  //echo "<br>+$a_type+";
1196  if (!isset($this->item_list_guis[$a_type]))
1197  {
1198  $class = $objDefinition->getClassName($a_type);
1199  // Fixed problem with deactivated plugins and existing repo. object plugin objects on the user's desktop
1200  if(!$class)
1201  {
1202  return NULL;
1203  }
1204  // Fixed problem with deactivated plugins and existing repo. object plugin objects on the user's desktop
1205  $location = $objDefinition->getLocation($a_type);
1206  if(!$location)
1207  {
1208  return NULL;
1209  }
1210 
1211  $full_class = "ilObj".$class."ListGUI";
1212  //echo "<br>-".$location."/class.".$full_class.".php"."-";
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;
1216  }
1217  else
1218  {
1219  $item_list_gui =& $this->item_list_guis[$a_type];
1220  }
1221 
1222  if ($this->manage)
1223  {
1224  $item_list_gui->enableCheckbox(true);
1225  }
1226 
1227 
1228  return $item_list_gui;
1229  }
$location
Definition: buildRTE.php:44
+ Here is the caller graph for this function:

◆ getMembershipItemsBlockHTML()

ilPDSelectedItemsBlockGUI::getMembershipItemsBlockHTML ( )

Gateway method to distinguish between sorting type.

public

Returns
string the generated block html string

Definition at line 821 of file class.ilPDSelectedItemsBlockGUI.php.

References $ilUser, $ok, $tpl, getMembershipItemsPerLocation(), getMembershipItemsPerType(), and newBlockTemplate().

Referenced by getHTML().

822  {
823  global $ilUser;
824 
825  $tpl = $this->newBlockTemplate();
826 
827  switch($ilUser->getPref('pd_order_items'))
828  {
829  case 'location':
831  break;
832 
833  default:
835  break;
836  }
837 
838  return $tpl->get();
839  }
getMembershipItemsPerType($tpl)
Generates the block html string by type ordering.
global $tpl
Definition: ilias.php:8
& newBlockTemplate()
returns a new list block template
global $ilUser
Definition: imgupload.php:15
getMembershipItemsPerLocation($tpl)
Generates the block html string by location ordering.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMembershipItemsPerLocation()

ilPDSelectedItemsBlockGUI::getMembershipItemsPerLocation (   $tpl)

Generates the block html string by location ordering.

public

Parameters
ilTemplate$tplthe current template instance

Definition at line 477 of file class.ilPDSelectedItemsBlockGUI.php.

References $html, $ilBench, $ilSetting, $ilUser, $tpl, ilObjectActivation\addListGUIActivationProperty(), addParentRow(), addStandardRow(), ilObjectListGUI\CONTEXT_PERSONAL_DESKTOP, ilBlockGUI\getCurrentDetailLevel(), getItemListGUI(), getObjectsByMembership(), and resetRowType().

Referenced by getMembershipItemsBlockHTML().

478  {
479  global $ilUser, $rbacsystem, $objDefinition, $ilBench, $ilSetting, $ilObjDataCache, $rbacreview;
480 
481  $output = false;
482  $items = $this->getObjectsByMembership();
483  $item_html = array();
484  if(count($items) > 0)
485  {
486  include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
488  foreach($items as $item)
489  {
490  $preloader->addItem($item["obj_id"], $item["type"], $item["ref_id"]);
491  }
492  $preloader->preload();
493  unset($preloader);
494 
495  reset($items);
496  foreach($items as $item)
497  {
498  //echo "1";
499  // get list gui class for each object type
500  if ($cur_obj_type != $item["type"])
501  {
502  $item_list_gui =& $this->getItemListGUI($item["type"]);
503  if(!$item_list_gui)
504  {
505  continue;
506  }
507 
508  // notes, comment currently do not work properly
509  $item_list_gui->enableNotes(false);
510  $item_list_gui->enableComments(false);
511  $item_list_gui->enableTags(false);
512 
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)
521  {
522  $item_list_gui->enableSubscribe(false);
523  }
524  else
525  {
526  $item_list_gui->enableSubscribe(true);
527  }
528  $item_list_gui->setContainerObject($this);
529  if ($this->getCurrentDetailLevel() < 3 || $this->manage)
530  {
531  //echo "3";
532  $item_list_gui->enableDescription(false);
533  $item_list_gui->enableProperties(false);
534  $item_list_gui->enablePreconditions(false);
535  }
536  if ($this->getCurrentDetailLevel() < 2 || $this->manage)
537  {
538  $item_list_gui->enableCommands(true, true);
539  }
540  }
541  // render item row
542  $ilBench->start("ilPersonalDesktopGUI", "getListHTML");
543 
544  if (is_object($item_list_gui))
545  {
546  ilObjectActivation::addListGUIActivationProperty($item_list_gui, $item);
547 
548  // #15232
549  if($this->manage)
550  {
551  if(!$rbacsystem->checkAccess("leave", $item["ref_id"]))
552  {
553  $item_list_gui->enableCheckbox(false);
554  }
555  else
556  {
557  $item_list_gui->enableCheckbox(true);
558  }
559  }
560 
561  $html = $item_list_gui->getListItemHTML($item["ref_id"],
562  $item["obj_id"], $item["title"], $item["description"]);
563  $ilBench->stop("ilPersonalDesktopGUI", "getListHTML");
564  if ($html != "")
565  {
566  // BEGIN WebDAV: Use $item_list_gui to determine icon image type
567  $item_html[] = array(
568  "html" => $html,
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()
574  );
575  // END WebDAV: Use $item_list_gui to determine icon image type
576  }
577  }
578  }
579 
580  // output block for resource type
581  if (count($item_html) > 0)
582  {
583  $cur_parent_ref = 0;
584 
585  // content row
586  foreach($item_html as $item)
587  {
588  // add a parent header row for each new parent
589  if ($cur_parent_ref != $item["parent_ref"])
590  {
591  if ($ilSetting->get("icon_position_in_lists") == "item_rows")
592  {
593  $this->addParentRow($tpl, $item["parent_ref"], false);
594  }
595  else
596  {
597  $this->addParentRow($tpl, $item["parent_ref"]);
598  }
599  $this->resetRowType();
600  $cur_parent_ref = $item["parent_ref"];
601  }
602 
603  // BEGIN WebDAV: Use $item_list_gui to determine icon image type.
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);
607  // END WebDAV: Use $item_list_gui to determine icon image type.
608  $output = true;
609  }
610  }
611  }
612 
613  return $output;
614  }
getObjectsByMembership($types=array())
Gets all objects the current user is member of.
addParentRow(&$a_tpl, $a_ref_id, $a_show_image=true)
adds a header row to a block template
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
global $tpl
Definition: ilias.php:8
Preloader for object list GUIs.
static addListGUIActivationProperty(ilObjectListGUI $a_list_gui, array &$a_item)
Get timing details for list gui.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
global $ilBench
Definition: ilias.php:18
& getItemListGUI($a_type)
get item list gui class for type
$html
Definition: example_001.php:87
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMembershipItemsPerType()

ilPDSelectedItemsBlockGUI::getMembershipItemsPerType (   $tpl)

Generates the block html string by type ordering.

public

Parameters
ilTemplate$tplthe current template instance

Definition at line 622 of file class.ilPDSelectedItemsBlockGUI.php.

References $html, $ilBench, $ilSetting, $ilUser, $location, $t, $tpl, addHeaderRow(), ilObjectActivation\addListGUIActivationProperty(), addStandardRow(), ilObjectListGUI\CONTEXT_PERSONAL_DESKTOP, ilBlockGUI\getCurrentDetailLevel(), getObjectsByMembership(), and resetRowType().

Referenced by getMembershipItemsBlockHTML().

623  {
624  global $ilUser, $rbacsystem, $objDefinition, $ilBench, $ilSetting, $ilObjDataCache;
625 
626  $output = false;
627 
628  $objtype_groups = $objDefinition->getGroupedRepositoryObjectTypes(
629  array("cat", "crs", "grp", "fold"));
630 
631  $types = array();
632  foreach($objtype_groups as $grp => $grpdata)
633  {
634  $types[] = array(
635  "grp" => $grp,
636  "title" => $this->lng->txt("objs_".$grp),
637  "types" => $grpdata["objs"]);
638  }
639 
640  include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
641 
642  foreach ($types as $t)
643  {
644  $type = $t["types"];
645  $title = $t["title"];
646  $grp = $t["grp"];
647 
648  $items = $this->getObjectsByMembership($type);
649 
650  if (count($items) > 0)
651  {
653  foreach($items as $item)
654  {
655  $preloader->addItem($item["obj_id"], $item["type"], $item["ref_id"]);
656  }
657  $preloader->preload();
658  unset($preloader);
659 
660  reset($items);
661 
662 
663  $item_html = array();
664 
665  if ($this->getCurrentDetailLevel() == 3)
666  {
667  $rel_header = "th_".$grp;
668  }
669 
670  $tstCount = 0;
671  $unsetCount = 0;
672  $progressCount = 0;
673  $unsetFlag = 0;
674  $progressFlag = 0;
675  $completedFlag = 0;
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"])) {
680  $unsetCount++;
681  }
682  elseif ($tst_item["used_tries"] == 0) {
683  $progressCount++;
684  }
685  }
686  }
687 
688  foreach($items as $item)
689  {
690  // get list gui class for each object type
691  if ($cur_obj_type != $item["type"])
692  {
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();
698 
699  // notes, comment currently do not work properly
700  $item_list_gui->enableNotes(false);
701  $item_list_gui->enableComments(false);
702  $item_list_gui->enableTags(false);
703 
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)
712  {
713  $item_list_gui->enableSubscribe(false);
714  }
715  else
716  {
717  $item_list_gui->enableSubscribe(true);
718  }
719 
720  $item_list_gui->setContainerObject($this);
721  if ($this->manage)
722  {
723  $item_list_gui->enableCheckbox(true);
724  }
725  if ($this->getCurrentDetailLevel() < 3 || $this->manage)
726  {
727  $item_list_gui->enableDescription(false);
728  $item_list_gui->enableProperties(false);
729  $item_list_gui->enablePreconditions(false);
730  $item_list_gui->enableNoticeProperties(false);
731  }
732  if ($this->getCurrentDetailLevel() < 2 || $this->manage)
733  {
734  $item_list_gui->enableCommands(true, true);
735  }
736  }
737  // render item row
738  $ilBench->start("ilPersonalDesktopGUI", "getListHTML");
739 
740  ilObjectActivation::addListGUIActivationProperty($item_list_gui, $item);
741 
742  // #15232
743  if($this->manage)
744  {
745  if(!$rbacsystem->checkAccess("leave", $item["ref_id"]))
746  {
747  $item_list_gui->enableCheckbox(false);
748  }
749  else
750  {
751  $item_list_gui->enableCheckbox(true);
752  }
753  }
754 
755  $html = $item_list_gui->getListItemHTML($item["ref_id"],
756  $item["obj_id"], $item["title"], $item["description"]);
757  $ilBench->stop("ilPersonalDesktopGUI", "getListHTML");
758  if ($html != "")
759  {
760  // BEGIN WebDAV: Use $item_list_gui to determine icon image type
761  $item_html[] = array(
762  "html" => $html,
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() :
767  $item['type']
768  );
769  // END WebDAV: Use $item_list_gui to determine icon image type
770  }
771  }
772 
773  // output block for resource type
774  if (count($item_html) > 0)
775  {
776  // add a header for each resource type
777  if ($this->getCurrentDetailLevel() == 3)
778  {
779  if ($ilSetting->get("icon_position_in_lists") == "item_rows")
780  {
781  $this->addHeaderRow($tpl, $grp, false);
782  }
783  else
784  {
785  $this->addHeaderRow($tpl, $grp);
786  }
787  $this->resetRowType();
788  }
789 
790  // content row
791  foreach($item_html as $item)
792  {
793  if ($this->getCurrentDetailLevel() < 3 ||
794  $ilSetting->get("icon_position_in_lists") == "item_rows")
795  {
796  // BEGIN WebDAV: Use $item_list_gui to determine icon image type
797  $this->addStandardRow($tpl, $item["html"], $item["item_ref_id"], $item["item_obj_id"],
798  $item['item_icon_image_type'],
799  $rel_header);
800  // END WebDAV: Use $item_list_gui to determine icon image type
801  }
802  else
803  {
804  $this->addStandardRow($tpl, $item["html"], $item["item_ref_id"], $item["item_obj_id"], "", $rel_header);
805  }
806  $output = true;
807  }
808  }
809  }
810  }
811 
812  return $output;
813  }
$location
Definition: buildRTE.php:44
getObjectsByMembership($types=array())
Gets all objects the current user is member of.
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
global $tpl
Definition: ilias.php:8
Preloader for object list GUIs.
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.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
global $ilBench
Definition: ilias.php:18
$html
Definition: example_001.php:87
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getObjectsByMembership()

ilPDSelectedItemsBlockGUI::getObjectsByMembership (   $types = array())
protected

Gets all objects the current user is member of.

protected

Returns
Array $items array of objects

Definition at line 410 of file class.ilPDSelectedItemsBlockGUI.php.

References $ilUser, $ref_id, ilObject\_getAllReferences(), and ilParticipants\_getMembershipByType().

Referenced by getMembershipItemsPerLocation(), and getMembershipItemsPerType().

411  {
412  global $tree, $ilUser, $ilObjDataCache;
413 
414  include_once 'Services/Membership/classes/class.ilParticipants.php';
415  $items = array();
416 
417  if(is_array($types) && count($types))
418  {
419  foreach($types as $type)
420  {
421  switch($type)
422  {
423  case 'grp':
424  $items = array_merge(ilParticipants::_getMembershipByType($ilUser->getId(), 'grp'), $items);
425  break;
426  case 'crs':
427  $items = array_merge(ilParticipants::_getMembershipByType($ilUser->getId(), 'crs'), $items);
428  break;
429  default:
430  break;
431  }
432  }
433  }
434  else
435  {
436  $crs_mbs = ilParticipants::_getMembershipByType($ilUser->getId(), 'crs');
437  $grp_mbs = ilParticipants::_getMembershipByType($ilUser->getId(), 'grp');
438  $items = array_merge($crs_mbs, $grp_mbs);
439  }
440 
441  $references = array();
442  foreach($items as $key => $obj_id)
443  {
444  $item_references = ilObject::_getAllReferences($obj_id);
445  foreach($item_references as $ref_id)
446  {
447  if($tree->isInTree($ref_id))
448  {
449  $title = $ilObjDataCache->lookupTitle($obj_id);
450  $type = $ilObjDataCache->lookupType($obj_id);
451 
452  $parent_ref_id = $tree->getParentId($ref_id);
453  $par_left = $tree->getLeftValue($parent_ref_id);
454  $par_left = sprintf("%010d", $par_left);
455 
456  $references[$par_left . $title . $ref_id] = array(
457  'ref_id' => $ref_id,
458  'obj_id' => $obj_id,
459  'type' => $type,
460  'title' => $title,
461  'description' => $ilObjDataCache->lookupDescription($obj_id),
462  'parent_ref' => $parent_ref_id
463  );
464  }
465  }
466  }
467  ksort($references);
468  return is_array($references) ? $references : array();
469  }
static _getMembershipByType($a_usr_id, $a_type, $a_only_member_role=false)
get membership by type Get course or group membership
static _getAllReferences($a_id)
get all reference ids of object
global $ilUser
Definition: imgupload.php:15
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilPDSelectedItemsBlockGUI::getScreenMode ( )
static

Definition at line 175 of file class.ilPDSelectedItemsBlockGUI.php.

References $_GET, $_POST, $cmd, IL_SCREEN_FULL, and IL_SCREEN_SIDE.

176  {
177  $cmd = $_GET["cmd"];
178  if($cmd == "post")
179  {
180  $cmd = $_POST["cmd"];
181  $cmd = array_shift(array_keys($cmd));
182  }
183 
184  switch($cmd)
185  {
186  case "confirmRemove":
187  case "manage":
188  return IL_SCREEN_FULL;
189 
190  default:
191  return IL_SCREEN_SIDE;
192  }
193  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
const IL_SCREEN_FULL
const IL_SCREEN_SIDE

◆ getSelectedItemsBlockHTML()

ilPDSelectedItemsBlockGUI::getSelectedItemsBlockHTML ( )

get selected item block

Definition at line 844 of file class.ilPDSelectedItemsBlockGUI.php.

References $ilBench, $ilUser, $ok, $tpl, getSelectedItemsPerLocation(), getSelectedItemsPerType(), and newBlockTemplate().

Referenced by getHTML().

845  {
846  global $ilUser, $rbacsystem, $objDefinition, $ilBench;
847 
848  $tpl =& $this->newBlockTemplate();
849 
850  switch ($ilUser->getPref("pd_order_items"))
851  {
852  case "location":
854  break;
855 
856  default:
857  $ok = $this->getSelectedItemsPerType($tpl);
858  break;
859  }
860 
861  if($this->manage)
862  {
863  // #11355 - see ContainerContentGUI::renderSelectAllBlock()
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();
870  }
871 
872  return $tpl->get();
873  }
getSelectedItemsPerType(&$tpl)
get selected items per type
global $tpl
Definition: ilias.php:8
getSelectedItemsPerLocation(&$tpl)
get selected items per type
& newBlockTemplate()
returns a new list block template
global $ilUser
Definition: imgupload.php:15
global $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectedItemsPerLocation()

ilPDSelectedItemsBlockGUI::getSelectedItemsPerLocation ( $tpl)

get selected items per type

Definition at line 1057 of file class.ilPDSelectedItemsBlockGUI.php.

References $html, $ilBench, $ilSetting, $ilUser, $tpl, ilObjectActivation\addListGUIActivationProperty(), addParentRow(), addStandardRow(), ilObjectListGUI\CONTEXT_PERSONAL_DESKTOP, ilBlockGUI\getCurrentDetailLevel(), getItemListGUI(), and resetRowType().

Referenced by getSelectedItemsBlockHTML().

1058  {
1059  global $ilUser, $rbacsystem, $objDefinition, $ilBench, $ilSetting, $ilObjDataCache, $tree;
1060 
1061  $output = false;
1062 
1063  $items = $ilUser->getDesktopItems();
1064  $item_html = array();
1065  $cur_obj_type = "";
1066 
1067  if (count($items) > 0)
1068  {
1069  include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
1071  foreach($items as $item)
1072  {
1073  $preloader->addItem($item["obj_id"], $item["type"], $item["ref_id"]);
1074  }
1075  $preloader->preload();
1076  unset($preloader);
1077 
1078  reset($items);
1079  foreach($items as $item)
1080  {
1081  //echo "1";
1082  // get list gui class for each object type
1083  if ($cur_obj_type != $item["type"])
1084  {
1085  $item_list_gui =& $this->getItemListGUI($item["type"]);
1086  if(!$item_list_gui)
1087  {
1088  continue;
1089  }
1090 
1091  // notes, comment currently do not work properly
1092  $item_list_gui->enableNotes(false);
1093  $item_list_gui->enableComments(false);
1094  $item_list_gui->enableTags(false);
1095 
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);
1103  if ($this->getCurrentDetailLevel() < 3 || $this->manage)
1104  {
1105  //echo "3";
1106  $item_list_gui->enableDescription(false);
1107  $item_list_gui->enableProperties(false);
1108  $item_list_gui->enablePreconditions(false);
1109  }
1110  if ($this->getCurrentDetailLevel() < 2 || $this->manage)
1111  {
1112  $item_list_gui->enableCommands(true, true);
1113  }
1114  }
1115  // render item row
1116  $ilBench->start("ilPersonalDesktopGUI", "getListHTML");
1117 
1118  ilObjectActivation::addListGUIActivationProperty($item_list_gui, $item);
1119 
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");
1124  if ($html != "")
1125  {
1126  $item_html[] = array(
1127  "html" => $html,
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()
1133  );
1134  }
1135  }
1136 
1137  // output block for resource type
1138  if (count($item_html) > 0)
1139  {
1140  $cur_parent_ref = 0;
1141 
1142  // content row
1143  foreach($item_html as $item)
1144  {
1145  // add a parent header row for each new parent
1146  if ($cur_parent_ref != $item["parent_ref"])
1147  {
1148  if ($ilSetting->get("icon_position_in_lists") == "item_rows")
1149  {
1150  $this->addParentRow($tpl, $item["parent_ref"], false);
1151  }
1152  else
1153  {
1154  $this->addParentRow($tpl, $item["parent_ref"]);
1155  }
1156  $this->resetRowType();
1157  $cur_parent_ref = $item["parent_ref"];
1158  }
1159 
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);
1163  $output = true;
1164  }
1165  }
1166  }
1167 
1168  return $output;
1169  }
addParentRow(&$a_tpl, $a_ref_id, $a_show_image=true)
adds a header row to a block template
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
global $tpl
Definition: ilias.php:8
Preloader for object list GUIs.
static addListGUIActivationProperty(ilObjectListGUI $a_list_gui, array &$a_item)
Get timing details for list gui.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
global $ilBench
Definition: ilias.php:18
& getItemListGUI($a_type)
get item list gui class for type
$html
Definition: example_001.php:87
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectedItemsPerType()

ilPDSelectedItemsBlockGUI::getSelectedItemsPerType ( $tpl)

get selected items per type

Definition at line 878 of file class.ilPDSelectedItemsBlockGUI.php.

References $html, $ilBench, $ilCtrl, $ilSetting, $ilUser, $location, $t, $tpl, addHeaderRow(), ilObjectActivation\addListGUIActivationProperty(), addStandardRow(), ilObjectListGUI\CONTEXT_PERSONAL_DESKTOP, ilBlockGUI\getCurrentDetailLevel(), and resetRowType().

Referenced by getSelectedItemsBlockHTML().

879  {
880  global $ilUser, $rbacsystem, $objDefinition, $ilBench, $ilSetting, $ilObjDataCache, $tree, $ilCtrl;
881 
882  $items = $ilUser->getDesktopItems();
883  if (count($items) > 0)
884  {
885  include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
887  foreach($items as $item)
888  {
889  $preloader->addItem($item["obj_id"], $item["type"], $item["ref_id"]);
890  }
891  $preloader->preload();
892  unset($preloader);
893 
894  reset($items);
895  }
896 
897  $output = false;
898 
899  $objtype_groups = $objDefinition->getGroupedRepositoryObjectTypes(
900  array("cat", "crs", "grp", "fold"));
901 
902  $types = array();
903  foreach($objtype_groups as $grp => $grpdata)
904  {
905  $types[] = array(
906  "grp" => $grp,
907  "title" => $this->lng->txt("objs_".$grp),
908  "types" => $grpdata["objs"]);
909  }
910 
911  foreach ($types as $t)
912  {
913 
914  $type = $t["types"];
915  $title = $t["title"];
916  $grp = $t["grp"];
917 
918  $items = $ilUser->getDesktopItems($type);
919  $item_html = array();
920 
921  if ($this->getCurrentDetailLevel() == 3)
922  {
923  $rel_header = "th_".$grp;
924  }
925 
926  if (count($items) > 0)
927  {
928  $tstCount = 0;
929  $unsetCount = 0;
930  $progressCount = 0;
931  $unsetFlag = 0;
932  $progressFlag = 0;
933  $completedFlag = 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"])) {
938  $unsetCount++;
939  }
940  elseif ($tst_item["used_tries"] == 0) {
941  $progressCount++;
942  }
943  }
944  }
945 
946  foreach($items as $item)
947  {
948  // get list gui class for each object type
949  if ($cur_obj_type != $item["type"])
950  {
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();
956 
957  // notes, comment currently do not work properly
958  $item_list_gui->enableNotes(false);
959  $item_list_gui->enableComments(false);
960  $item_list_gui->enableTags(false);
961 
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);
970 
971  if ($this->manage)
972  {
973  $item_list_gui->enableCheckbox(true);
974  }
975 
976  if ($this->getCurrentDetailLevel() < 3 || $this->manage)
977  {
978  $item_list_gui->enableDescription(false);
979  $item_list_gui->enableProperties(false);
980  $item_list_gui->enablePreconditions(false);
981  $item_list_gui->enableNoticeProperties(false);
982  }
983  if ($this->getCurrentDetailLevel() < 2 || $this->manage)
984  {
985  $item_list_gui->enableCommands(true, true);
986  }
987  }
988  // render item row
989  $ilBench->start("ilPersonalDesktopGUI", "getListHTML");
990 
991  include_once './Services/Object/classes/class.ilObjectActivation.php';
992  ilObjectActivation::addListGUIActivationProperty($item_list_gui, $item);
993 
994  $html = $item_list_gui->getListItemHTML($item["ref_id"],
995  $item["obj_id"], $item["title"], $item["description"]);
996  $ilBench->stop("ilPersonalDesktopGUI", "getListHTML");
997  if ($html != "")
998  {
999  // BEGIN WebDAV: Use $item_list_gui to determine icon image type
1000  $item_html[] = array(
1001  "html" => $html,
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() :
1006  $item['type']
1007  );
1008  // END WebDAV: Use $item_list_gui to determine icon image type
1009  }
1010  }
1011 
1012  // output block for resource type
1013  if (count($item_html) > 0)
1014  {
1015  // add a header for each resource type
1016  if ($this->getCurrentDetailLevel() == 3)
1017  {
1018  if ($ilSetting->get("icon_position_in_lists") == "item_rows")
1019  {
1020  $this->addHeaderRow($tpl, $grp, false);
1021  }
1022  else
1023  {
1024  $this->addHeaderRow($tpl, $grp);
1025  }
1026  $this->resetRowType();
1027  }
1028 
1029  // content row
1030  foreach($item_html as $item)
1031  {
1032  if ($this->getCurrentDetailLevel() < 3 ||
1033  $ilSetting->get("icon_position_in_lists") == "item_rows")
1034  {
1035  // BEGIN WebDAV: Use $item_list_gui to determine icon image type
1036  $this->addStandardRow($tpl, $item["html"], $item["item_ref_id"], $item["item_obj_id"],
1037  $item['item_icon_image_type'],
1038  $rel_header);
1039  // END WebDAV: Use $item_list_gui to determine icon image type
1040  }
1041  else
1042  {
1043  $this->addStandardRow($tpl, $item["html"], $item["item_ref_id"], $item["item_obj_id"], "", $rel_header);
1044  }
1045  $output = true;
1046  }
1047  }
1048  }
1049  }
1050 
1051  return $output;
1052  }
$location
Definition: buildRTE.php:44
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
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
Preloader for object list GUIs.
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.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
global $ilBench
Definition: ilias.php:18
$html
Definition: example_001.php:87
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRepositoryObject()

static ilPDSelectedItemsBlockGUI::isRepositoryObject ( )
static

Get block type.

Returns
string Block type.

Definition at line 200 of file class.ilPDSelectedItemsBlockGUI.php.

201  {
202  return false;
203  }

◆ manageObject()

ilPDSelectedItemsBlockGUI::manageObject ( )

Definition at line 1497 of file class.ilPDSelectedItemsBlockGUI.php.

References $ilCtrl, $ilUser, $lng, ilUtil\getImagePath(), ilSubmitButton\getInstance(), and ilBlockGUI\setAvailableDetailLevels().

1498  {
1499  global $ilUser, $objDefinition, $ilCtrl, $lng;
1500 
1501  $objects = array();
1502 
1503  $this->manage = true;
1504  $this->setAvailableDetailLevels(1, 1);
1505 
1506  $top_tb = new ilToolbarGUI();
1507  $top_tb->setFormAction($ilCtrl->getFormAction($this));
1508  $top_tb->setLeadingImage(ilUtil::getImagePath("arrow_upright.svg"), $lng->txt("actions"));
1509 
1510  $button = ilSubmitButton::getInstance();
1511  if($this->view == self::VIEW_SELECTED_ITEMS)
1512  {
1513  $button->setCaption("remove");
1514  }
1515  else
1516  {
1517  $button->setCaption("pd_unsubscribe_memberships");
1518  }
1519  $button->setCommand("confirmRemove");
1520  $top_tb->addStickyItem($button);
1521 
1522  $button2 = ilSubmitButton::getInstance();
1523  $button2->setCaption("cancel");
1524  $button2->setCommand("getHTML");
1525  $top_tb->addStickyItem($button2);
1526 
1527  $top_tb->setCloseFormTag(false);
1528 
1529  $bot_tb = new ilToolbarGUI();
1530  $bot_tb->setLeadingImage(ilUtil::getImagePath("arrow_downright.svg"), $lng->txt("actions"));
1531  $bot_tb->addStickyItem($button);
1532  $bot_tb->addStickyItem($button2);
1533  $bot_tb->setOpenFormTag(false);
1534 
1535  return $top_tb->getHTML().$this->getHTML().$bot_tb->getHTML();
1536  }
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ newBlockTemplate()

& ilPDSelectedItemsBlockGUI::newBlockTemplate ( )

returns a new list block template

private

Returns
object block template

Definition at line 1182 of file class.ilPDSelectedItemsBlockGUI.php.

References $tpl.

Referenced by getMembershipItemsBlockHTML(), and getSelectedItemsBlockHTML().

1183  {
1184  $tpl = new ilTemplate("tpl.pd_list_block.html", true, true, "Services/PersonalDesktop");
1185  $this->cur_row_type = "";
1186  return $tpl;
1187  }
global $tpl
Definition: ilias.php:8
special template class to simplify handling of ITX/PEAR
+ Here is the caller graph for this function:

◆ orderPDItemsByLocation()

ilPDSelectedItemsBlockGUI::orderPDItemsByLocation ( )

order desktop items by location

Definition at line 1458 of file class.ilPDSelectedItemsBlockGUI.php.

References $ilCtrl, $ilUser, exit, and getHTML().

1459  {
1460  global $ilUser, $ilCtrl;
1461 
1462  $ilUser->writePref("pd_order_items", "location");
1463 
1464  if ($ilCtrl->isAsynch())
1465  {
1466  echo $this->getHTML();
1467  exit;
1468  }
1469  else
1470  {
1471  $ilCtrl->setParameterByClass('ilpersonaldesktopgui', 'view', $this->view);
1472  $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
1473  }
1474  }
exit
Definition: login.php:54
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ orderPDItemsByType()

ilPDSelectedItemsBlockGUI::orderPDItemsByType ( )

order desktop items by Type

Definition at line 1479 of file class.ilPDSelectedItemsBlockGUI.php.

References $ilCtrl, $ilUser, exit, and getHTML().

1480  {
1481  global $ilUser, $ilCtrl;
1482 
1483  $ilUser->writePref("pd_order_items", "type");
1484 
1485  if ($ilCtrl->isAsynch())
1486  {
1487  echo $this->getHTML();
1488  exit;
1489  }
1490  else
1491  {
1492  $ilCtrl->setParameterByClass('ilpersonaldesktopgui', 'view', $this->view);
1493  $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
1494  }
1495  }
exit
Definition: login.php:54
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ removeFromDeskObject()

ilPDSelectedItemsBlockGUI::removeFromDeskObject ( )
See also
ilDesktopItemHandling::removeFromDesk()

Implements ilDesktopItemHandling.

Definition at line 83 of file class.ilPDSelectedItemsBlockGUI.php.

References $_GET, $allowed_views, $ilCtrl, $ilSetting, $lng, $view, ilDesktopItemGUI\removeFromDesktop(), and ilUtil\sendSuccess().

84  {
85  global $ilCtrl, $lng;
86 
87  include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
89  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
90  $ilCtrl->setParameterByClass('ilpersonaldesktopgui', 'view', $this->view);
91  $ilCtrl->redirectByClass('ilpersonaldesktopgui', 'show');
92  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
static removeFromDesktop()
Remove item from personal desktop public.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ resetRowType()

ilPDSelectedItemsBlockGUI::resetRowType ( )

Definition at line 1171 of file class.ilPDSelectedItemsBlockGUI.php.

Referenced by getMembershipItemsPerLocation(), getMembershipItemsPerType(), getSelectedItemsPerLocation(), and getSelectedItemsPerType().

1172  {
1173  $this->cur_row_type = "";
1174  }
+ Here is the caller graph for this function:

◆ setContent()

ilPDSelectedItemsBlockGUI::setContent (   $a_content)

Definition at line 307 of file class.ilPDSelectedItemsBlockGUI.php.

Referenced by getHTML().

308  {
309  $this->content = $a_content;
310  }
+ Here is the caller graph for this function:

◆ setFooterLinks()

ilPDSelectedItemsBlockGUI::setFooterLinks ( )

Set footer links.

Definition at line 350 of file class.ilPDSelectedItemsBlockGUI.php.

References ilBlockGUI\$block_id, $ilCtrl, $ilUser, $lng, ilBlockGUI\addFooterLink(), getContent(), and ilBlockGUI\setEnableNumInfo().

Referenced by fillFooter().

351  {
352  global $ilUser, $ilCtrl, $lng;
353 
354  if ($this->getContent() == "")
355  {
356  $this->setEnableNumInfo(false);
357  return "";
358  }
359 
360  if ($this->manage)
361  {
362  return;
363  }
364 
365  // by type
366 // if ($ilUser->getPref("pd_order_items") == 'location')
367 // {
368  $this->addFooterLink( $lng->txt("by_type"),
369  $ilCtrl->getLinkTarget($this, "orderPDItemsByType"),
370  $ilCtrl->getLinkTarget($this, "orderPDItemsByType", "", true),
371  "block_".$this->getBlockType()."_".$this->block_id,
372  false, false, ($ilUser->getPref("pd_order_items") != 'location')
373  );
374 // }
375 // else
376 // {
377 // $this->addFooterLink($lng->txt("by_type"));
378 // }
379 
380 // // by location
381 // if ($ilUser->getPref("pd_order_items") == 'location')
382 // {
383 // $this->addFooterLink($lng->txt("by_location"));
384 // }
385 // else
386 // {
387  $this->addFooterLink( $lng->txt("by_location"),
388  $ilCtrl->getLinkTarget($this, "orderPDItemsByLocation"),
389  $ilCtrl->getLinkTarget($this, "orderPDItemsByLocation", "", true),
390  "block_".$this->getBlockType()."_".$this->block_id,
391  false, false, ($ilUser->getPref("pd_order_items") == 'location')
392  );
393 // }
394 
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"),
399  null,
400  "block_".$this->getBlockType()."_".$this->block_id
401  );
402  }
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.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $allowed_views

ilPDSelectedItemsBlockGUI::$allowed_views = array()
private

Definition at line 26 of file class.ilPDSelectedItemsBlockGUI.php.

Referenced by removeFromDeskObject().

◆ $block_type

ilPDSelectedItemsBlockGUI::$block_type = "pditems"
static

Definition at line 23 of file class.ilPDSelectedItemsBlockGUI.php.

◆ $view

ilPDSelectedItemsBlockGUI::$view = self::VIEW_SELECTED_ITEMS
private

Definition at line 25 of file class.ilPDSelectedItemsBlockGUI.php.

Referenced by getHTML(), and removeFromDeskObject().

◆ VIEW_MY_MEMBERSHIPS

const ilPDSelectedItemsBlockGUI::VIEW_MY_MEMBERSHIPS = 1

Definition at line 20 of file class.ilPDSelectedItemsBlockGUI.php.

Referenced by ilPersonalDesktopGUI\setTabs().

◆ VIEW_MY_STUDYPROGRAMME

const ilPDSelectedItemsBlockGUI::VIEW_MY_STUDYPROGRAMME = 2

◆ VIEW_SELECTED_ITEMS

const ilPDSelectedItemsBlockGUI::VIEW_SELECTED_ITEMS = 0

Definition at line 19 of file class.ilPDSelectedItemsBlockGUI.php.

Referenced by ilPersonalDesktopGUI\setTabs().


The documentation for this class was generated from the following file: