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

Static Public Member Functions

static getBlockType ()
 Get block type.
static getScreenMode ()
 Get Screen Mode for current command.
static isRepositoryObject ()
 Get block type.

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

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

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().

{
global $objDefinition;
$icon = ilUtil::getImagePath("icon_".$a_type.".png");
if (!$objDefinition->isPlugin($a_type))
{
$title = $this->lng->txt("objs_".$a_type);
}
else
{
include_once("./Services/Component/classes/class.ilPlugin.php");
$title =
ilPlugin::lookupTxt("rep_robj", $a_type, "objs_".$a_type);
}
$header_id = "th_".$a_type;
if ($a_show_image)
{
$a_tpl->setCurrentBlock("container_header_row_image");
$a_tpl->setVariable("HEADER_IMG", $icon);
$a_tpl->setVariable("HEADER_ALT", $title);
}
else
{
$a_tpl->setCurrentBlock("container_header_row");
}
$a_tpl->setVariable("BLOCK_HEADER_CONTENT", $title);
$a_tpl->setVariable("BLOCK_HEADER_ID", $header_id);
$a_tpl->parseCurrentBlock();
$a_tpl->touchBlock("container_row");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

{
global $tree, $ilSetting;
$par_id = ilObject::_lookupObjId($a_ref_id);
$type = ilObject::_lookupType($par_id);
if (!in_array($type, array("lm", "dbk", "sahs", "htlm")))
{
$icon = ilUtil::getImagePath("icon_".$type.".png");
}
else
{
$icon = ilUtil::getImagePath("icon_lm.png");
}
// custom icon
if ($ilSetting->get("custom_icons") &&
in_array($type, array("cat","grp","crs", "root")))
{
require_once("./Services/Container/classes/class.ilContainer.php");
if (($path = ilContainer::_lookupIconPath($par_id, "small")) != "")
{
$icon = $path;
}
}
if ($tree->getRootId() != $par_id)
{
$title = ilObject::_lookupTitle($par_id);
}
else
{
$nd = $tree->getNodeData(ROOT_FOLDER_ID);
$title = $nd["title"];
if ($title == "ILIAS")
{
$title = $this->lng->txt("repository");
}
}
/*
$item_list_gui =& $this->getItemListGUI($type);
$item_list_gui->enableIcon(false);
$item_list_gui->enableDelete(false);
$item_list_gui->enableCut(false);
$item_list_gui->enablePayment(false);
$item_list_gui->enableLink(false);
$item_list_gui->enableDescription(false);
$item_list_gui->enableProperties(false);
$item_list_gui->enablePreconditions(false);
$item_list_gui->enablePath(true);
$item_list_gui->enableCommands(false);
$html = $item_list_gui->getListItemHTML($a_ref_id,
$par_id, $title, "");
if ($a_show_image)
{
$a_tpl->setCurrentBlock("container_header_row_image");
$a_tpl->setVariable("HEADER_IMG", $icon);
$a_tpl->setVariable("HEADER_ALT", $title);
}
*/
// else
// {
$a_tpl->setCurrentBlock("container_header_row");
// }
$a_tpl->setVariable("BLOCK_HEADER_CONTENT", $title);
/* $a_tpl->setVariable("BLOCK_HEADER_CONTENT", $html);
$a_tpl->setVariable("BLOCK_HEADER_ID", "th_".$a_ref_id);*/
$a_tpl->parseCurrentBlock();
$a_tpl->touchBlock("container_row");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

{
global $ilSetting;
$this->cur_row_type = ($this->cur_row_type == "row_type_1")
? "row_type_2"
: "row_type_1";
$a_tpl->touchBlock($this->cur_row_type);
if ($a_image_type != "")
{
if (!is_array($a_image_type) && !in_array($a_image_type, array("lm", "dbk", "htlm", "sahs")))
{
$icon = ilUtil::getImagePath("icon_".$a_image_type.".png");
$title = $this->lng->txt("obj_".$a_image_type);
}
else
{
$icon = ilUtil::getImagePath("icon_lm.png");
$title = $this->lng->txt("learning_resource");
}
// custom icon
if ($ilSetting->get("custom_icons") &&
in_array($a_image_type, array("cat","grp","crs")))
{
require_once("./Services/Container/classes/class.ilContainer.php");
if (($path = ilContainer::_lookupIconPath($a_item_obj_id, "small")) != "")
{
$icon = $path;
}
}
$a_tpl->setCurrentBlock("block_row_image");
$a_tpl->setVariable("ROW_IMG", $icon);
$a_tpl->setVariable("ROW_ALT", $title);
$a_tpl->parseCurrentBlock();
}
else
{
$a_tpl->setVariable("ROW_NBSP", " ");
}
$a_tpl->setCurrentBlock("container_standard_row");
$a_tpl->setVariable("BLOCK_ROW_CONTENT", $a_html);
$rel_headers = ($a_related_header != "")
? "th_selected_items ".$a_related_header
: "th_selected_items";
$a_tpl->setVariable("BLOCK_ROW_HEADERS", $rel_headers);
$a_tpl->parseCurrentBlock();
$a_tpl->touchBlock("container_row");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

{
global $ilCtrl, $lng;
include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirectByClass('ilpersonaldesktopgui', 'show');
}

+ Here is the call graph for this function:

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.

{
global $ilUser, $ilCtrl;
if(in_array((int)$_GET['view'], $this->allowed_views))
{
$ilUser->writePref('pd_view', (int)$_GET['view']);
}
else
{
@reset($this->allowed_views);
$view = (int)@current($this->allowed_views);
$ilUser->writePref('pd_view', $view);
}
$ilCtrl->redirectByClass('ilpersonaldesktopgui', 'show');
}
ilPDSelectedItemsBlockGUI::confirmedRemove ( )

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

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

{
global $ilCtrl, $ilUser;
if(!sizeof($_POST["ref_id"]))
{
$ilCtrl->redirect($this, "manage");
}
foreach($_POST["ref_id"] as $ref_id)
{
$type = ilObject::_lookupType($ref_id, true);
ilObjUser::_dropDesktopItem($ilUser->getId(), $ref_id, $type);
}
ilUtil::sendSuccess($this->lng->txt("pd_remove_multi_confirm"), true);
$ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
}

+ Here is the call graph for this function:

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.

{
global $ilCtrl, $ilAccess, $ilUser;
if(!sizeof($_POST["ref_id"]))
{
$ilCtrl->redirect($this, "manage");
}
foreach($_POST["ref_id"] as $ref_id)
{
if($ilAccess->checkAccess("leave", "", $ref_id))
{
switch(ilObject::_lookupType($ref_id, true))
{
case "crs":
// see ilObjCourseGUI:performUnsubscribeObject()
include_once "Modules/Course/classes/class.ilCourseParticipants.php";
$members = new ilCourseParticipants(ilObject::_lookupObjId($ref_id));
$members->delete($ilUser->getId());
$members->sendUnsubscribeNotificationToAdmins($ilUser->getId());
$members->sendNotification(
$members->NOTIFY_UNSUBSCRIBE,
$ilUser->getId()
);
break;
case "grp":
// see ilObjGroupGUI:performUnsubscribeObject()
include_once "Modules/Group/classes/class.ilGroupParticipants.php";
$members = new ilGroupParticipants(ilObject::_lookupObjId($ref_id));
$members->delete($ilUser->getId());
include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
$members->sendNotification(
$ilUser->getId()
);
$members->sendNotification(
$ilUser->getId()
);
break;
default:
// do nothing
continue;
}
include_once './Modules/Forum/classes/class.ilForumNotification.php';
ilForumNotification::checkForumsExistsDelete($ref_id, $ilUser->getId());
}
}
ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
$ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
}

+ Here is the call graph for this function:

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().

{
global $ilCtrl;
if(!sizeof($_POST["id"]))
{
ilUtil::sendFailure($this->lng->txt("select_one"), true);
$ilCtrl->redirect($this, "manage");
}
if($this->view == self::VIEW_MY_OFFERS)
{
$question = $this->lng->txt("pd_info_delete_sure_remove");
$cmd = "confirmedRemove";
}
else
{
$question = $this->lng->txt("pd_info_delete_sure_unsubscribe");
$cmd = "confirmedUnsubscribe";
}
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setHeaderText($question);
$cgui->setFormAction($ilCtrl->getFormAction($this));
$cgui->setCancel($this->lng->txt("cancel"), "manage");
$cgui->setConfirm($this->lng->txt("confirm"), $cmd);
foreach ($_POST["id"] as $ref_id)
{
$obj_id = ilObject::_lookupObjectId($ref_id);
$title = ilObject::_lookupTitle($obj_id);
$type = ilObject::_lookupType($obj_id);
$cgui->addItem("ref_id[]", $ref_id, $title,
ilObject::_getIcon($obj_id, "small", $type),
$this->lng->txt("icon")." ".$this->lng->txt("obj_".$type));
}
return $cgui->getHTML();
}

+ Here is the call graph for this function:

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, $ilUser, VIEW_MY_MEMBERSHIPS, and VIEW_MY_OFFERS.

Referenced by ilPDSelectedItemsBlockGUI().

{
$this->allowed_views = array();
// determine view
if($ilSetting->get('disable_my_offers') == 1 &&
$ilSetting->get('disable_my_memberships') == 1)
{
// if both views are disabled set default view (should not occur but we should prevent it)
$ilSetting->set('personal_items_default_view', self::VIEW_MY_OFFERS);
$this->allowed_views[] = self::VIEW_MY_OFFERS;
}
// both views are enabled, get default view
else if($ilSetting->get('disable_my_offers') == 0 &&
$ilSetting->get('disable_my_memberships') == 0)
{
$this->allowed_views[] = self::VIEW_MY_OFFERS;
$this->allowed_views[] = self::VIEW_MY_MEMBERSHIPS;
}
else if($ilSetting->get('disable_my_offers') == 0 &&
$ilSetting->get('disable_my_memberships') == 1)
{
$this->allowed_views[] = self::VIEW_MY_OFFERS;
}
else
{
$this->allowed_views[] = self::VIEW_MY_MEMBERSHIPS;
}
$this->view = $ilUser->getPref('pd_view');
if($this->view === false || !in_array((int)$this->view, $this->allowed_views))
{
$ilUser->writePref('pd_view', (int)$ilSetting->get('personal_items_default_view'));
$this->view = (int)$ilSetting->get('personal_items_default_view');
}
}

+ Here is the caller graph for this function:

& ilPDSelectedItemsBlockGUI::executeCommand ( )

execute command

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

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

{
global $ilCtrl;
$next_class = $ilCtrl->getNextClass();
$cmd = $ilCtrl->getCmd("getHTML");
switch($next_class)
{
case "ilcommonactiondispatchergui":
include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
$ilCtrl->forwardCommand($gui);
break;
default:
if(method_exists($this, $cmd))
{
return $this->$cmd();
}
else
{
$cmd .= 'Object';
return $this->$cmd();
}
}
}

+ Here is the call graph for this function:

ilPDSelectedItemsBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

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

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

{
global $ilUser;
if ($this->getContent() != "")
{
$this->tpl->setVariable("BLOCK_ROW", $this->getContent());
}
else
{
$this->setDataSection($this->getIntroduction());
}
}

+ Here is the call graph for this function:

ilPDSelectedItemsBlockGUI::fillFooter ( )

block footer

Reimplemented from ilBlockGUI.

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

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

{
global $ilCtrl, $lng, $ilUser;
$this->setFooterLinks();
$this->fillFooterLinks();
$this->tpl->setVariable("FCOLSPAN", $this->getColSpan());
if ($this->tpl->blockExists("block_footer"))
{
$this->tpl->setCurrentBlock("block_footer");
$this->tpl->parseCurrentBlock();
}
}

+ Here is the call graph for this function:

static ilPDSelectedItemsBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

Reimplemented from ilBlockGUI.

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

References $block_type.

{
}
ilPDSelectedItemsBlockGUI::getContent ( )

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

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

{
return $this->content;
}

+ Here is the caller graph for this function:

ilPDSelectedItemsBlockGUI::getHTML ( )

Handle config status.

Get HTML.

Reimplemented from ilBlockGUI.

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().

{
global $ilCtrl, $ilSetting, $tpl, $lng, $ilHelp, $ilDB;
$ilDB->useSlave(true);
// both views are activated (show buttons)
if($ilSetting->get('disable_my_offers') == 0 &&
$ilSetting->get('disable_my_memberships') == 0)
{
/* $ilCtrl->setParameter($this, 'block_type', $this->getBlockType());
$ilCtrl->setParameter($this, 'view', self::VIEW_MY_OFFERS);
$this->addHeaderLink($ilCtrl->getLinkTarget($this, 'changeView'), $this->lng->txt('pd_my_offers'),
($this->view == self::VIEW_MY_OFFERS ? false : true)
);
$ilCtrl->setParameter($this, 'view', self::VIEW_MY_MEMBERSHIPS);
$this->addHeaderLink($ilCtrl->getLinkTarget($this, 'changeView'), $this->lng->txt('pd_my_memberships'),
($this->view == self::VIEW_MY_MEMBERSHIPS ? false : true)
);
$ilCtrl->clearParameters($this);*/
}
// workaround to show details row
$this->setData(array("dummy"));
include_once "Services/Object/classes/class.ilObjectListGUI.php";
ilObjectListGUI::prepareJSLinks("",
$ilCtrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false),
$ilCtrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false));
switch((int)$this->view)
{
case self::VIEW_MY_MEMBERSHIPS:
$ilHelp->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, "crs_grp");
if ($ilSetting->get('disable_my_offers') == 0)
{
$tpl->setTitle($lng->txt("my_courses_groups"));
}
$this->setTitle($this->lng->txt('pd_my_memberships'));
break;
case self::VIEW_MY_OFFERS:
default:
$ilHelp->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, "sel_items");
if(!in_array(self::VIEW_MY_MEMBERSHIPS, $this->allowed_views))
{
$this->setTitle($this->lng->txt('selected_items'));
}
else
{
$this->setTitle($this->lng->txt('pd_my_offers'));
}
break;
}
if ($this->getContent() == "")
{
$this->setEnableDetailRow(false);
}
$ilCtrl->clearParametersByClass("ilpersonaldesktopgui");
$ilCtrl->clearParameters($this);
$ilDB->useSlave(false);
return parent::getHTML();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPDSelectedItemsBlockGUI::getIntroduction ( )

