5include_once(
"Services/Block/classes/class.ilBlockGUI.php");
 
    6include_once 
'./Services/PersonalDesktop/interfaces/interface.ilDesktopItemHandling.php';
 
    7require_once(
'./Services/Repository/classes/class.ilObjectPlugin.php');
 
   65        $this->rbacsystem = 
$DIC->rbac()->system();
 
   67        $this->obj_definition = 
$DIC[
"objDefinition"];
 
   68        $this->access = 
$DIC->access();
 
   70        parent::__construct();
 
   72        $this->lng = 
$DIC->language();
 
   73        $this->ctrl = 
$DIC->ctrl();
 
   74        $this->
user = $DIC->user();
 
   76        $this->lng->loadLanguageModule(
'pd');
 
   77        $this->lng->loadLanguageModule(
'cntr'); 
 
   82        $this->allow_moving = 
false;
 
   92        require_once 
'Services/PersonalDesktop/ItemsBlock/classes/class.ilPDSelectedItemsBlockViewSettings.php';
 
   94        $this->viewSettings->parse();
 
   96        require_once 
'Services/PersonalDesktop/ItemsBlock/classes/class.ilPDSelectedItemsBlockViewGUI.php';
 
   99        $_GET[
'view'] = $this->viewSettings->getCurrentView();
 
  100        $this->ctrl->saveParameter($this, 
'view');
 
  125        parent::fillDetailRow();
 
  134        include_once 
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
 
  136        ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"), 
