ILIAS  release_4-4 Revision
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

 ilPDSelectedItemsBlockGUI ()
 Constructor. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
 changeView ()
 Method to switch between the different views of personal items block. More...
 
 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)
 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_MY_OFFERS = 0
 
const VIEW_MY_MEMBERSHIPS = 1
 

Static Public Attributes

static $block_type = "pditems"
 

Protected Member Functions

 determineViewSettings ()
 Sets the current view of the user and determines which views are allowed. More...
 
 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_MY_OFFERS
 
 $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.

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

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

Referenced by getMembershipItemsPerType(), and getSelectedItemsPerType().

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

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

Referenced by getMembershipItemsPerLocation(), and getSelectedItemsPerLocation().

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

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

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

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

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

55  {
56  global $ilCtrl, $lng;
57 
58  include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
60  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
61  $ilCtrl->redirectByClass('ilpersonaldesktopgui', 'show');
62  }
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:

◆ changeView()

ilPDSelectedItemsBlockGUI::changeView ( )

Method to switch between the different views of personal items block.

public

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

References $_GET, $ilCtrl, $ilUser, and $view.

84  {
85  global $ilUser, $ilCtrl;
86 
87  if(in_array((int)$_GET['view'], $this->allowed_views))
88  {
89  $ilUser->writePref('pd_view', (int)$_GET['view']);
90  }
91  else
92  {
93  @reset($this->allowed_views);
94  $view = (int)@current($this->allowed_views);
95  $ilUser->writePref('pd_view', $view);
96  }
97 
98  $ilCtrl->redirectByClass('ilpersonaldesktopgui', 'show');
99  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15

◆ confirmedRemove()

ilPDSelectedItemsBlockGUI::confirmedRemove ( )

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

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

1596  {
1597  global $ilCtrl, $ilUser;
1598 
1599  if(!sizeof($_POST["ref_id"]))
1600  {
1601  $ilCtrl->redirect($this, "manage");
1602  }
1603 
1604  foreach($_POST["ref_id"] as $ref_id)
1605  {
1606  $type = ilObject::_lookupType($ref_id, true);
1607  ilObjUser::_dropDesktopItem($ilUser->getId(), $ref_id, $type);
1608  }
1609 
1610  ilUtil::sendSuccess($this->lng->txt("pd_remove_multi_confirm"), true);
1611  $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
1612  }
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 1614 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.

1615  {
1616  global $ilCtrl, $ilAccess, $ilUser;
1617 
1618  if(!sizeof($_POST["ref_id"]))
1619  {
1620  $ilCtrl->redirect($this, "manage");
1621  }
1622 
1623  foreach($_POST["ref_id"] as $ref_id)
1624  {
1625  if($ilAccess->checkAccess("leave", "", $ref_id))
1626  {
1627  switch(ilObject::_lookupType($ref_id, true))
1628  {
1629  case "crs":
1630  // see ilObjCourseGUI:performUnsubscribeObject()
1631  include_once "Modules/Course/classes/class.ilCourseParticipants.php";
1632  $members = new ilCourseParticipants(ilObject::_lookupObjId($ref_id));
1633  $members->delete($ilUser->getId());
1634 
1635  $members->sendUnsubscribeNotificationToAdmins($ilUser->getId());
1636  $members->sendNotification(
1637  $members->NOTIFY_UNSUBSCRIBE,
1638  $ilUser->getId()
1639  );
1640  break;
1641 
1642  case "grp":
1643  // see ilObjGroupGUI:performUnsubscribeObject()
1644  include_once "Modules/Group/classes/class.ilGroupParticipants.php";
1645  $members = new ilGroupParticipants(ilObject::_lookupObjId($ref_id));
1646  $members->delete($ilUser->getId());
1647 
1648  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1649  $members->sendNotification(
1651  $ilUser->getId()
1652  );
1653  $members->sendNotification(
1655  $ilUser->getId()
1656  );
1657  break;
1658 
1659  default:
1660  // do nothing
1661  continue;
1662  }
1663 
1664  include_once './Modules/Forum/classes/class.ilForumNotification.php';
1665  ilForumNotification::checkForumsExistsDelete($ref_id, $ilUser->getId());
1666  }
1667  }
1668 
1669 
1670  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
1671  $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
1672  }
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 1552 of file class.ilPDSelectedItemsBlockGUI.php.

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

1553  {
1554  global $ilCtrl;
1555 
1556  if(!sizeof($_POST["id"]))
1557  {
1558  ilUtil::sendFailure($this->lng->txt("select_one"), true);
1559  $ilCtrl->redirect($this, "manage");
1560  }
1561 
1562  if($this->view == self::VIEW_MY_OFFERS)
1563  {
1564  $question = $this->lng->txt("pd_info_delete_sure_remove");
1565  $cmd = "confirmedRemove";
1566  }
1567  else
1568  {
1569  $question = $this->lng->txt("pd_info_delete_sure_unsubscribe");
1570  $cmd = "confirmedUnsubscribe";
1571  }
1572 
1573  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1574  $cgui = new ilConfirmationGUI();
1575  $cgui->setHeaderText($question);
1576 
1577  $cgui->setFormAction($ilCtrl->getFormAction($this));
1578  $cgui->setCancel($this->lng->txt("cancel"), "manage");
1579  $cgui->setConfirm($this->lng->txt("confirm"), $cmd);
1580 
1581  foreach ($_POST["id"] as $ref_id)
1582  {
1583  $obj_id = ilObject::_lookupObjectId($ref_id);
1584  $title = ilObject::_lookupTitle($obj_id);
1585  $type = ilObject::_lookupType($obj_id);
1586 
1587  $cgui->addItem("ref_id[]", $ref_id, $title,
1588  ilObject::_getIcon($obj_id, "small", $type),
1589  $this->lng->txt("icon")." ".$this->lng->txt("obj_".$type));
1590  }
1591 
1592  return $cgui->getHTML();
1593  }
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:

◆ determineViewSettings()

ilPDSelectedItemsBlockGUI::determineViewSettings ( )
protected

Sets the current view of the user and determines which views are allowed.

protected

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

References $ilSetting, and $ilUser.

Referenced by ilPDSelectedItemsBlockGUI().

107  {
108  global $ilSetting, $ilUser;
109 
110  $this->allowed_views = array();
111 
112  // determine view
113  if($ilSetting->get('disable_my_offers') == 1 &&
114  $ilSetting->get('disable_my_memberships') == 1)
115  {
116  // if both views are disabled set default view (should not occur but we should prevent it)
117  $ilSetting->set('personal_items_default_view', self::VIEW_MY_OFFERS);
118  $this->allowed_views[] = self::VIEW_MY_OFFERS;
119  }
120  // both views are enabled, get default view
121  else if($ilSetting->get('disable_my_offers') == 0 &&
122  $ilSetting->get('disable_my_memberships') == 0)
123  {
124  $this->allowed_views[] = self::VIEW_MY_OFFERS;
125  $this->allowed_views[] = self::VIEW_MY_MEMBERSHIPS;
126  }
127  else if($ilSetting->get('disable_my_offers') == 0 &&
128  $ilSetting->get('disable_my_memberships') == 1)
129  {
130  $this->allowed_views[] = self::VIEW_MY_OFFERS;
131  }
132  else
133  {
134  $this->allowed_views[] = self::VIEW_MY_MEMBERSHIPS;
135  }
136 
137  $this->view = $ilUser->getPref('pd_view');
138  if($this->view === false || !in_array((int)$this->view, $this->allowed_views))
139  {
140  $ilUser->writePref('pd_view', (int)$ilSetting->get('personal_items_default_view'));
141  $this->view = (int)$ilSetting->get('personal_items_default_view');
142  }
143  }
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ executeCommand()

& ilPDSelectedItemsBlockGUI::executeCommand ( )

execute command

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

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

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

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

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

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

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

151  {
152  return self::$block_type;
153  }

◆ getContent()

ilPDSelectedItemsBlockGUI::getContent ( )

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

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

288  {
289  return $this->content;
290  }
+ Here is the caller graph for this function:

◆ getHTML()

ilPDSelectedItemsBlockGUI::getHTML ( )

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

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

Referenced by orderPDItemsByLocation(), and orderPDItemsByType().

187  {
188  global $ilCtrl, $ilSetting, $tpl, $lng, $ilHelp, $ilDB;
189 
190  $ilDB->useSlave(true);
191 
192  // both views are activated (show buttons)
193  if($ilSetting->get('disable_my_offers') == 0 &&
194  $ilSetting->get('disable_my_memberships') == 0)
195  {
196 /* $ilCtrl->setParameter($this, 'block_type', $this->getBlockType());
197  $ilCtrl->setParameter($this, 'view', self::VIEW_MY_OFFERS);
198  $this->addHeaderLink($ilCtrl->getLinkTarget($this, 'changeView'), $this->lng->txt('pd_my_offers'),
199  ($this->view == self::VIEW_MY_OFFERS ? false : true)
200  );
201  $ilCtrl->setParameter($this, 'view', self::VIEW_MY_MEMBERSHIPS);
202  $this->addHeaderLink($ilCtrl->getLinkTarget($this, 'changeView'), $this->lng->txt('pd_my_memberships'),
203  ($this->view == self::VIEW_MY_MEMBERSHIPS ? false : true)
204  );
205  $ilCtrl->clearParameters($this);*/
206  }
207 
208  // workaround to show details row
209  $this->setData(array("dummy"));
210 
211  include_once "Services/Object/classes/class.ilObjectListGUI.php";
212  ilObjectListGUI::prepareJSLinks("",
213  $ilCtrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false),
214  $ilCtrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false));
215 
216  switch((int)$this->view)
217  {
218  case self::VIEW_MY_MEMBERSHIPS:
219  $ilHelp->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, "crs_grp");
220  if ($ilSetting->get('disable_my_offers') == 0)
221  {
222  $tpl->setTitle($lng->txt("my_courses_groups"));
223  }
224  $this->setTitle($this->lng->txt('pd_my_memberships'));
225  $this->setContent($this->getMembershipItemsBlockHTML());
226  break;
227 
228  case self::VIEW_MY_OFFERS:
229  default:
230  $ilHelp->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, "sel_items");
231  if(!in_array(self::VIEW_MY_MEMBERSHIPS, $this->allowed_views))
232  {
233  $this->setTitle($this->lng->txt('selected_items'));
234  }
235  else
236  {
237  $this->setTitle($this->lng->txt('pd_my_offers'));
238  }
239 
240  $this->setContent($this->getSelectedItemsBlockHTML());
241  break;
242  }
243 
244  if ($this->getContent() == "")
245  {
246  $this->setEnableDetailRow(false);
247  }
248  $ilCtrl->clearParametersByClass("ilpersonaldesktopgui");
249  $ilCtrl->clearParameters($this);
250 
251  $ilDB->useSlave(false);
252 
253  return parent::getHTML();
254  }
getSelectedItemsBlockHTML()
get selected item block
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title)
Set Title.
setData($a_data)
Set Data.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
global $ilSetting
Definition: privfeed.php:40
getMembershipItemsBlockHTML()
Gateway method to distinguish between sorting type.
global $lng
Definition: privfeed.php:40
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 1406 of file class.ilPDSelectedItemsBlockGUI.php.

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

