ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 
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
 

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 30 of file class.ilPDSelectedItemsBlockGUI.php.

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

31  {
32  global $ilCtrl, $lng, $ilUser;
33 
34  parent::ilBlockGUI();
35 
36  $lng->loadLanguageModule('pd');
37  $lng->loadLanguageModule('cntr'); // #14158
38 
39  $this->setEnableNumInfo(false);
40  $this->setLimit(99999);
41 // $this->setColSpan(2);
42  $this->setAvailableDetailLevels(3, 1);
43 // $this->setBigMode(true);
44  $this->lng = $lng;
45  $this->allow_moving = false;
46 
47  $this->determineViewSettings();
48  }
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 1225 of file class.ilPDSelectedItemsBlockGUI.php.

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

Referenced by getMembershipItemsPerType(), and getSelectedItemsPerType().

1226  {
1227  global $objDefinition;
1228 
1229  $icon = ilUtil::getImagePath("icon_".$a_type.".svg");
1230  if (!$objDefinition->isPlugin($a_type))
1231  {
1232  $title = $this->lng->txt("objs_".$a_type);
1233  }
1234  else
1235  {
1236  include_once("./Services/Component/classes/class.ilPlugin.php");
1237  $title =
1238  ilPlugin::lookupTxt("rep_robj", $a_type, "objs_".$a_type);
1239 
1240  }
1241  $header_id = "th_".$a_type;
1242 
1243  if ($a_show_image)
1244  {
1245  $a_tpl->setCurrentBlock("container_header_row_image");
1246  $a_tpl->setVariable("HEADER_IMG", $icon);
1247  $a_tpl->setVariable("HEADER_ALT", $title);
1248  }
1249  else
1250  {
1251  $a_tpl->setCurrentBlock("container_header_row");
1252  }
1253 
1254  $a_tpl->setVariable("BLOCK_HEADER_CONTENT", $title);
1255  $a_tpl->setVariable("BLOCK_HEADER_ID", $header_id);
1256  $a_tpl->parseCurrentBlock();
1257  $a_tpl->touchBlock("container_row");
1258  }
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 1267 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().

1268  {
1269  global $tree, $ilSetting;
1270 
1271  $par_id = ilObject::_lookupObjId($a_ref_id);
1272  $type = ilObject::_lookupType($par_id);
1273  if (!in_array($type, array("lm", "dbk", "sahs", "htlm")))
1274  {
1275  $icon = ilUtil::getImagePath("icon_".$type.".svg");
1276  }
1277  else
1278  {
1279  $icon = ilUtil::getImagePath("icon_lm.svg");
1280  }
1281 
1282  // custom icon
1283  if ($ilSetting->get("custom_icons") &&
1284  in_array($type, array("cat","grp","crs", "root")))
1285  {
1286  require_once("./Services/Container/classes/class.ilContainer.php");
1287  if (($path = ilContainer::_lookupIconPath($par_id, "small")) != "")
1288  {
1289  $icon = $path;
1290  }
1291  }
1292 
1293  if ($tree->getRootId() != $par_id)
1294  {
1295  $title = ilObject::_lookupTitle($par_id);
1296  }
1297  else
1298  {
1299  $nd = $tree->getNodeData(ROOT_FOLDER_ID);
1300  $title = $nd["title"];
1301  if ($title == "ILIAS")
1302  {
1303  $title = $this->lng->txt("repository");
1304  }
1305  }
1306 
1307 /*
1308  $item_list_gui =& $this->getItemListGUI($type);
1309 
1310  $item_list_gui->enableIcon(false);
1311  $item_list_gui->enableDelete(false);
1312  $item_list_gui->enableCut(false);
1313  $item_list_gui->enablePayment(false);
1314  $item_list_gui->enableLink(false);
1315  $item_list_gui->enableDescription(false);
1316  $item_list_gui->enableProperties(false);
1317  $item_list_gui->enablePreconditions(false);
1318  $item_list_gui->enablePath(true);
1319  $item_list_gui->enableCommands(false);
1320  $html = $item_list_gui->getListItemHTML($a_ref_id,
1321  $par_id, $title, "");
1322 
1323  if ($a_show_image)
1324  {
1325  $a_tpl->setCurrentBlock("container_header_row_image");
1326  $a_tpl->setVariable("HEADER_IMG", $icon);
1327  $a_tpl->setVariable("HEADER_ALT", $title);
1328  }
1329 */
1330 // else
1331 // {
1332  $a_tpl->setCurrentBlock("container_header_row");
1333 // }
1334 
1335  $a_tpl->setVariable("BLOCK_HEADER_CONTENT", $title);
1336 /* $a_tpl->setVariable("BLOCK_HEADER_CONTENT", $html);
1337  $a_tpl->setVariable("BLOCK_HEADER_ID", "th_".$a_ref_id);*/
1338  $a_tpl->parseCurrentBlock();
1339  $a_tpl->touchBlock("container_row");
1340  }
static _lookupTitle($a_id)
lookup object title
_lookupIconPath($a_id, $a_size="big")
lookup icon path
$nd
Definition: error.php:9
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 1349 of file class.ilPDSelectedItemsBlockGUI.php.

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

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

1351  {
1352  global $ilSetting;
1353 
1354  $this->cur_row_type = ($this->cur_row_type == "row_type_1")
1355  ? "row_type_2"
1356  : "row_type_1";
1357  $a_tpl->touchBlock($this->cur_row_type);
1358 
1359  if ($a_image_type != "")
1360  {
1361  if (!is_array($a_image_type) && !in_array($a_image_type, array("lm", "dbk", "htlm", "sahs")))
1362  {
1363  $icon = ilUtil::getImagePath("icon_".$a_image_type.".svg");
1364  $title = $this->lng->txt("obj_".$a_image_type);
1365  }
1366  else
1367  {
1368  $icon = ilUtil::getImagePath("icon_lm.svg");
1369  $title = $this->lng->txt("learning_resource");
1370  }
1371 
1372  // custom icon
1373  if ($ilSetting->get("custom_icons") &&
1374  in_array($a_image_type, array("cat","grp","crs")))
1375  {
1376  require_once("./Services/Container/classes/class.ilContainer.php");
1377  if (($path = ilContainer::_lookupIconPath($a_item_obj_id, "small")) != "")
1378  {
1379  $icon = $path;
1380  }
1381  }
1382 
1383  $a_tpl->setCurrentBlock("block_row_image");
1384  $a_tpl->setVariable("ROW_IMG", $icon);
1385  $a_tpl->setVariable("ROW_ALT", $title);
1386  $a_tpl->parseCurrentBlock();
1387  }
1388  else
1389  {
1390  $a_tpl->setVariable("ROW_NBSP", " ");
1391  }
1392  $a_tpl->setCurrentBlock("container_standard_row");
1393  $a_tpl->setVariable("BLOCK_ROW_CONTENT", $a_html);
1394  $rel_headers = ($a_related_header != "")
1395  ? "th_selected_items ".$a_related_header
1396  : "th_selected_items";
1397  $a_tpl->setVariable("BLOCK_ROW_HEADERS", $rel_headers);
1398  $a_tpl->parseCurrentBlock();
1399  $a_tpl->touchBlock("container_row");
1400  }
_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 68 of file class.ilPDSelectedItemsBlockGUI.php.

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