true);
 
  137        $this->ctrl->setParameterByClass(
'ilpersonaldesktopgui', 
'view', $this->viewSettings->getCurrentView());
 
  138        $this->ctrl->redirectByClass(
'ilpersonaldesktopgui', 
'show');
 
  146        include_once 
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
 
  148        ilUtil::sendSuccess($this->lng->txt(
"removed_from_desktop"), 
true);
 
  149        $this->ctrl->setParameterByClass(
'ilpersonaldesktopgui', 
'view', $this->viewSettings->getCurrentView());
 
  150        $this->ctrl->redirectByClass(
'ilpersonaldesktopgui', 
'show');
 
  167        if ($cmd == 
'post') {
 
  169            $cmd = array_shift(array_keys($cmd));
 
  173            case 'confirmRemove':
 
  197        $DIC->database()->useSlave(
true);
 
  200        $this->
setData(array(
'dummy'));
 
  202        require_once 
'Services/Object/classes/class.ilObjectListGUI.php';
 
  203        ilObjectListGUI::prepareJSLinks(
 
  205            $this->ctrl->getLinkTargetByClass(array(
'ilcommonactiondispatchergui', 
'ilnotegui'), 
'', 
'', 
true, 
false),
 
  206            $this->ctrl->getLinkTargetByClass(array(
'ilcommonactiondispatchergui', 
'iltagginggui'), 
'', 
'', 
true, 
false)
 
  210        $this->
setTitle($this->view->getTitle());
 
  218        $this->ctrl->clearParameters($this);
 
  220        $DIC->database()->useSlave(
false);
 
  222        return parent::getHTML();
 
  230        if ($this->viewSettings->isStudyProgrammeViewActive()) {
 
  234        return parent::getFooterLinks();
 
  242        $next_class = $this->ctrl->getNextClass();
 
  243        $cmd = $this->ctrl->getCmd(
'getHTML');
 
  245        switch ($next_class) {
 
  246            case 'ilcommonactiondispatchergui':
 
  247                include_once(
'Services/Object/classes/class.ilCommonActionDispatcherGUI.php');
 
  249                $this->ctrl->forwardCommand($gui);
 
  253                if (method_exists($this, $cmd)) {
 
  254                    return $this->$cmd();
 
  256                    return $this->{$cmd . 
'Object'}();
 
  285            $this->tpl->setVariable(
'BLOCK_ROW', $this->
getContent());
 
  297        $this->tpl->setVariable(
'FCOLSPAN', $this->
getColSpan());
 
  298        if ($this->tpl->blockExists(
'block_footer')) {
 
  299            $this->tpl->setCurrentBlock(
'block_footer');
 
  300            $this->tpl->parseCurrentBlock();
 
  319            $this->lng->txt(
"pd_sort_by_type"),
 
  320            $this->ctrl->getLinkTarget($this, 
"orderPDItemsByType"),
 
  321            $this->ctrl->getLinkTarget($this, 
"orderPDItemsByType", 
"", 
true),
 
  322            "block_" . $this->getBlockType() . 
"_" . $this->block_id,
 
  325            $this->viewSettings->isSortedByType()
 
  329            $this->lng->txt(
"pd_sort_by_location"),
 
  330            $this->ctrl->getLinkTarget($this, 
"orderPDItemsByLocation"),
 
  331            $this->ctrl->getLinkTarget($this, 
"orderPDItemsByLocation", 
"", 
true),
 
  332            "block_" . $this->getBlockType() . 
"_" . $this->block_id,
 
  335            $this->viewSettings->isSortedByLocation()
 
  338        if ($this->viewSettings->isMembershipsViewActive()) {
 
  340                $this->lng->txt(
"pd_sort_by_start_date"),
 
  341                $this->ctrl->getLinkTarget($this, 
"orderPDItemsByStartDate"),
 
  342                $this->ctrl->getLinkTarget($this, 
"orderPDItemsByStartDate", 
"", 
true),
 
  343                "block_" . $this->getBlockType() . 
"_" . $this->block_id,
 
  346                $this->viewSettings->isSortedByStartDate()
 
  351            $this->viewSettings->isSelectedItemsViewActive() ?
 
  352            $this->lng->txt(
"pd_remove_multiple") :
 
  353            $this->lng->txt(
"pd_unsubscribe_multiple_memberships"),
 
  354            $this->ctrl->getLinkTarget($this, 
"manage"),
 
  356            "block_" . $this->getBlockType() . 
"_" . $this->block_id
 
  366    protected function renderGroupedItems(
ilTemplate $tpl, array $grouped_items, $show_header = 
false)
 
  371        if (0 == count($grouped_items)) {
 
  377        require_once 
'Services/Object/classes/class.ilObjectActivation.php';
 
  378        require_once 
'Services/PersonalDesktop/ItemsBlock/classes/class.ilPDSelectedItemsBlockListGUIFactory.php';
 
  381        foreach ($grouped_items as $group) {
 
  382            $item_html = array();
 
  384            foreach ($group->getItems() as $item) {
 
  386                    $item_list_gui = $list_factory->byType($item[
'type']);
 
  391                        if ($this->view->mayRemoveItem((
int) $item[
'ref_id'])) {
 
  392                            $item_list_gui->enableCheckbox(
true);
 
  394                            $item_list_gui->enableCheckbox(
false);
 
  398                    $html = $item_list_gui->getListItemHTML($item[
'ref_id'], $item[
'obj_id'], $item[
'title'], $item[
'description']);
 
  400                        $item_html[] = array(
 
  402                            'item_ref_id' => $item[
'ref_id'],
 
  403                            'item_obj_id' => $item[
'obj_id'],
 
  404                            'parent_ref' => $item[
'parent_ref'],
 
  405                            'type' => $item[
'type'],
 
  406                            'item_icon_image_type' => $item_list_gui->getIconImageType()
 
  414            if (0 == count($item_html)) {
 
  423            foreach ($item_html as $item) {
 
  424                $this->addStandardRow(
 
  427                    $item[
'item_ref_id'],
 
  428                    $item[
'item_obj_id'],
 
  429                    $item[
'item_icon_image_type'],
 
  430                    'th_' . md5($group->getLabel())
 
  446        $this->renderGroupedItems(
 
  448            $this->view->getItemGroups(),
 
  449            ($this->getCurrentDetailLevel() >= $this->view->getMinimumDetailLevelForSection())
 
  452        if ($this->manage && $this->view->supportsSelectAll()) {
 
  454            $tpl->setCurrentBlock(
'select_all_row');
 
  455            $tpl->setVariable(
'CHECKBOXNAME', 
'ilToolbarSelectAll');
 
  456            $tpl->setVariable(
'SEL_ALL_PARENT', 
'ilToolbar');
 
  457            $tpl->setVariable(
'SEL_ALL_CB_NAME', 
'id');
 
  458            $tpl->setVariable(
'TXT_SELECT_ALL', $this->lng->txt(
'select_all'));
 
  459            $tpl->parseCurrentBlock();
 
  467        $this->cur_row_type = 
"";
 
  478        $tpl = 
new ilTemplate(
"tpl.pd_list_block.html", 
true, 
true, 
"Services/PersonalDesktop");
 
  479        $this->cur_row_type = 
"";
 
  513    public function addStandardRow(
 
  519        $a_related_header = 
"" 
  523        $this->cur_row_type = ($this->cur_row_type == 
"row_type_1")
 
  526        $a_tpl->touchBlock($this->cur_row_type);
 
  528        if ($a_image_type != 
"") {
 
  529            if (!is_array($a_image_type) && !in_array($a_image_type, array(
"lm", 
"htlm", 
"sahs"))) {
 
  531                $title = $this->lng->txt(
"obj_" . $a_image_type);
 
  534                $title = $this->lng->txt(
"learning_module");
 
  540                $customIconFactory = 
$DIC[
'object.customicons.factory'];
 
  541                $customIcon = $customIconFactory->getByObjId($a_item_obj_id, $a_image_type);
 
  543                if ($customIcon->exists()) {
 
  544                    $icon = $customIcon->getFullPath();
 
  548            $a_tpl->setCurrentBlock(
"block_row_image");
 
  549            $a_tpl->setVariable(
"ROW_IMG", $icon);
 
  550            $a_tpl->setVariable(
"ROW_ALT", 
$title);
 
  551            $a_tpl->parseCurrentBlock();
 
  553            $a_tpl->setVariable(
"ROW_NBSP", 
" ");
 
  555        $a_tpl->setCurrentBlock(
"container_standard_row");
 
  556        $a_tpl->setVariable(
"BLOCK_ROW_CONTENT", $a_html);
 
  561        $a_tpl->parseCurrentBlock();
 
  562        $a_tpl->touchBlock(
"container_row");
 
  570        $this->
user->writePref(
'pd_order_items', $sort_type);
 
  573        if ($this->ctrl->isAsynch()) {
 
  578        $this->ctrl->setParameterByClass(
'ilpersonaldesktopgui', 
'view', $this->viewSettings->getCurrentView());
 
  579        $this->ctrl->redirectByClass(
'ilpersonaldesktopgui', 
'show');
 
  587        $this->
changeSortMode($this->viewSettings->getSortByLocationMode());
 
  603        $this->
changeSortMode($this->viewSettings->getSortByStartDateMode());
 
  611        $this->manage = 
true;
 
  615        $top_tb->setFormAction(
$ilCtrl->getFormAction($this));
 
  619        if ($this->viewSettings->isSelectedItemsViewActive()) {
 
  620            $button->setCaption(
"remove");
 
  622            $button->setCaption(
"pd_unsubscribe_memberships");
 
  624        $button->setCommand(
"confirmRemove");
 
  625        $top_tb->addStickyItem($button);
 
  628        $button2->setCaption(
"cancel");
 
  629        $button2->setCommand(
"getHTML");
 
  630        $top_tb->addStickyItem($button2);
 
  632        $top_tb->setCloseFormTag(
false);
 
  636        $bot_tb->addStickyItem($button);
 
  637        $bot_tb->addStickyItem($button2);
 
  638        $bot_tb->setOpenFormTag(
false);
 
  639        return $top_tb->getHTML() . $this->
getHTML() . $bot_tb->getHTML();
 
  646        $ilCtrl->setParameter($this, 
'view', $this->viewSettings->getCurrentView());
 
  647        if (!
sizeof(
$_POST[
"id"])) {
 
  649            $ilCtrl->redirect($this, 
"manage");
 
  652        if ($this->viewSettings->isSelectedItemsViewActive()) {
 
  653            $question = $this->lng->txt(
"pd_info_delete_sure_remove");
 
  654            $cmd = 
"confirmedRemove";
 
  656            $question = $this->lng->txt(
"pd_info_delete_sure_unsubscribe");
 
  657            $cmd = 
"confirmedUnsubscribe";
 
  660        include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
  662        $cgui->setHeaderText($question);
 
  664        $cgui->setFormAction(
$ilCtrl->getFormAction($this));
 
  665        $cgui->setCancel($this->lng->txt(
"cancel"), 
"manage");
 
  666        $cgui->setConfirm($this->lng->txt(
"confirm"), $cmd);
 
  668        foreach (
$_POST[
"id"] as $ref_id) {
 
  677                ilObject::_getIcon($obj_id, 
"small", 
$type),
 
  678                $this->lng->txt(
"icon") . 
" " . $this->lng->txt(
"obj_" . 
$type)
 
  682        return $cgui->getHTML();
 
  690        if (!
sizeof(
$_POST[
"ref_id"])) {
 
  691            $ilCtrl->redirect($this, 
"manage");
 
  694        foreach (
$_POST[
"ref_id"] as $ref_id) {
 
  700        ilUtil::sendSuccess($this->lng->txt(
"pd_remove_multi_confirm"), 
true);
 
  701        $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui', 
'view', $this->viewSettings->getCurrentView());
 
  702        $ilCtrl->redirectByClass(
"ilpersonaldesktopgui", 
"show");
 
  711        if (!
sizeof(
$_POST[
"ref_id"])) {
 
  712            $ilCtrl->redirect($this, 
"manage");
 
  715        foreach (
$_POST[
"ref_id"] as $ref_id) {
 
  716            if ($ilAccess->checkAccess(
"leave", 
"", $ref_id)) {
 
  720                        include_once 
"Modules/Course/classes/class.ilCourseParticipants.php";
 
  722                        $members->delete(
$ilUser->getId());
 
  724                        $members->sendUnsubscribeNotificationToAdmins(
$ilUser->getId());
 
  725                        $members->sendNotification(
 
  726                            $members->NOTIFY_UNSUBSCRIBE,
 
  733                        include_once 
"Modules/Group/classes/class.ilGroupParticipants.php";
 
  735                        $members->delete(
$ilUser->getId());
 
  737                        include_once 
'./Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
 
  738                        $members->sendNotification(
 
  742                        $members->sendNotification(
 
  753                include_once 
'./Modules/Forum/classes/class.ilForumNotification.php';
 
  759        ilUtil::sendSuccess($this->lng->txt(
"settings_saved"), 
true);
 
  760        $ilCtrl->setParameterByClass(
'ilpersonaldesktopgui', 
'view', $this->viewSettings->getCurrentView());
 
  761        $ilCtrl->redirectByClass(
"ilpersonaldesktopgui", 
"show");
 
An exception for terminatinating execution or to throw for unit testing.
setVariable($variable, $value='')
Sets a variable value.
This class represents a block method of a block.
setLimit($a_limit)
Set Limit.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
setEnableDetailRow($a_enabledetailrow)
Set EnableDetailRow.
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.
setData($a_data)
Set Data.
fillFooterLinks($a_top=false, $a_numinfo="")
Fill footer links.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setTitle($a_title)
Set Title.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
getColSpan()
Get Columns Span.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Confirmation screen class.
static addToDesktop()
Add desktop item @access public.
static removeFromDesktop()
Remove item from personal desktop @access public.
Base class for ILIAS Exception handling.
static checkForumsExistsDelete($ref_id, $user_id=0)
const TYPE_UNSUBSCRIBE_MEMBER
const TYPE_NOTIFICATION_UNSUBSCRIBE
static _dropDesktopItem($a_usr_id, $a_item_id, $a_type)
drop an item from user's personal desktop
static addListGUIActivationProperty(ilObjectListGUI $a_list_gui, array &$a_item)
Get timing details for list gui.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _lookupObjectId($a_ref_id)
lookup object id
static _lookupType($a_id, $a_reference=false)
lookup object type
BlockGUI class for Selected Items on Personal Desktop.
removeFromDeskObject()
Remove from desktop @access public.
getViewBlockHtml()
get selected item block
changeSortMode($sort_type)
fillDetailRow()
Fill Detail Setting Row.
addSectionHeader(ilTemplate $a_tpl, ilPDSelectedItemsBlockGroup $group)
orderPDItemsByType()
Sort desktop items by Type.
__construct()
ilPDSelectedItemsBlockGUI constructor.
fillDataSection()
Standard implementation for row based data.Overwrite this and call setContent for other data.
isRepositoryObject()
Returns whether block has a corresponding repository object.bool
orderPDItemsByLocation()
Sort desktop items by location.
getHTML()
Handle config status.Get HTML.
addToDeskObject()
Add desktop item @access public.
static getScreenMode()
Get Screen Mode for current command.
orderPDItemsByStartDate()
Sort desktop items by start date.
getFooterLinks()
Get footer links.
newBlockTemplate()
returns a new list block template
Class ilPDSelectedItemsBlockGroup.
Class ilPDSelectedItemsBlockListGUIFactory.
static bySettings(ilPDSelectedItemsBlockViewSettings $viewSettings)
Class ilPDSelectedItemsBlockViewSettings.
special template class to simplify handling of ITX/PEAR
touchBlock($block)
overwrites ITX::touchBlock.
parseCurrentBlock($part="DEFAULT")
Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt @access public.
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Interface for gui classes (e.g ilLuceneSearchGUI) that offer add/remove to/from desktop.