Referenced by fillDataSection().

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

References $location.

Referenced by getMembershipItemsPerLocation(), and getSelectedItemsPerLocation().

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

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

Referenced by getHTML().

807  {
808  global $ilUser;
809 
810  $tpl = $this->newBlockTemplate();
811 
812  switch($ilUser->getPref('pd_order_items'))
813  {
814  case 'location':
816  break;
817 
818  default:
820  break;
821  }
822 
823  return $tpl->get();
824  }
getMembershipItemsPerType($tpl)
Generates the block html string by type ordering.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
& 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 462 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().

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

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

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

Referenced by getMembershipItemsPerLocation(), and getMembershipItemsPerType().

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

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

156  {
157  $cmd = $_GET["cmd"];
158  if($cmd == "post")
159  {
160  $cmd = $_POST["cmd"];
161  $cmd = array_shift(array_keys($cmd));
162  }
163 
164  switch($cmd)
165  {
166  case "confirmRemove":
167  case "manage":
168  return IL_SCREEN_FULL;
169 
170  default:
171  return IL_SCREEN_SIDE;
172  }
173  }
$_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 829 of file class.ilPDSelectedItemsBlockGUI.php.

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

Referenced by getHTML().

830  {
831  global $ilUser, $rbacsystem, $objDefinition, $ilBench;
832 
833  $tpl =& $this->newBlockTemplate();
834 
835  switch ($ilUser->getPref("pd_order_items"))
836  {
837  case "location":
839  break;
840 
841  default:
842  $ok = $this->getSelectedItemsPerType($tpl);
843  break;
844  }
845 
846  if($this->manage)
847  {
848  // #11355 - see ContainerContentGUI::renderSelectAllBlock()
849  $tpl->setCurrentBlock("select_all_row");
850  $tpl->setVariable("CHECKBOXNAME", "ilToolbarSelectAll");
851  $tpl->setVariable("SEL_ALL_PARENT", "ilToolbar");
852  $tpl->setVariable("SEL_ALL_CB_NAME", "id");
853  $tpl->setVariable("TXT_SELECT_ALL", $this->lng->txt("select_all"));
854  $tpl->parseCurrentBlock();
855  }
856 
857  return $tpl->get();
858  }
getSelectedItemsPerType(&$tpl)
get selected items per type
getSelectedItemsPerLocation(&$tpl)
get selected items per type
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
& 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 1041 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().

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

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