Get overview.

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

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

Referenced by fillDataSection().

{
global $ilUser, $lng, $ilCtrl, $tree;
switch((int)$this->view)
{
case self::VIEW_MY_MEMBERSHIPS:
$tpl = new ilTemplate('tpl.pd_my_memberships_intro.html', true, true, 'Services/PersonalDesktop');
$tpl->setVariable('IMG_PD_LARGE', ilUtil::getImagePath('icon_pd_xxl.png'));
$tpl->setVariable('TXT_WELCOME', $lng->txt('pd_my_memberships_intro'));
$tpl->setVariable('TXT_INTRO_1', $lng->txt('pd_my_memberships_intro2'));
break;
case self::VIEW_MY_OFFERS:
default:
// get repository link
$nd = $tree->getNodeData(ROOT_FOLDER_ID);
$title = $nd["title"];
if ($title == "ILIAS")
{
$title = $lng->txt("repository");
}
$tpl = new ilTemplate("tpl.pd_intro.html", true, true, "Services/PersonalDesktop");
$tpl->setVariable("IMG_PD_LARGE", ilUtil::getImagePath("icon_pd_xxl.png"));
$tpl->setVariable("TXT_WELCOME", $lng->txt("pdesk_intro"));
$tpl->setVariable("TXT_INTRO_1", sprintf($lng->txt("pdesk_intro2"), $lng->txt("to_desktop")));
include_once("./Services/Link/classes/class.ilLink.php");
$tpl->setVariable("TXT_INTRO_2", sprintf($lng->txt("pdesk_intro3"),
'<a href="'.ilLink::_getStaticLink(1,'root',true).'">'.$title.'</a>'));
$tpl->setVariable("TXT_INTRO_3", $lng->txt("pdesk_intro4"));
break;
}
return $tpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& 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().

{
global $objDefinition;
//echo "<br>+$a_type+";
if (!isset($this->item_list_guis[$a_type]))
{
$class = $objDefinition->getClassName($a_type);
// Fixed problem with deactivated plugins and existing repo. object plugin objects on the user's desktop
if(!$class)
{
return NULL;
}
// Fixed problem with deactivated plugins and existing repo. object plugin objects on the user's desktop
$location = $objDefinition->getLocation($a_type);
if(!$location)
{
return NULL;
}
$full_class = "ilObj".$class."ListGUI";
//echo "<br>-".$location."/class.".$full_class.".php"."-";
include_once($location."/class.".$full_class.".php");
$item_list_gui = new $full_class();
$this->item_list_guis[$a_type] =& $item_list_gui;
}
else
{
$item_list_gui =& $this->item_list_guis[$a_type];
}
if ($this->manage)
{
$item_list_gui->enableCheckbox(true);
}
return $item_list_gui;
}

+ Here is the caller graph for this function:

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().

{
global $ilUser;
$tpl = $this->newBlockTemplate();
switch($ilUser->getPref('pd_order_items'))
{
case 'location':
break;
default:
break;
}
return $tpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

{
global $ilUser, $rbacsystem, $objDefinition, $ilBench, $ilSetting, $ilObjDataCache, $rbacreview;
$output = false;
$items = $this->getObjectsByMembership();
$item_html = array();
if(count($items) > 0)
{
include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
foreach($items as $item)
{
$preloader->addItem($item["obj_id"], $item["type"], $item["ref_id"]);
}
$preloader->preload();
unset($preloader);
reset($items);
foreach($items as $item)
{
//echo "1";
// get list gui class for each object type
if ($cur_obj_type != $item["type"])
{
$item_list_gui =& $this->getItemListGUI($item["type"]);
if(!$item_list_gui)
{
continue;
}
// notes, comment currently do not work properly
$item_list_gui->enableNotes(false);
$item_list_gui->enableComments(false);
$item_list_gui->enableTags(false);
$item_list_gui->enableIcon(true);
$item_list_gui->enableDelete(false);
$item_list_gui->enableCut(false);
$item_list_gui->enableCopy(false);
$item_list_gui->enablePayment(false);
$item_list_gui->enableLink(false);
$item_list_gui->enableInfoScreen(true);
if ($ilSetting->get('disable_my_offers') == 1)
{
$item_list_gui->enableSubscribe(false);
}
else
{
$item_list_gui->enableSubscribe(true);
}
$item_list_gui->setContainerObject($this);
if ($this->getCurrentDetailLevel() < 3 || $this->manage)
{
//echo "3";
$item_list_gui->enableDescription(false);
$item_list_gui->enableProperties(false);
$item_list_gui->enablePreconditions(false);
}
if ($this->getCurrentDetailLevel() < 2 || $this->manage)
{
$item_list_gui->enableCommands(true, true);
}
}
// render item row
$ilBench->start("ilPersonalDesktopGUI", "getListHTML");
if (is_object($item_list_gui))
{
// #15232
if($this->manage)
{
if(!$rbacsystem->checkAccess("leave", $item["ref_id"]))
{
$item_list_gui->enableCheckbox(false);
}
else
{
$item_list_gui->enableCheckbox(true);
}
}
$html = $item_list_gui->getListItemHTML($item["ref_id"],
$item["obj_id"], $item["title"], $item["description"]);
$ilBench->stop("ilPersonalDesktopGUI", "getListHTML");
if ($html != "")
{
// BEGIN WebDAV: Use $item_list_gui to determine icon image type
$item_html[] = array(
"html" => $html,
"item_ref_id" => $item["ref_id"],
"item_obj_id" => $item["obj_id"],
"parent_ref" => $item["parent_ref"],
"type" => $item["type"],
'item_icon_image_type' => $item_list_gui->getIconImageType()
);
// END WebDAV: Use $item_list_gui to determine icon image type
}
}
}
// output block for resource type
if (count($item_html) > 0)
{
$cur_parent_ref = 0;
// content row
foreach($item_html as $item)
{
// add a parent header row for each new parent
if ($cur_parent_ref != $item["parent_ref"])
{
if ($ilSetting->get("icon_position_in_lists") == "item_rows")
{
$this->addParentRow($tpl, $item["parent_ref"], false);
}
else
{
$this->addParentRow($tpl, $item["parent_ref"]);
}
$this->resetRowType();
$cur_parent_ref = $item["parent_ref"];
}
// BEGIN WebDAV: Use $item_list_gui to determine icon image type.
$this->addStandardRow($tpl, $item["html"], $item["item_ref_id"], $item["item_obj_id"],
$item['item_icon_image_type'],
"th_".$cur_parent_ref);
// END WebDAV: Use $item_list_gui to determine icon image type.
$output = true;
}
}
}
return $output;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

{
global $ilUser, $rbacsystem, $objDefinition, $ilBench, $ilSetting, $ilObjDataCache;
$output = false;
$objtype_groups = $objDefinition->getGroupedRepositoryObjectTypes(
array("cat", "crs", "grp", "fold"));
$types = array();
foreach($objtype_groups as $grp => $grpdata)
{
$types[] = array(
"grp" => $grp,
"title" => $this->lng->txt("objs_".$grp),
"types" => $grpdata["objs"]);
}
include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
foreach ($types as $t)
{
$type = $t["types"];
$title = $t["title"];
$grp = $t["grp"];
$items = $this->getObjectsByMembership($type);
if (count($items) > 0)
{
foreach($items as $item)
{
$preloader->addItem($item["obj_id"], $item["type"], $item["ref_id"]);
}
$preloader->preload();
unset($preloader);
reset($items);
$item_html = array();
if ($this->getCurrentDetailLevel() == 3)
{
$rel_header = "th_".$grp;
}
$tstCount = 0;
$unsetCount = 0;
$progressCount = 0;
$unsetFlag = 0;
$progressFlag = 0;
$completedFlag = 0;
if (strcmp($a_type, "tst") == 0) {
$items = $this->multiarray_sort($items, "used_tries; title");
foreach ($items as $tst_item) {
if (!isset($tst_item["used_tries"])) {
$unsetCount++;
}
elseif ($tst_item["used_tries"] == 0) {
$progressCount++;
}
}
}
foreach($items as $item)
{
// get list gui class for each object type
if ($cur_obj_type != $item["type"])
{
$class = $objDefinition->getClassName($item["type"]);
$location = $objDefinition->getLocation($item["type"]);
$full_class = "ilObj".$class."ListGUI";
include_once($location."/class.".$full_class.".php");
$item_list_gui = new $full_class();
// notes, comment currently do not work properly
$item_list_gui->enableNotes(false);
$item_list_gui->enableComments(false);
$item_list_gui->enableTags(false);
$item_list_gui->enableIcon(true);
$item_list_gui->enableDelete(false);
$item_list_gui->enableCut(false);
$item_list_gui->enableCopy(false);
$item_list_gui->enablePayment(false);
$item_list_gui->enableLink(false);
$item_list_gui->enableInfoScreen(true);
if ($ilSetting->get('disable_my_offers') == 1)
{
$item_list_gui->enableSubscribe(false);
}
else
{
$item_list_gui->enableSubscribe(true);
}
$item_list_gui->setContainerObject($this);
if ($this->manage)
{
$item_list_gui->enableCheckbox(true);
}
if ($this->getCurrentDetailLevel() < 3 || $this->manage)
{
$item_list_gui->enableDescription(false);
$item_list_gui->enableProperties(false);
$item_list_gui->enablePreconditions(false);
$item_list_gui->enableNoticeProperties(false);
}
if ($this->getCurrentDetailLevel() < 2 || $this->manage)
{
$item_list_gui->enableCommands(true, true);
}
}
// render item row
$ilBench->start("ilPersonalDesktopGUI", "getListHTML");
// #15232
if($this->manage)
{
if(!$rbacsystem->checkAccess("leave", $item["ref_id"]))
{
$item_list_gui->enableCheckbox(false);
}
else
{
$item_list_gui->enableCheckbox(true);
}
}
$html = $item_list_gui->getListItemHTML($item["ref_id"],
$item["obj_id"], $item["title"], $item["description"]);
$ilBench->stop("ilPersonalDesktopGUI", "getListHTML");
if ($html != "")
{
// BEGIN WebDAV: Use $item_list_gui to determine icon image type
$item_html[] = array(
"html" => $html,
"item_ref_id" => $item["ref_id"],
"item_obj_id" => $item["obj_id"],
'item_icon_image_type' => (method_exists($item_list_gui, 'getIconImageType')) ?
$item_list_gui->getIconImageType() :
$item['type']
);
// END WebDAV: Use $item_list_gui to determine icon image type
}
}
// output block for resource type
if (count($item_html) > 0)
{
// add a header for each resource type
if ($this->getCurrentDetailLevel() == 3)
{
if ($ilSetting->get("icon_position_in_lists") == "item_rows")
{
$this->addHeaderRow($tpl, $grp, false);
}
else
{
$this->addHeaderRow($tpl, $grp);
}
$this->resetRowType();
}
// content row
foreach($item_html as $item)
{
if ($this->getCurrentDetailLevel() < 3 ||
$ilSetting->get("icon_position_in_lists") == "item_rows")
{
// BEGIN WebDAV: Use $item_list_gui to determine icon image type
$this->addStandardRow($tpl, $item["html"], $item["item_ref_id"], $item["item_obj_id"],
$item['item_icon_image_type'],
$rel_header);
// END WebDAV: Use $item_list_gui to determine icon image type
}
else
{
$this->addStandardRow($tpl, $item["html"], $item["item_ref_id"], $item["item_obj_id"], "", $rel_header);
}
$output = true;
}
}
}
}
return $output;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

{
global $tree, $ilUser, $ilObjDataCache;
include_once 'Services/Membership/classes/class.ilParticipants.php';
$items = array();
if(is_array($types) && count($types))
{
foreach($types as $type)
{
switch($type)
{
case 'grp':
$items = array_merge(ilParticipants::_getMembershipByType($ilUser->getId(), 'grp'), $items);
break;
case 'crs':
$items = array_merge(ilParticipants::_getMembershipByType($ilUser->getId(), 'crs'), $items);
break;
default:
break;
}
}
}
else
{
$crs_mbs = ilParticipants::_getMembershipByType($ilUser->getId(), 'crs');
$grp_mbs = ilParticipants::_getMembershipByType($ilUser->getId(), 'grp');
$items = array_merge($crs_mbs, $grp_mbs);
}
$references = array();
foreach($items as $key => $obj_id)
{
$item_references = ilObject::_getAllReferences($obj_id);
foreach($item_references as $ref_id)
{
if($tree->isInTree($ref_id))
{
$title = $ilObjDataCache->lookupTitle($obj_id);
$type = $ilObjDataCache->lookupType($obj_id);
$parent_ref_id = $tree->getParentId($ref_id);
$par_left = $tree->getLeftValue($parent_ref_id);
$par_left = sprintf("%010d", $par_left);
$references[$par_left . $title . $ref_id] = array(
'ref_id' => $ref_id,
'obj_id' => $obj_id,
'type' => $type,
'title' => $title,
'description' => $ilObjDataCache->lookupDescription($obj_id),
'parent_ref' => $parent_ref_id
);
}
}
}
ksort($references);
return is_array($references) ? $references : array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilPDSelectedItemsBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

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

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

{
$cmd = $_GET["cmd"];
if($cmd == "post")
{
$cmd = $_POST["cmd"];
$cmd = array_shift(array_keys($cmd));
}
switch($cmd)
{
case "confirmRemove":
case "manage":
default:
}
}
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().

{
global $ilUser, $rbacsystem, $objDefinition, $ilBench;
$tpl =& $this->newBlockTemplate();
switch ($ilUser->getPref("pd_order_items"))
{
case "location":
break;
default:
break;
}
if($this->manage)
{
// #11355 - see ContainerContentGUI::renderSelectAllBlock()
$tpl->setCurrentBlock("select_all_row");
$tpl->setVariable("CHECKBOXNAME", "ilToolbarSelectAll");
$tpl->setVariable("SEL_ALL_PARENT", "ilToolbar");
$tpl->setVariable("SEL_ALL_CB_NAME", "id");
$tpl->setVariable("TXT_SELECT_ALL", $this->lng->txt("select_all"));
$tpl->parseCurrentBlock();
}
return $tpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

{
global $ilUser, $rbacsystem, $objDefinition, $ilBench, $ilSetting, $ilObjDataCache, $tree;
$output = false;
$items = $ilUser->getDesktopItems();
$item_html = array();
$cur_obj_type = "";
if (count($items) > 0)
{
include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
foreach($items as $item)
{
$preloader->addItem($item["obj_id"], $item["type"], $item["ref_id"]);
}
$preloader->preload();
unset($preloader);
reset($items);
foreach($items as $item)
{
//echo "1";
// get list gui class for each object type
if ($cur_obj_type != $item["type"])
{
$item_list_gui =& $this->getItemListGUI($item["type"]);
if(!$item_list_gui)
{
continue;
}
// notes, comment currently do not work properly
$item_list_gui->enableNotes(false);
$item_list_gui->enableComments(false);
$item_list_gui->enableTags(false);
$item_list_gui->enableIcon(true);
$item_list_gui->enableDelete(false);
$item_list_gui->enableCut(false);
$item_list_gui->enableCopy(false);
$item_list_gui->enablePayment(false);
$item_list_gui->enableLink(false);
$item_list_gui->enableInfoScreen(true);
if ($this->getCurrentDetailLevel() < 3 || $this->manage)
{
//echo "3";
$item_list_gui->enableDescription(false);
$item_list_gui->enableProperties(false);
$item_list_gui->enablePreconditions(false);
}
if ($this->getCurrentDetailLevel() < 2 || $this->manage)
{
$item_list_gui->enableCommands(true, true);
}
}
// render item row
$ilBench->start("ilPersonalDesktopGUI", "getListHTML");
$item_list_gui->setContainerObject($this);
$html = $item_list_gui->getListItemHTML($item["ref_id"],
$item["obj_id"], $item["title"], $item["description"]);
$ilBench->stop("ilPersonalDesktopGUI", "getListHTML");
if ($html != "")
{
// BEGIN WebDAV: Use $item_list_gui to determine icon image type
$item_html[] = array(
"html" => $html,
"item_ref_id" => $item["ref_id"],
"item_obj_id" => $item["obj_id"],
"parent_ref" => $item["parent_ref"],
"type" => $item["type"],
'item_icon_image_type' => $item_list_gui->getIconImageType()
);
// END WebDAV: Use $item_list_gui to determine icon image type
}
}
// output block for resource type
if (count($item_html) > 0)
{
$cur_parent_ref = 0;
// content row
foreach($item_html as $item)
{
// add a parent header row for each new parent
if ($cur_parent_ref != $item["parent_ref"])
{
if ($ilSetting->get("icon_position_in_lists") == "item_rows")
{
$this->addParentRow($tpl, $item["parent_ref"], false);
}
else
{
$this->addParentRow($tpl, $item["parent_ref"]);
}
$this->resetRowType();
$cur_parent_ref = $item["parent_ref"];
}
// BEGIN WebDAV: Use $item_list_gui to determine icon image type.
$this->addStandardRow($tpl, $item["html"], $item["item_ref_id"], $item["item_obj_id"],
$item['item_icon_image_type'],
"th_".$cur_parent_ref);
// END WebDAV: Use $item_list_gui to determine icon image type.
$output = true;
}
}
}
return $output;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

{
global $ilUser, $rbacsystem, $objDefinition, $ilBench, $ilSetting, $ilObjDataCache, $tree, $ilCtrl;
$items = $ilUser->getDesktopItems();
if (count($items) > 0)
{
include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
foreach($items as $item)
{
$preloader->addItem($item["obj_id"], $item["type"], $item["ref_id"]);
}
$preloader->preload();
unset($preloader);
reset($items);
}
$output = false;
$objtype_groups = $objDefinition->getGroupedRepositoryObjectTypes(
array("cat", "crs", "grp", "fold"));
$types = array();
foreach($objtype_groups as $grp => $grpdata)
{
$types[] = array(
"grp" => $grp,
"title" => $this->lng->txt("objs_".$grp),
"types" => $grpdata["objs"]);
}
foreach ($types as $t)
{
$type = $t["types"];
$title = $t["title"];
$grp = $t["grp"];
$items = $ilUser->getDesktopItems($type);
$item_html = array();
if ($this->getCurrentDetailLevel() == 3)
{
$rel_header = "th_".$grp;
}
if (count($items) > 0)
{
$tstCount = 0;
$unsetCount = 0;
$progressCount = 0;
$unsetFlag = 0;
$progressFlag = 0;
$completedFlag = 0;
if (strcmp($a_type, "tst") == 0) {
$items = $this->multiarray_sort($items, "used_tries; title");
foreach ($items as $tst_item) {
if (!isset($tst_item["used_tries"])) {
$unsetCount++;
}
elseif ($tst_item["used_tries"] == 0) {
$progressCount++;
}
}
}
foreach($items as $item)
{
// get list gui class for each object type
if ($cur_obj_type != $item["type"])
{
$class = $objDefinition->getClassName($item["type"]);
$location = $objDefinition->getLocation($item["type"]);
$full_class = "ilObj".$class."ListGUI";
include_once($location."/class.".$full_class.".php");
$item_list_gui = new $full_class();
// notes, comment currently do not work properly
$item_list_gui->enableNotes(false);
$item_list_gui->enableComments(false);
$item_list_gui->enableTags(false);
$item_list_gui->enableIcon(true);
$item_list_gui->enableDelete(false);
$item_list_gui->enableCut(false);
$item_list_gui->enableCopy(false);
$item_list_gui->enablePayment(false);
$item_list_gui->enableLink(false);
$item_list_gui->enableInfoScreen(true);
$item_list_gui->setContainerObject($this);
if ($this->manage)
{
$item_list_gui->enableCheckbox(true);
}
if ($this->getCurrentDetailLevel() < 3 || $this->manage)
{
$item_list_gui->enableDescription(false);
$item_list_gui->enableProperties(false);
$item_list_gui->enablePreconditions(false);
$item_list_gui->enableNoticeProperties(false);
}
if ($this->getCurrentDetailLevel() < 2 || $this->manage)
{
$item_list_gui->enableCommands(true, true);
}
}
// render item row
$ilBench->start("ilPersonalDesktopGUI", "getListHTML");
$html = $item_list_gui->getListItemHTML($item["ref_id"],
$item["obj_id"], $item["title"], $item["description"]);
$ilBench->stop("ilPersonalDesktopGUI", "getListHTML");
if ($html != "")
{
// BEGIN WebDAV: Use $item_list_gui to determine icon image type
$item_html[] = array(
"html" => $html,
"item_ref_id" => $item["ref_id"],
"item_obj_id" => $item["obj_id"],
'item_icon_image_type' => (method_exists($item_list_gui, 'getIconImageType')) ?
$item_list_gui->getIconImageType() :
$item['type']
);
// END WebDAV: Use $item_list_gui to determine icon image type
}
}
// output block for resource type
if (count($item_html) > 0)
{
// add a header for each resource type
if ($this->getCurrentDetailLevel() == 3)
{
if ($ilSetting->get("icon_position_in_lists") == "item_rows")
{
$this->addHeaderRow($tpl, $grp, false);
}
else
{
$this->addHeaderRow($tpl, $grp);
}
$this->resetRowType();
}
// content row
foreach($item_html as $item)
{
if ($this->getCurrentDetailLevel() < 3 ||
$ilSetting->get("icon_position_in_lists") == "item_rows")
{
// BEGIN WebDAV: Use $item_list_gui to determine icon image type
$this->addStandardRow($tpl, $item["html"], $item["item_ref_id"], $item["item_obj_id"],
$item['item_icon_image_type'],
$rel_header);
// END WebDAV: Use $item_list_gui to determine icon image type
}
else
{
$this->addStandardRow($tpl, $item["html"], $item["item_ref_id"], $item["item_obj_id"], "", $rel_header);
}
$output = true;
}
}
}
}
return $output;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPDSelectedItemsBlockGUI::ilPDSelectedItemsBlockGUI ( )

Constructor.

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

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

{
global $ilCtrl, $lng, $ilUser;
$lng->loadLanguageModule('pd');
$lng->loadLanguageModule('cntr'); // #14369
//$this->setImage(ilUtil::getImagePath("icon_bm_s.png"));
$this->setEnableNumInfo(false);
$this->setLimit(99999);
// $this->setColSpan(2);
// $this->setBigMode(true);
$this->lng = $lng;
$this->allow_moving = false;
}

+ Here is the call graph for this function:

static ilPDSelectedItemsBlockGUI::isRepositoryObject ( )
static

Get block type.

Returns
string Block type.

Reimplemented from ilBlockGUI.

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

{
return false;
}
ilPDSelectedItemsBlockGUI::manageObject ( )

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

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

{
global $ilUser, $objDefinition, $ilCtrl, $lng;
$objects = array();
$this->manage = true;
$top_tb = new ilToolbarGUI();
$top_tb->setFormAction($ilCtrl->getFormAction($this));
$top_tb->setLeadingImage(ilUtil::getImagePath("arrow_upright.png"), $lng->txt("actions"));
if ($this->view == self::VIEW_MY_OFFERS)
{
$top_tb->addFormButton($lng->txt("remove"), "confirmRemove");
}
else
{
$top_tb->addFormButton($lng->txt("pd_unsubscribe_memberships"), "confirmRemove");
}
$top_tb->addSeparator();
$top_tb->addFormButton($lng->txt("cancel"), "getHTML");
$top_tb->setCloseFormTag(false);
$bot_tb = new ilToolbarGUI();
$bot_tb->setLeadingImage(ilUtil::getImagePath("arrow_downright.png"), $lng->txt("actions"));
if ($this->view == self::VIEW_MY_OFFERS)
{
$bot_tb->addFormButton($lng->txt("remove"), "confirmRemove");
}
else
{
$bot_tb->addFormButton($lng->txt("pd_unsubscribe_memberships"), "confirmRemove");
}
$bot_tb->addSeparator();
$bot_tb->addFormButton($lng->txt("cancel"), "getHTML");
$bot_tb->setOpenFormTag(false);
return $top_tb->getHTML().$this->getHTML().$bot_tb->getHTML();
/*
if($this->view == self::VIEW_MY_OFFERS)
{
return $top_tb->getHTML().$this->getHTML().$bot_tb->getHTML();
foreach($ilUser->getDesktopItems() as $item)
{
$objects[] = $item;
}
}
else
{
$objtype_groups = $objDefinition->getGroupedRepositoryObjectTypes(
array("cat", "crs", "grp", "fold"));
foreach($objtype_groups as $grpdata)
{
foreach($this->getObjectsByMembership($grpdata["objs"]) as $item)
{
$objects[] = $item;
}
}
}
include_once "Services/PersonalDesktop/classes/class.ilPDSelectedItemsTableGUI.php";
$tbl = new ilPDSelectedItemsTableGUI($this, "manage", $objects, $this->view, ($ilUser->getPref("pd_order_items") == 'location'));
return $tbl->getHTML();
*/
}

+ Here is the call graph for this function:

& 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().

{
$tpl = new ilTemplate("tpl.pd_list_block.html", true, true, "Services/PersonalDesktop");
$this->cur_row_type = "";
return $tpl;
}

+ Here is the caller graph for this function:

ilPDSelectedItemsBlockGUI::orderPDItemsByLocation ( )

order desktop items by location

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

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

{
global $ilUser, $ilCtrl;
$ilUser->writePref("pd_order_items", "location");
if ($ilCtrl->isAsynch())
{
echo $this->getHTML();
}
else
{
$ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
}
}

+ Here is the call graph for this function:

ilPDSelectedItemsBlockGUI::orderPDItemsByType ( )

order desktop items by Type

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

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

{
global $ilUser, $ilCtrl;
$ilUser->writePref("pd_order_items", "type");
if ($ilCtrl->isAsynch())
{
echo $this->getHTML();
}
else
{
$ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
}
}

+ Here is the call graph for this function:

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().

{
global $ilCtrl, $lng;
include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirectByClass('ilpersonaldesktopgui', 'show');
}

+ Here is the call graph for this function:

ilPDSelectedItemsBlockGUI::resetRowType ( )

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

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

{
$this->cur_row_type = "";
}

+ Here is the caller graph for this function:

ilPDSelectedItemsBlockGUI::setContent (   $a_content)

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

Referenced by getHTML().

{
$this->content = $a_content;
}

+ Here is the caller graph for this function:

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().

{
global $ilUser, $ilCtrl, $lng;
if ($this->getContent() == "")
{
$this->setEnableNumInfo(false);
return "";
}
if ($this->manage)
{
return;
}
// by type
// if ($ilUser->getPref("pd_order_items") == 'location')
// {
$this->addFooterLink( $lng->txt("by_type"),
$ilCtrl->getLinkTarget($this, "orderPDItemsByType"),
$ilCtrl->getLinkTarget($this, "orderPDItemsByType", "", true),
"block_".$this->getBlockType()."_".$this->block_id,
false, false, ($ilUser->getPref("pd_order_items") != 'location')
);
// }
// else
// {
// $this->addFooterLink($lng->txt("by_type"));
// }
// // by location
// if ($ilUser->getPref("pd_order_items") == 'location')
// {
// $this->addFooterLink($lng->txt("by_location"));
// }
// else
// {
$this->addFooterLink( $lng->txt("by_location"),
$ilCtrl->getLinkTarget($this, "orderPDItemsByLocation"),
$ilCtrl->getLinkTarget($this, "orderPDItemsByLocation", "", true),
"block_".$this->getBlockType()."_".$this->block_id,
false, false, ($ilUser->getPref("pd_order_items") == 'location')
);
// }
$this->addFooterLink(($this->view == self::VIEW_MY_OFFERS) ?
$lng->txt("pd_remove_multiple") :
$lng->txt("pd_unsubscribe_multiple_memberships"),
$ilCtrl->getLinkTarget($this, "manage"),
null,
"block_".$this->getBlockType()."_".$this->block_id
);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilPDSelectedItemsBlockGUI::$allowed_views = array()
private

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

ilPDSelectedItemsBlockGUI::$block_type = "pditems"
static

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

Referenced by getBlockType().

ilPDSelectedItemsBlockGUI::$view = self::VIEW_MY_OFFERS
private

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

Referenced by changeView(), and getHTML().

const ilPDSelectedItemsBlockGUI::VIEW_MY_MEMBERSHIPS = 1
const ilPDSelectedItemsBlockGUI::VIEW_MY_OFFERS = 0

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