69  {
70  global $ilCtrl, $lng;
71 
72  include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
74  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
75  $ilCtrl->setParameterByClass('ilpersonaldesktopgui', 'view', $this->view);
76  $ilCtrl->redirectByClass('ilpersonaldesktopgui', 'show');
77  }
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 1569 of file class.ilPDSelectedItemsBlockGUI.php.

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

1570  {
1571  global $ilCtrl, $ilUser;
1572 
1573  if(!sizeof($_POST["ref_id"]))
1574  {
1575  $ilCtrl->redirect($this, "manage");
1576  }
1577 
1578  foreach($_POST["ref_id"] as $ref_id)
1579  {
1580  $type = ilObject::_lookupType($ref_id, true);
1581  ilObjUser::_dropDesktopItem($ilUser->getId(), $ref_id, $type);
1582  }
1583 
1584  // #12909
1585  ilUtil::sendSuccess($this->lng->txt("pd_remove_multi_confirm"), true);
1586  $ilCtrl->setParameterByClass('ilpersonaldesktopgui', 'view', $this->view);
1587  $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
1588  }
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 1590 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.

1591  {
1592  global $ilCtrl, $ilAccess, $ilUser;
1593 
1594  if(!sizeof($_POST["ref_id"]))
1595  {
1596  $ilCtrl->redirect($this, "manage");
1597  }
1598 
1599  foreach($_POST["ref_id"] as $ref_id)
1600  {
1601  if($ilAccess->checkAccess("leave", "", $ref_id))
1602  {
1603  switch(ilObject::_lookupType($ref_id, true))
1604  {
1605  case "crs":
1606  // see ilObjCourseGUI:performUnsubscribeObject()
1607  include_once "Modules/Course/classes/class.ilCourseParticipants.php";
1608  $members = new ilCourseParticipants(ilObject::_lookupObjId($ref_id));
1609  $members->delete($ilUser->getId());
1610 
1611  $members->sendUnsubscribeNotificationToAdmins($ilUser->getId());
1612  $members->sendNotification(
1613  $members->NOTIFY_UNSUBSCRIBE,
1614  $ilUser->getId()
1615  );
1616  break;
1617 
1618  case "grp":
1619  // see ilObjGroupGUI:performUnsubscribeObject()
1620  include_once "Modules/Group/classes/class.ilGroupParticipants.php";
1621  $members = new ilGroupParticipants(ilObject::_lookupObjId($ref_id));
1622  $members->delete($ilUser->getId());
1623 
1624  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1625  $members->sendNotification(
1627  $ilUser->getId()
1628  );
1629  $members->sendNotification(
1631  $ilUser->getId()
1632  );
1633  break;
1634 
1635  default:
1636  // do nothing
1637  continue;
1638  }
1639 
1640  include_once './Modules/Forum/classes/class.ilForumNotification.php';
1641  ilForumNotification::checkForumsExistsDelete($ref_id, $ilUser->getId());
1642  }
1643  }
1644 
1645 
1646  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
1647  $ilCtrl->setParameterByClass('ilpersonaldesktopgui', 'view', $this->view);
1648  $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
1649  }
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 1525 of file class.ilPDSelectedItemsBlockGUI.php.

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

1526  {
1527  global $ilCtrl;
1528 
1529  $ilCtrl->setParameter($this, 'view', $this->view);
1530  if(!sizeof($_POST["id"]))
1531  {
1532  ilUtil::sendFailure($this->lng->txt("select_one"), true);
1533  $ilCtrl->redirect($this, "manage");
1534  }
1535 
1536  if($this->view == self::VIEW_SELECTED_ITEMS)
1537  {
1538  $question = $this->lng->txt("pd_info_delete_sure_remove");
1539  $cmd = "confirmedRemove";
1540  }
1541  else
1542  {
1543  $question = $this->lng->txt("pd_info_delete_sure_unsubscribe");
1544  $cmd = "confirmedUnsubscribe";
1545  }
1546 
1547  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1548  $cgui = new ilConfirmationGUI();
1549  $cgui->setHeaderText($question);
1550 
1551  $cgui->setFormAction($ilCtrl->getFormAction($this));
1552  $cgui->setCancel($this->lng->txt("cancel"), "manage");
1553  $cgui->setConfirm($this->lng->txt("confirm"), $cmd);
1554 
1555  foreach ($_POST["id"] as $ref_id)
1556  {
1557  $obj_id = ilObject::_lookupObjectId($ref_id);
1558  $title = ilObject::_lookupTitle($obj_id);
1559  $type = ilObject::_lookupType($obj_id);
1560 
1561  $cgui->addItem("ref_id[]", $ref_id, $title,
1562  ilObject::_getIcon($obj_id, "small", $type),
1563  $this->lng->txt("icon")." ".$this->lng->txt("obj_".$type));
1564  }
1565 
1566  return $cgui->getHTML();
1567  }
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 262 of file class.ilPDSelectedItemsBlockGUI.php.

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

263  {
264  global $ilCtrl;
265 
266  $next_class = $ilCtrl->getNextClass();
267  $cmd = $ilCtrl->getCmd("getHTML");
268 
269  switch($next_class)
270  {
271  case "ilcommonactiondispatchergui":
272  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
274  $ilCtrl->forwardCommand($gui);
275  break;
276 
277  default:
278  if(method_exists($this, $cmd))
279  {
280  return $this->$cmd();
281  }
282  else
283  {
284  $cmd .= 'Object';
285  return $this->$cmd();
286  }
287  }
288  }
$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 303 of file class.ilPDSelectedItemsBlockGUI.php.

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