◆ ilPDSelectedItemsBlockGUI()

ilPDSelectedItemsBlockGUI::ilPDSelectedItemsBlockGUI ( )

Constructor.

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

References $ilCtrl, $ilUser, $lng, determineViewSettings(), 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'); // #14369
38 
39  //$this->setImage(ilUtil::getImagePath("icon_bm_s.png"));
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.
determineViewSettings()
Sets the current view of the user and determines which views are allowed.
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:

◆ isRepositoryObject()

static ilPDSelectedItemsBlockGUI::isRepositoryObject ( )
static

Get block type.

Returns
string Block type.

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

181  {
182  return false;
183  }

◆ manageObject()

ilPDSelectedItemsBlockGUI::manageObject ( )

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

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

1484  {
1485  global $ilUser, $objDefinition, $ilCtrl, $lng;
1486 
1487  $objects = array();
1488 
1489  $this->manage = true;
1490  $this->setAvailableDetailLevels(1, 1);
1491 
1492  $top_tb = new ilToolbarGUI();
1493  $top_tb->setFormAction($ilCtrl->getFormAction($this));
1494  $top_tb->setLeadingImage(ilUtil::getImagePath("arrow_upright.png"), $lng->txt("actions"));
1495  if ($this->view == self::VIEW_MY_OFFERS)
1496  {
1497  $top_tb->addFormButton($lng->txt("remove"), "confirmRemove");
1498  }
1499  else
1500  {
1501  $top_tb->addFormButton($lng->txt("pd_unsubscribe_memberships"), "confirmRemove");
1502  }
1503  $top_tb->addSeparator();
1504  $top_tb->addFormButton($lng->txt("cancel"), "getHTML");
1505  $top_tb->setCloseFormTag(false);
1506 
1507  $bot_tb = new ilToolbarGUI();
1508  $bot_tb->setLeadingImage(ilUtil::getImagePath("arrow_downright.png"), $lng->txt("actions"));
1509  if ($this->view == self::VIEW_MY_OFFERS)
1510  {
1511  $bot_tb->addFormButton($lng->txt("remove"), "confirmRemove");
1512  }
1513  else
1514  {
1515  $bot_tb->addFormButton($lng->txt("pd_unsubscribe_memberships"), "confirmRemove");
1516  }
1517  $bot_tb->addSeparator();
1518  $bot_tb->addFormButton($lng->txt("cancel"), "getHTML");
1519  $bot_tb->setOpenFormTag(false);
1520 
1521  return $top_tb->getHTML().$this->getHTML().$bot_tb->getHTML();
1522 /*
1523  if($this->view == self::VIEW_MY_OFFERS)
1524  {
1525  return $top_tb->getHTML().$this->getHTML().$bot_tb->getHTML();
1526 
1527  foreach($ilUser->getDesktopItems() as $item)
1528  {
1529  $objects[] = $item;
1530  }
1531  }
1532  else
1533  {
1534  $objtype_groups = $objDefinition->getGroupedRepositoryObjectTypes(
1535  array("cat", "crs", "grp", "fold"));
1536 
1537  foreach($objtype_groups as $grpdata)
1538  {
1539  foreach($this->getObjectsByMembership($grpdata["objs"]) as $item)
1540  {
1541  $objects[] = $item;
1542  }
1543  }
1544  }
1545 
1546  include_once "Services/PersonalDesktop/classes/class.ilPDSelectedItemsTableGUI.php";
1547  $tbl = new ilPDSelectedItemsTableGUI($this, "manage", $objects, $this->view, ($ilUser->getPref("pd_order_items") == 'location'));
1548  return $tbl->getHTML();
1549 */
1550  }
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 1170 of file class.ilPDSelectedItemsBlockGUI.php.