304  {
305  global $ilUser;
306 
307  if ($this->getContent() != "")
308  {
309  $this->tpl->setVariable("BLOCK_ROW", $this->getContent());
310  }
311  else
312  {
313  $this->setDataSection($this->getIntroduction());
314  }
315  }
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 321 of file class.ilPDSelectedItemsBlockGUI.php.

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

322  {
323  global $ilCtrl, $lng, $ilUser;
324 
325  $this->setFooterLinks();
326  $this->fillFooterLinks();
327  $this->tpl->setVariable("FCOLSPAN", $this->getColSpan());
328  if ($this->tpl->blockExists("block_footer"))
329  {
330  $this->tpl->setCurrentBlock("block_footer");
331  $this->tpl->parseCurrentBlock();
332  }
333  }
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 169 of file class.ilPDSelectedItemsBlockGUI.php.

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

◆ getContent()

ilPDSelectedItemsBlockGUI::getContent ( )

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

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

291  {
292  return $this->content;
293  }
+ Here is the caller graph for this function:

◆ getHTML()

ilPDSelectedItemsBlockGUI::getHTML ( )

Definition at line 205 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().

206  {
207  global $ilCtrl, $ilSetting, $tpl, $lng, $ilHelp, $ilDB;
208 
209  $ilDB->useSlave(true);
210 
211  // workaround to show details row
212  $this->setData(array("dummy"));
213 
214  include_once "Services/Object/classes/class.ilObjectListGUI.php";
215  ilObjectListGUI::prepareJSLinks("",
216  $ilCtrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false),
217  $ilCtrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false));
218 
219  switch((int)$this->view)
220  {
221  case self::VIEW_MY_MEMBERSHIPS:
222  $ilHelp->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, "crs_grp");
223  if ($ilSetting->get('disable_my_offers') == 0)
224  {
225  $tpl->setTitle($lng->txt("my_courses_groups"));
226  }
227  $this->setTitle($this->lng->txt('pd_my_memberships'));
228  $this->setContent($this->getMembershipItemsBlockHTML());
229  break;
230 
231  case self::VIEW_SELECTED_ITEMS:
232  default:
233  $ilHelp->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, "sel_items");
234  if(!in_array(self::VIEW_MY_MEMBERSHIPS, $this->allowed_views))
235  {
236  $this->setTitle($this->lng->txt('selected_items'));
237  }
238  else
239  {
240  $this->setTitle($this->lng->txt('pd_my_offers'));
241  }
242 
243  $this->setContent($this->getSelectedItemsBlockHTML());
244  break;
245  }
246 
247  if ($this->getContent() == "")
248  {
249  $this->setEnableDetailRow(false);
250  }
251  $ilCtrl->clearParametersByClass("ilpersonaldesktopgui");
252  $ilCtrl->clearParameters($this);
253 
254  $ilDB->useSlave(false);
255 
256  return parent::getHTML();
257  }
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 1405 of file class.ilPDSelectedItemsBlockGUI.php.

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

Referenced by fillDataSection().

1406  {
1407  global $ilUser, $lng, $ilCtrl, $tree;
1408 
1409  switch((int)$this->view)
1410  {
1411  case self::VIEW_MY_MEMBERSHIPS:
1412  $tpl = new ilTemplate('tpl.pd_my_memberships_intro.html', true, true, 'Services/PersonalDesktop');
1413  $tpl->setVariable('IMG_PD_LARGE', ilObject::_getIcon("", "big", "pd"));
1414  $tpl->setVariable('TXT_WELCOME', $lng->txt('pd_my_memberships_intro'));
1415  $tpl->setVariable('TXT_INTRO_1', $lng->txt('pd_my_memberships_intro2'));
1416  break;
1417 
1418  case self::VIEW_SELECTED_ITEMS:
1419  default:
1420  // get repository link
1421  $nd = $tree->getNodeData(ROOT_FOLDER_ID);
1422  $title = $nd["title"];
1423  if ($title == "ILIAS")
1424  {
1425  $title = $lng->txt("repository");
1426  }
1427 
1428  $tpl = new ilTemplate("tpl.pd_intro.html", true, true, "Services/PersonalDesktop");
1429  $tpl->setVariable('IMG_PD_LARGE', ilObject::_getIcon("", "big", "pd"));
1430  $tpl->setVariable("TXT_WELCOME", $lng->txt("pdesk_intro"));
1431  $tpl->setVariable("TXT_INTRO_1", sprintf($lng->txt("pdesk_intro2"), $lng->txt("to_desktop")));
1432  include_once("./Services/Link/classes/class.ilLink.php");
1433  $tpl->setVariable("TXT_INTRO_2", sprintf($lng->txt("pdesk_intro3"),
1434  '<a href="'.ilLink::_getStaticLink(1,'root',true).'">'.$title.'</a>'));
1435  $tpl->setVariable("TXT_INTRO_3", $lng->txt("pdesk_intro4"));
1436  break;
1437  }
1438 
1439  return $tpl->get();
1440  }
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:9
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 1179 of file class.ilPDSelectedItemsBlockGUI.php.

References $location.

Referenced by getMembershipItemsPerLocation(), and getSelectedItemsPerLocation().

1180  {
1181  global $objDefinition;
1182  //echo "<br>+$a_type+";
1183  if (!isset($this->item_list_guis[$a_type]))
1184  {
1185  $class = $objDefinition->getClassName($a_type);
1186  // Fixed problem with deactivated plugins and existing repo. object plugin objects on the user's desktop
1187  if(!$class)
1188  {
1189  return NULL;
1190  }
1191  // Fixed problem with deactivated plugins and existing repo. object plugin objects on the user's desktop
1192  $location = $objDefinition->getLocation($a_type);
1193  if(!$location)
1194  {
1195  return NULL;
1196  }
1197 
1198  $full_class = "ilObj".$class."ListGUI";
1199  //echo "<br>-".$location."/class.".$full_class.".php"."-";
1200  include_once($location."/class.".$full_class.".php");
1201  $item_list_gui = new $full_class();
1202  $this->item_list_guis[$a_type] =& $item_list_gui;
1203  }
1204  else
1205  {
1206  $item_list_gui =& $this->item_list_guis[$a_type];
1207  }
1208 
1209  if ($this->manage)
1210  {
1211  $item_list_gui->enableCheckbox(true);
1212  }
1213 
1214 
1215  return $item_list_gui;
1216  }
$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 809 of file class.ilPDSelectedItemsBlockGUI.php.

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

Referenced by getHTML().

810  {
811  global $ilUser;
812 
813  $tpl = $this->newBlockTemplate();
814 
815  switch($ilUser->getPref('pd_order_items'))
816  {
817  case 'location':
819  break;
820 
821  default:
823  break;
824  }
825 
826  return $tpl->get();
827  }
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 465 of file class.ilPDSelectedItemsBlockGUI.php.

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

Referenced by getMembershipItemsBlockHTML().

466  {
467  global $ilUser, $rbacsystem, $objDefinition, $ilBench, $ilSetting, $ilObjDataCache, $rbacreview;
468 
469  $output = false;
470  $items = $this->getObjectsByMembership();
471  $item_html = array();
472  if(count($items) > 0)
473  {
474  include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
476  foreach($items as $item)
477  {
478  $preloader->addItem($item["obj_id"], $item["type"], $item["ref_id"]);
479  }
480  $preloader->preload();
481  unset($preloader);
482 
483  reset($items);
484  foreach($items as $item)
485  {
486  //echo "1";
487  // get list gui class for each object type
488  if ($cur_obj_type != $item["type"])
489  {
490  $item_list_gui =& $this->getItemListGUI($item["type"]);
491  if(!$item_list_gui)
492  {
493  continue;
494  }
495 
496  // notes, comment currently do not work properly
497  $item_list_gui->enableNotes(false);
498  $item_list_gui->enableComments(false);
499  $item_list_gui->enableTags(false);
500 
501  $item_list_gui->enableIcon(true);
502  $item_list_gui->enableDelete(false);
503  $item_list_gui->enableCut(false);
504  $item_list_gui->enableCopy(false);
505  $item_list_gui->enablePayment(false);
506  $item_list_gui->enableLink(false);
507  $item_list_gui->enableInfoScreen(true);
508  if ($ilSetting->get('disable_my_offers') == 1)
509  {
510  $item_list_gui->enableSubscribe(false);
511  }
512  else
513  {
514  $item_list_gui->enableSubscribe(true);
515  }
516  $item_list_gui->setContainerObject($this);
517  if ($this->getCurrentDetailLevel() < 3 || $this->manage)
518  {
519  //echo "3";
520  $item_list_gui->enableDescription(false);
521  $item_list_gui->enableProperties(false);
522  $item_list_gui->enablePreconditions(false);
523  }
524  if ($this->getCurrentDetailLevel() < 2 || $this->manage)
525  {
526  $item_list_gui->enableCommands(true, true);
527  }
528  }
529  // render item row
530  $ilBench->start("ilPersonalDesktopGUI", "getListHTML");
531 
532  if (is_object($item_list_gui))
533  {
534  ilObjectActivation::addListGUIActivationProperty($item_list_gui, $item);
535 
536  // #15232
537  if($this->manage)
538  {
539  if(!$rbacsystem->checkAccess("leave", $item["ref_id"]))
540  {
541  $item_list_gui->enableCheckbox(false);
542  }
543  else
544  {
545  $item_list_gui->enableCheckbox(true);
546  }
547  }
548 
549  $html = $item_list_gui->getListItemHTML($item["ref_id"],
550  $item["obj_id"], $item["title"], $item["description"]);
551  $ilBench->stop("ilPersonalDesktopGUI", "getListHTML");
552  if ($html != "")
553  {
554  // BEGIN WebDAV: Use $item_list_gui to determine icon image type
555  $item_html[] = array(
556  "html" => $html,
557  "item_ref_id" => $item["ref_id"],
558  "item_obj_id" => $item["obj_id"],
559  "parent_ref" => $item["parent_ref"],
560  "type" => $item["type"],
561  'item_icon_image_type' => $item_list_gui->getIconImageType()
562  );
563  // END WebDAV: Use $item_list_gui to determine icon image type
564  }
565  }
566  }
567 
568  // output block for resource type
569  if (count($item_html) > 0)
570  {
571  $cur_parent_ref = 0;
572 
573  // content row
574  foreach($item_html as $item)
575  {
576  // add a parent header row for each new parent
577  if ($cur_parent_ref != $item["parent_ref"])
578  {
579  if ($ilSetting->get("icon_position_in_lists") == "item_rows")
580  {
581  $this->addParentRow($tpl, $item["parent_ref"], false);
582  }
583  else
584  {
585  $this->addParentRow($tpl, $item["parent_ref"]);
586  }
587  $this->resetRowType();
588  $cur_parent_ref = $item["parent_ref"];
589  }
590 
591  // BEGIN WebDAV: Use $item_list_gui to determine icon image type.
592  $this->addStandardRow($tpl, $item["html"], $item["item_ref_id"], $item["item_obj_id"],
593  $item['item_icon_image_type'],
594  "th_".$cur_parent_ref);
595  // END WebDAV: Use $item_list_gui to determine icon image type.
596  $output = true;
597  }
598  }
599  }
600 
601  return $output;
602  }
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
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 610 of file class.ilPDSelectedItemsBlockGUI.php.

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

Referenced by getMembershipItemsBlockHTML().