References $tpl.

Referenced by getMembershipItemsBlockHTML(), and getSelectedItemsBlockHTML().

1171  {
1172  $tpl = new ilTemplate("tpl.pd_list_block.html", true, true, "Services/PersonalDesktop");
1173  $this->cur_row_type = "";
1174  return $tpl;
1175  }
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
+ Here is the caller graph for this function:

◆ orderPDItemsByLocation()

ilPDSelectedItemsBlockGUI::orderPDItemsByLocation ( )

order desktop items by location

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

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

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

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

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

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

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

◆ setContent()

ilPDSelectedItemsBlockGUI::setContent (   $a_content)

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

Referenced by getHTML().

293  {
294  $this->content = $a_content;
295  }
+ Here is the caller graph for this function:

◆ setFooterLinks()

ilPDSelectedItemsBlockGUI::setFooterLinks ( )

Set footer links.

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

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

Referenced by fillFooter().

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

◆ $block_type

ilPDSelectedItemsBlockGUI::$block_type = "pditems"
static

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

◆ $view

ilPDSelectedItemsBlockGUI::$view = self::VIEW_MY_OFFERS
private

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

Referenced by changeView(), and getHTML().

◆ VIEW_MY_MEMBERSHIPS

const ilPDSelectedItemsBlockGUI::VIEW_MY_MEMBERSHIPS = 1

◆ VIEW_MY_OFFERS

const ilPDSelectedItemsBlockGUI::VIEW_MY_OFFERS = 0

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