611  {
612  global $ilUser, $rbacsystem, $objDefinition, $ilBench, $ilSetting, $ilObjDataCache;
613 
614  $output = false;
615 
616  $objtype_groups = $objDefinition->getGroupedRepositoryObjectTypes(
617  array("cat", "crs", "grp", "fold"));
618 
619  $types = array();
620  foreach($objtype_groups as $grp => $grpdata)
621  {
622  $types[] = array(
623  "grp" => $grp,
624  "title" => $this->lng->txt("objs_".$grp),
625  "types" => $grpdata["objs"]);
626  }
627 
628  include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
629 
630  foreach ($types as $t)
631  {
632  $type = $t["types"];
633  $title = $t["title"];
634  $grp = $t["grp"];
635 
636  $items = $this->getObjectsByMembership($type);
637 
638  if (count($items) > 0)
639  {
641  foreach($items as $item)
642  {
643  $preloader->addItem($item["obj_id"], $item["type"], $item["ref_id"]);
644  }
645  $preloader->preload();
646  unset($preloader);
647 
648  reset($items);
649 
650 
651  $item_html = array();
652 
653  if ($this->getCurrentDetailLevel() == 3)
654  {
655  $rel_header = "th_".$grp;
656  }
657 
658  $tstCount = 0;
659  $unsetCount = 0;
660  $progressCount = 0;
661  $unsetFlag = 0;
662  $progressFlag = 0;
663  $completedFlag = 0;
664  if (strcmp($a_type, "tst") == 0) {
665  $items = $this->multiarray_sort($items, "used_tries; title");
666  foreach ($items as $tst_item) {
667  if (!isset($tst_item["used_tries"])) {
668  $unsetCount++;
669  }
670  elseif ($tst_item["used_tries"] == 0) {
671  $progressCount++;
672  }
673  }
674  }
675 
676  foreach($items as $item)
677  {
678  // get list gui class for each object type
679  if ($cur_obj_type != $item["type"])
680  {
681  $class = $objDefinition->getClassName($item["type"]);
682  $location = $objDefinition->getLocation($item["type"]);
683  $full_class = "ilObj".$class."ListGUI";
684  include_once($location."/class.".$full_class.".php");
685  $item_list_gui = new $full_class();
686 
687  // notes, comment currently do not work properly
688  $item_list_gui->enableNotes(false);
689  $item_list_gui->enableComments(false);
690  $item_list_gui->enableTags(false);
691 
692  $item_list_gui->enableIcon(true);
693  $item_list_gui->enableDelete(false);
694  $item_list_gui->enableCut(false);
695  $item_list_gui->enableCopy(false);
696  $item_list_gui->enablePayment(false);
697  $item_list_gui->enableLink(false);
698  $item_list_gui->enableInfoScreen(true);
699  if ($ilSetting->get('disable_my_offers') == 1)
700  {
701  $item_list_gui->enableSubscribe(false);
702  }
703  else
704  {
705  $item_list_gui->enableSubscribe(true);
706  }
707 
708  $item_list_gui->setContainerObject($this);
709  if ($this->manage)
710  {
711  $item_list_gui->enableCheckbox(true);
712  }
713  if ($this->getCurrentDetailLevel() < 3 || $this->manage)
714  {
715  $item_list_gui->enableDescription(false);
716  $item_list_gui->enableProperties(false);
717  $item_list_gui->enablePreconditions(false);
718  $item_list_gui->enableNoticeProperties(false);
719  }
720  if ($this->getCurrentDetailLevel() < 2 || $this->manage)
721  {
722  $item_list_gui->enableCommands(true, true);
723  }
724  }
725  // render item row
726  $ilBench->start("ilPersonalDesktopGUI", "getListHTML");
727 
728  ilObjectActivation::addListGUIActivationProperty($item_list_gui, $item);
729 
730  // #15232
731  if($this->manage)
732  {
733  if(!$rbacsystem->checkAccess("leave", $item["ref_id"]))
734  {
735  $item_list_gui->enableCheckbox(false);
736  }
737  else
738  {
739  $item_list_gui->enableCheckbox(true);
740  }
741  }
742 
743  $html = $item_list_gui->getListItemHTML($item["ref_id"],
744  $item["obj_id"], $item["title"], $item["description"]);
745  $ilBench->stop("ilPersonalDesktopGUI", "getListHTML");
746  if ($html != "")
747  {
748  // BEGIN WebDAV: Use $item_list_gui to determine icon image type
749  $item_html[] = array(
750  "html" => $html,
751  "item_ref_id" => $item["ref_id"],
752  "item_obj_id" => $item["obj_id"],
753  'item_icon_image_type' => (method_exists($item_list_gui, 'getIconImageType')) ?
754  $item_list_gui->getIconImageType() :
755  $item['type']
756  );
757  // END WebDAV: Use $item_list_gui to determine icon image type
758  }
759  }
760 
761  // output block for resource type
762  if (count($item_html) > 0)
763  {
764  // add a header for each resource type
765  if ($this->getCurrentDetailLevel() == 3)
766  {
767  if ($ilSetting->get("icon_position_in_lists") == "item_rows")
768  {
769  $this->addHeaderRow($tpl, $grp, false);
770  }
771  else
772  {
773  $this->addHeaderRow($tpl, $grp);
774  }
775  $this->resetRowType();
776  }
777 
778  // content row
779  foreach($item_html as $item)
780  {
781  if ($this->getCurrentDetailLevel() < 3 ||
782  $ilSetting->get("icon_position_in_lists") == "item_rows")
783  {
784  // BEGIN WebDAV: Use $item_list_gui to determine icon image type
785  $this->addStandardRow($tpl, $item["html"], $item["item_ref_id"], $item["item_obj_id"],
786  $item['item_icon_image_type'],
787  $rel_header);
788  // END WebDAV: Use $item_list_gui to determine icon image type
789  }
790  else
791  {
792  $this->addStandardRow($tpl, $item["html"], $item["item_ref_id"], $item["item_obj_id"], "", $rel_header);
793  }
794  $output = true;
795  }
796  }
797  }
798  }
799 
800  return $output;
801  }
$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
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 398 of file class.ilPDSelectedItemsBlockGUI.php.

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

Referenced by getMembershipItemsPerLocation(), and getMembershipItemsPerType().

399  {
400  global $tree, $ilUser, $ilObjDataCache;
401 
402  include_once 'Services/Membership/classes/class.ilParticipants.php';
403  $items = array();
404 
405  if(is_array($types) && count($types))
406  {
407  foreach($types as $type)
408  {
409  switch($type)
410  {
411  case 'grp':
412  $items = array_merge(ilParticipants::_getMembershipByType($ilUser->getId(), 'grp'), $items);
413  break;
414  case 'crs':
415  $items = array_merge(ilParticipants::_getMembershipByType($ilUser->getId(), 'crs'), $items);
416  break;
417  default:
418  break;
419  }
420  }
421  }
422  else
423  {
424  $crs_mbs = ilParticipants::_getMembershipByType($ilUser->getId(), 'crs');
425  $grp_mbs = ilParticipants::_getMembershipByType($ilUser->getId(), 'grp');
426  $items = array_merge($crs_mbs, $grp_mbs);
427  }
428 
429  $references = array();
430  foreach($items as $key => $obj_id)
431  {
432  $item_references = ilObject::_getAllReferences($obj_id);
433  foreach($item_references as $ref_id)
434  {
435  if($tree->isInTree($ref_id))
436  {
437  $title = $ilObjDataCache->lookupTitle($obj_id);
438  $type = $ilObjDataCache->lookupType($obj_id);
439 
440  $parent_ref_id = $tree->getParentId($ref_id);
441  $par_left = $tree->getLeftValue($parent_ref_id);
442  $par_left = sprintf("%010d", $par_left);
443 
444  $references[$par_left . $title . $ref_id] = array(
445  'ref_id' => $ref_id,
446  'obj_id' => $obj_id,
447  'type' => $type,
448  'title' => $title,
449  'description' => $ilObjDataCache->lookupDescription($obj_id),
450  'parent_ref' => $parent_ref_id
451  );
452  }
453  }
454  }
455  ksort($references);
456  return is_array($references) ? $references : array();
457  }
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 174 of file class.ilPDSelectedItemsBlockGUI.php.

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

175  {
176  $cmd = $_GET["cmd"];
177  if($cmd == "post")
178  {
179  $cmd = $_POST["cmd"];
180  $cmd = array_shift(array_keys($cmd));
181  }
182 
183  switch($cmd)
184  {
185  case "confirmRemove":
186  case "manage":
187  return IL_SCREEN_FULL;
188 
189  default:
190  return IL_SCREEN_SIDE;
191  }
192  }
$_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 832 of file class.ilPDSelectedItemsBlockGUI.php.

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

Referenced by getHTML().

833  {
834  global $ilUser, $rbacsystem, $objDefinition, $ilBench;
835 
836  $tpl =& $this->newBlockTemplate();
837 
838  switch ($ilUser->getPref("pd_order_items"))
839  {
840  case "location":
842  break;
843 
844  default:
845  $ok = $this->getSelectedItemsPerType($tpl);
846  break;
847  }
848 
849  if($this->manage)
850  {
851  // #11355 - see ContainerContentGUI::renderSelectAllBlock()
852  $tpl->setCurrentBlock("select_all_row");
853  $tpl->setVariable("CHECKBOXNAME", "ilToolbarSelectAll");
854  $tpl->setVariable("SEL_ALL_PARENT", "ilToolbar");
855  $tpl->setVariable("SEL_ALL_CB_NAME", "id");
856  $tpl->setVariable("TXT_SELECT_ALL", $this->lng->txt("select_all"));
857  $tpl->parseCurrentBlock();
858  }
859 
860  return $tpl->get();
861  }
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 1044 of file class.ilPDSelectedItemsBlockGUI.php.

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

Referenced by getSelectedItemsBlockHTML().

1045  {
1046  global $ilUser, $rbacsystem, $objDefinition, $ilBench, $ilSetting, $ilObjDataCache, $tree;
1047 
1048  $output = false;
1049 
1050  $items = $ilUser->getDesktopItems();
1051  $item_html = array();
1052  $cur_obj_type = "";
1053 
1054  if (count($items) > 0)
1055  {
1056  include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
1058  foreach($items as $item)
1059  {
1060  $preloader->addItem($item["obj_id"], $item["type"], $item["ref_id"]);
1061  }
1062  $preloader->preload();
1063  unset($preloader);
1064 
1065  reset($items);
1066  foreach($items as $item)
1067  {
1068  //echo "1";
1069  // get list gui class for each object type
1070  if ($cur_obj_type != $item["type"])
1071  {
1072  $item_list_gui =& $this->getItemListGUI($item["type"]);
1073  if(!$item_list_gui)
1074  {
1075  continue;
1076  }
1077 
1078  // notes, comment currently do not work properly
1079  $item_list_gui->enableNotes(false);
1080  $item_list_gui->enableComments(false);
1081  $item_list_gui->enableTags(false);
1082 
1083  $item_list_gui->enableIcon(true);
1084  $item_list_gui->enableDelete(false);
1085  $item_list_gui->enableCut(false);
1086  $item_list_gui->enableCopy(false);
1087  $item_list_gui->enablePayment(false);
1088  $item_list_gui->enableLink(false);
1089  $item_list_gui->enableInfoScreen(true);
1090  if ($this->getCurrentDetailLevel() < 3 || $this->manage)
1091  {
1092  //echo "3";
1093  $item_list_gui->enableDescription(false);
1094  $item_list_gui->enableProperties(false);
1095  $item_list_gui->enablePreconditions(false);
1096  }
1097  if ($this->getCurrentDetailLevel() < 2 || $this->manage)
1098  {
1099  $item_list_gui->enableCommands(true, true);
1100  }
1101  }
1102  // render item row
1103  $ilBench->start("ilPersonalDesktopGUI", "getListHTML");
1104 
1105  ilObjectActivation::addListGUIActivationProperty($item_list_gui, $item);
1106 
1107  $item_list_gui->setContainerObject($this);
1108  $html = $item_list_gui->getListItemHTML($item["ref_id"],
1109  $item["obj_id"], $item["title"], $item["description"]);
1110  $ilBench->stop("ilPersonalDesktopGUI", "getListHTML");
1111  if ($html != "")
1112  {
1113  $item_html[] = array(
1114  "html" => $html,
1115  "item_ref_id" => $item["ref_id"],
1116  "item_obj_id" => $item["obj_id"],
1117  "parent_ref" => $item["parent_ref"],
1118  "type" => $item["type"],
1119  'item_icon_image_type' => $item_list_gui->getIconImageType()
1120  );
1121  }
1122  }
1123 
1124  // output block for resource type
1125  if (count($item_html) > 0)
1126  {
1127  $cur_parent_ref = 0;
1128 
1129  // content row
1130  foreach($item_html as $item)
1131  {
1132  // add a parent header row for each new parent
1133  if ($cur_parent_ref != $item["parent_ref"])
1134  {
1135  if ($ilSetting->get("icon_position_in_lists") == "item_rows")
1136  {
1137  $this->addParentRow($tpl, $item["parent_ref"], false);
1138  }
1139  else
1140  {
1141  $this->addParentRow($tpl, $item["parent_ref"]);
1142  }
1143  $this->resetRowType();
1144  $cur_parent_ref = $item["parent_ref"];
1145  }
1146 
1147  $this->addStandardRow($tpl, $item["html"], $item["item_ref_id"], $item["item_obj_id"],
1148  $item['item_icon_image_type'],
1149  "th_".$cur_parent_ref);
1150  $output = true;
1151  }
1152  }
1153  }
1154 
1155  return $output;
1156  }
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
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 866 of file class.ilPDSelectedItemsBlockGUI.php.

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

Referenced by getSelectedItemsBlockHTML().

867  {
868  global $ilUser, $rbacsystem, $objDefinition, $ilBench, $ilSetting, $ilObjDataCache, $tree, $ilCtrl;
869 
870  $items = $ilUser->getDesktopItems();
871  if (count($items) > 0)
872  {
873  include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
875  foreach($items as $item)
876  {
877  $preloader->addItem($item["obj_id"], $item["type"], $item["ref_id"]);
878  }
879  $preloader->preload();
880  unset($preloader);
881 
882  reset($items);
883  }
884 
885  $output = false;
886 
887  $objtype_groups = $objDefinition->getGroupedRepositoryObjectTypes(
888  array("cat", "crs", "grp", "fold"));
889 
890  $types = array();
891  foreach($objtype_groups as $grp => $grpdata)
892  {
893  $types[] = array(
894  "grp" => $grp,
895  "title" => $this->lng->txt("objs_".$grp),
896  "types" => $grpdata["objs"]);
897  }
898 
899  foreach ($types as $t)
900  {
901 
902  $type = $t["types"];
903  $title = $t["title"];
904  $grp = $t["grp"];
905 
906  $items = $ilUser->getDesktopItems($type);
907  $item_html = array();
908 
909  if ($this->getCurrentDetailLevel() == 3)
910  {
911  $rel_header = "th_".$grp;
912  }
913 
914  if (count($items) > 0)
915  {
916  $tstCount = 0;
917  $unsetCount = 0;
918  $progressCount = 0;
919  $unsetFlag = 0;
920  $progressFlag = 0;
921  $completedFlag = 0;
922  if (strcmp($a_type, "tst") == 0) {
923  $items = $this->multiarray_sort($items, "used_tries; title");
924  foreach ($items as $tst_item) {
925  if (!isset($tst_item["used_tries"])) {
926  $unsetCount++;
927  }
928  elseif ($tst_item["used_tries"] == 0) {
929  $progressCount++;
930  }
931  }
932  }
933 
934  foreach($items as $item)
935  {
936  // get list gui class for each object type
937  if ($cur_obj_type != $item["type"])
938  {
939  $class = $objDefinition->getClassName($item["type"]);
940  $location = $objDefinition->getLocation($item["type"]);
941  $full_class = "ilObj".$class."ListGUI";
942  include_once($location."/class.".$full_class.".php");
943  $item_list_gui = new $full_class();
944 
945  // notes, comment currently do not work properly
946  $item_list_gui->enableNotes(false);
947  $item_list_gui->enableComments(false);
948  $item_list_gui->enableTags(false);
949 
950  $item_list_gui->enableIcon(true);
951  $item_list_gui->enableDelete(false);
952  $item_list_gui->enableCut(false);
953  $item_list_gui->enableCopy(false);
954  $item_list_gui->enablePayment(false);
955  $item_list_gui->enableLink(false);
956  $item_list_gui->enableInfoScreen(true);
957  $item_list_gui->setContainerObject($this);
958 
959  if ($this->manage)
960  {
961  $item_list_gui->enableCheckbox(true);
962  }
963 
964  if ($this->getCurrentDetailLevel() < 3 || $this->manage)
965  {
966  $item_list_gui->enableDescription(false);
967  $item_list_gui->enableProperties(false);
968  $item_list_gui->enablePreconditions(false);
969  $item_list_gui->enableNoticeProperties(false);
970  }
971  if ($this->getCurrentDetailLevel() < 2 || $this->manage)
972  {
973  $item_list_gui->enableCommands(true, true);
974  }
975  }
976  // render item row
977  $ilBench->start("ilPersonalDesktopGUI", "getListHTML");
978 
979  ilObjectActivation::addListGUIActivationProperty($item_list_gui, $item);
980 
981  $html = $item_list_gui->getListItemHTML($item["ref_id"],
982  $item["obj_id"], $item["title"], $item["description"]);
983  $ilBench->stop("ilPersonalDesktopGUI", "getListHTML");
984  if ($html != "")
985  {
986  // BEGIN WebDAV: Use $item_list_gui to determine icon image type
987  $item_html[] = array(
988  "html" => $html,
989  "item_ref_id" => $item["ref_id"],
990  "item_obj_id" => $item["obj_id"],
991  'item_icon_image_type' => (method_exists($item_list_gui, 'getIconImageType')) ?
992  $item_list_gui->getIconImageType() :
993  $item['type']
994  );
995  // END WebDAV: Use $item_list_gui to determine icon image type
996  }
997  }
998 
999  // output block for resource type
1000  if (count($item_html) > 0)
1001  {
1002  // add a header for each resource type
1003  if ($this->getCurrentDetailLevel() == 3)
1004  {
1005  if ($ilSetting->get("icon_position_in_lists") == "item_rows")
1006  {
1007  $this->addHeaderRow($tpl, $grp, false);
1008  }
1009  else
1010  {
1011  $this->addHeaderRow($tpl, $grp);
1012  }
1013  $this->resetRowType();
1014  }
1015 
1016  // content row
1017  foreach($item_html as $item)
1018  {
1019  if ($this->getCurrentDetailLevel() < 3 ||
1020  $ilSetting->get("icon_position_in_lists") == "item_rows")
1021  {
1022  // BEGIN WebDAV: Use $item_list_gui to determine icon image type
1023  $this->addStandardRow($tpl, $item["html"], $item["item_ref_id"], $item["item_obj_id"],
1024  $item['item_icon_image_type'],
1025  $rel_header);
1026  // END WebDAV: Use $item_list_gui to determine icon image type
1027  }
1028  else
1029  {
1030  $this->addStandardRow($tpl, $item["html"], $item["item_ref_id"], $item["item_obj_id"], "", $rel_header);
1031  }
1032  $output = true;
1033  }
1034  }
1035  }
1036  }
1037 
1038  return $output;
1039  }
$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
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 199 of file class.ilPDSelectedItemsBlockGUI.php.

200  {
201  return false;
202  }

◆ manageObject()

ilPDSelectedItemsBlockGUI::manageObject ( )

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

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

1485  {
1486  global $ilUser, $objDefinition, $ilCtrl, $lng;
1487 
1488  $objects = array();
1489 
1490  $this->manage = true;
1491  $this->setAvailableDetailLevels(1, 1);
1492 
1493  $top_tb = new ilToolbarGUI();
1494  $top_tb->setFormAction($ilCtrl->getFormAction($this));
1495  $top_tb->setLeadingImage(ilUtil::getImagePath("arrow_upright.svg"), $lng->txt("actions"));
1496  if($this->view == self::VIEW_SELECTED_ITEMS)
1497  {
1498  $top_tb->addFormButton($lng->txt("remove"), "confirmRemove");
1499  }
1500  else
1501  {
1502  $top_tb->addFormButton($lng->txt("pd_unsubscribe_memberships"), "confirmRemove");
1503  }
1504  $top_tb->addSeparator();
1505  $top_tb->addFormButton($lng->txt("cancel"), "getHTML");
1506  $top_tb->setCloseFormTag(false);
1507 
1508  $bot_tb = new ilToolbarGUI();
1509  $bot_tb->setLeadingImage(ilUtil::getImagePath("arrow_downright.svg"), $lng->txt("actions"));
1510  if($this->view == self::VIEW_SELECTED_ITEMS)
1511  {
1512  $bot_tb->addFormButton($lng->txt("remove"), "confirmRemove");
1513  }
1514  else
1515  {
1516  $bot_tb->addFormButton($lng->txt("pd_unsubscribe_memberships"), "confirmRemove");
1517  }
1518  $bot_tb->addSeparator();
1519  $bot_tb->addFormButton($lng->txt("cancel"), "getHTML");
1520  $bot_tb->setOpenFormTag(false);
1521 
1522  return $top_tb->getHTML().$this->getHTML().$bot_tb->getHTML();
1523  }
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 1169 of file class.ilPDSelectedItemsBlockGUI.php.

References $tpl.

Referenced by getMembershipItemsBlockHTML(), and getSelectedItemsBlockHTML().

1170  {
1171  $tpl = new ilTemplate("tpl.pd_list_block.html", true, true, "Services/PersonalDesktop");
1172  $this->cur_row_type = "";
1173  return $tpl;
1174  }
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 1445 of file class.ilPDSelectedItemsBlockGUI.php.

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

1446  {
1447  global $ilUser, $ilCtrl;
1448 
1449  $ilUser->writePref("pd_order_items", "location");
1450 
1451  if ($ilCtrl->isAsynch())
1452  {
1453  echo $this->getHTML();
1454  exit;
1455  }
1456  else
1457  {
1458  $ilCtrl->setParameterByClass('ilpersonaldesktopgui', 'view', $this->view);
1459  $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
1460  }
1461  }
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 1466 of file class.ilPDSelectedItemsBlockGUI.php.

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

1467  {
1468  global $ilUser, $ilCtrl;
1469 
1470  $ilUser->writePref("pd_order_items", "type");
1471 
1472  if ($ilCtrl->isAsynch())
1473  {
1474  echo $this->getHTML();
1475  exit;
1476  }
1477  else
1478  {
1479  $ilCtrl->setParameterByClass('ilpersonaldesktopgui', 'view', $this->view);
1480  $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
1481  }
1482  }
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 82 of file class.ilPDSelectedItemsBlockGUI.php.

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

83  {
84  global $ilCtrl, $lng;
85 
86  include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
88  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
89  $ilCtrl->setParameterByClass('ilpersonaldesktopgui', 'view', $this->view);
90  $ilCtrl->redirectByClass('ilpersonaldesktopgui', 'show');
91  }
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 1158 of file class.ilPDSelectedItemsBlockGUI.php.

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

1159  {
1160  $this->cur_row_type = "";
1161  }
+ Here is the caller graph for this function:

◆ setContent()

ilPDSelectedItemsBlockGUI::setContent (   $a_content)

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

Referenced by getHTML().

296  {
297  $this->content = $a_content;
298  }
+ Here is the caller graph for this function:

◆ setFooterLinks()

ilPDSelectedItemsBlockGUI::setFooterLinks ( )

Set footer links.

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

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

Referenced by fillFooter().

339  {
340  global $ilUser, $ilCtrl, $lng;
341 
342  if ($this->getContent() == "")
343  {
344  $this->setEnableNumInfo(false);
345  return "";
346  }
347 
348  if ($this->manage)
349  {
350  return;
351  }
352 
353  // by type
354 // if ($ilUser->getPref("pd_order_items") == 'location')
355 // {
356  $this->addFooterLink( $lng->txt("by_type"),
357  $ilCtrl->getLinkTarget($this, "orderPDItemsByType"),
358  $ilCtrl->getLinkTarget($this, "orderPDItemsByType", "", true),
359  "block_".$this->getBlockType()."_".$this->block_id,
360  false, false, ($ilUser->getPref("pd_order_items") != 'location')
361  );
362 // }
363 // else
364 // {
365 // $this->addFooterLink($lng->txt("by_type"));
366 // }
367 
368 // // by location
369 // if ($ilUser->getPref("pd_order_items") == 'location')
370 // {
371 // $this->addFooterLink($lng->txt("by_location"));
372 // }
373 // else
374 // {
375  $this->addFooterLink( $lng->txt("by_location"),
376  $ilCtrl->getLinkTarget($this, "orderPDItemsByLocation"),
377  $ilCtrl->getLinkTarget($this, "orderPDItemsByLocation", "", true),
378  "block_".$this->getBlockType()."_".$this->block_id,
379  false, false, ($ilUser->getPref("pd_order_items") == 'location')
380  );
381 // }
382 
383  $this->addFooterLink(($this->view == self::VIEW_SELECTED_ITEMS) ?
384  $lng->txt("pd_remove_multiple") :
385  $lng->txt("pd_unsubscribe_multiple_memberships"),
386  $ilCtrl->getLinkTarget($this, "manage"),
387  null,
388  "block_".$this->getBlockType()."_".$this->block_id
389  );
390  }
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 25 of file class.ilPDSelectedItemsBlockGUI.php.

Referenced by removeFromDeskObject().

◆ $block_type

ilPDSelectedItemsBlockGUI::$block_type = "pditems"
static

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

◆ $view

ilPDSelectedItemsBlockGUI::$view = self::VIEW_SELECTED_ITEMS
private

Definition at line 24 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_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: