public function getNetnavigationForUser($item) { $return = array(); $current_context = $this->_environment->getCurrentContextItem(); $current_user = $this->_environment->getCurrentUser(); $translator = $this->_environment->getTranslationObject(); $converter = $this->_environment->getTextConverter(); if ($current_context->isProjectRoom()) { $link_items = $item->getLinkItemList(CS_GROUP_TYPE); } elseif ($current_context->isCommunityRoom()) { $link_items = $item->getLinkItemList(CS_INSTITUTION_TYPE); } else { $link_items = new cs_list(); } // remove items from list the current user is not allowed to see or ??? $count_item = $link_items->getFirst(); while ($count_item) { $linked_item = $count_item->getLinkedItem($item); if (isset($linked_item)) { $type = $linked_item->getType(); } $module = Type2Module($type); if ($module === CS_USER_TYPE && ($item->getItemType() == CS_GROUP_TYPE || (!$linked_item->isUser() || !$linked_item->maySee($current_user)))) { $link_items->removeElement($count_item); } $count_item = $link_items->getNext(); } $count_link_item = $link_items->getCount(); $return['count'] = $count_link_item; /* * $this->_right_box_config['title_string'] .= $separator.'"'.$this->_translator->getMessage('COMMON_NETNAVIGATION_ENTRIES').' ('.$count_link_item.')"'; $this->_right_box_config['desc_string'] .= $separator.'""'; $this->_right_box_config['size_string'] .= $separator.'"10"'; if($current_context->isNetnavigationShowExpanded()){ $this->_right_box_config['config_string'] .= $separator.'true'; } else { $this->_right_box_config['config_string'] .= $separator.'false'; } $html .= '<div class="commsy_panel" style="margin-bottom:1px;">'.LF; $html .= '<div class="right_box">'.LF; */ $return['items'] = array(); if (!$link_items->isEmpty()) { $link_item = $link_items->getFirst(); while ($link_item) { $entry = array('creator' => ''); $link_creator = $link_item->getCreatorItem(); if (isset($link_creator) && !$link_creator->isDeleted()) { $entry['creator'] = $link_creator->getFullname(); // create the list entry $linked_item = $link_item->getLinkedItem($item); if (isset($linked_item)) { $type = $linked_item->getType(); if ($type === 'label') { $type = $linked_item->getLabelType(); } $link_created = $translator->getDateInLang($link_item->getCreationDate()); switch (mb_strtoupper($type, 'UTF-8')) { case 'ANNOUNCEMENT': $text = $translator->getMessage('COMMON_ONE_ANNOUNCEMENT'); $img = 'announcement.png'; break; case 'DATE': $text = $translator->getMessage('COMMON_ONE_DATE'); $img = 'date.png'; break; case 'DISCUSSION': $text = $translator->getMessage('COMMON_ONE_DISCUSSION'); $img = 'discussion.png'; break; case 'GROUP': $text = $translator->getMessage('COMMON_ONE_GROUP'); $img = 'group.png'; break; case 'INSTITUTION': $text = $translator->getMessage('COMMON_ONE_INSTITUTION'); $img = ''; break; case 'MATERIAL': $text = $translator->getMessage('COMMON_ONE_MATERIAL'); $img = 'material.png'; break; case 'PROJECT': $text = $translator->getMessage('COMMON_ONE_PROJECT'); $img = ''; break; case 'TODO': $text = $translator->getMessage('COMMON_ONE_TODO'); $img = 'todo.png'; break; case 'TOPIC': $text = $translator->getMessage('COMMON_ONE_TOPIC'); $img = 'topic.png'; break; case 'USER': $text = $translator->getMessage('COMMON_ONE_USER'); $img = 'user.png'; break; default: $text = $translator->getMessage('COMMON_MESSAGETAB_ERROR'); $img = ''; break; } $link_creator_text = $text . ' - ' . $translator->getMessage('COMMON_LINK_CREATOR') . ' ' . $entry['creator'] . ', ' . $link_created; switch ($type) { case CS_DISCARTICLE_TYPE: $linked_iid = $linked_item->getDiscussionID(); $discussion_manager = $this->_environment->getDiscussionManager(); $linked_item = $discussion_manager->getItem($linked_iid); break; case CS_SECTION_TYPE: $linked_iid = $linked_item->getLinkedItemID(); $material_manager = $this->_environment->getMaterialManager(); $linked_item = $material_manager->getItem($linked_iid); break; default: $linked_iid = $linked_item->getItemID(); } $entry['link_id'] = $link_item->getItemID(); $entry['linked_iid'] = $linked_iid; $entry['sorting_place'] = $link_item->getSortingPlace(); $module = Type2Module($type); $user = $this->_environment->getCurrentUser(); if (!($module == CS_USER_TYPE && (!$linked_item->isUser() || !$linked_item->maySee($user)))) { if ($linked_item->isNotActivated() && !($linked_item->getCreatorID() === $user->getItemID() || $user->isModerator())) { $activating_date = $linked_item->getActivatingDate(); if (strstr($activating_date, '9999-00-00')) { $link_creator_text .= ' (' . $translator->getMessage('COMMON_NOT_ACTIVATED') . ')'; } else { $link_creator_text .= ' (' . $translator->getMessage('COMMON_ACTIVATING_DATE') . ' ' . getDateInLang($linked_item->getActivatingDate()) . ')'; } if ($module === CS_USER_TYPE) { $title = $linked_item->getFullName(); } else { $title = $linked_item->getTitle(); } $title = $converter->text_as_html_short($title); $entry['module'] = $module; $entry['img'] = $img; $entry['title'] = $link_creator_text; $entry['link_text'] = $title; /* * TODO: check if working $html .= ahref_curl( $this->_environment->getCurrentContextID(), $module, 'detail', $params, '<img src="' . $img . '" style="padding-right:3px;" title="' . $link_creator_text . '"/>', $link_creator_text, '_self', $fragment, '', '', '', 'class="disabled"', '', '', true); $html .= ahref_curl( $this->_environment->getCurrentContextID(), $module, 'detail', $params, $link_title, $link_creator_text, '_self', $fragment, '', '', '', 'class="disabled"', '', '', true); unset($params); */ } else { if ($module === CS_USER_TYPE) { $title = $linked_item->getFullName(); } else { $title = $linked_item->getTitle(); } $title = $converter->text_as_html_short($title); $entry['module'] = $module; $entry['img'] = $img; $entry['title'] = $link_creator_text; $entry['link_text'] = $title; /* * TODO: check if needed - $link_creator_text is empty!!! * * * $html .= ahref_curl( $this->_environment->getCurrentContextID(), $module, 'detail', $params, '<img src="' . $img . '" style="padding-right:3px;" title="' . $link_creator_text . '"/>', $link_creator_text, '_self', $fragment, '', '', '', 'style=""'); $html .= ahref_curl( $this->_environment->getCurrentContextID(), $module, 'detail', $params, $link_title, $link_creator_text, '_self', $fragment, '', '', '', 'style=""'); unset($params); */ } $return['items'][] = $entry; } } } $link_item = $link_items->getNext(); } } return $return; }
$rubric_manager = $environment->getManager(CS_MATERIAL_TYPE); $rubric_manager->setContextLimit($context); if(!empty($_GET['search'])){ $rubric_manager->setSearchLimit($_GET['search']); } $rubric_manager->showNoNotActivatedEntries(); $rubric_manager->select(); $item_list = $rubric_manager->get(); $complete_list->addList($item_list); } } $complete_list->sortby('modification_date'); $complete_list->reverse(); $count = $complete_list->getCount(); $number_of_pages = 0; if($count % $interval == 0){ $number_of_pages = ($count / $interval)-1; } else { $number_of_pages = (($count - ($count % $interval)) / $interval); } if($number_of_pages == -1){ $number_of_pages++; } $result_page = $_GET['page']; if($result_page > $number_of_pages){ $result_page = $number_of_pages; } else if($result_page == -1){
if (isset($_GET['select']) and $_GET['select']=='all'){ if(get_class($rubric_manager) == 'cs_user_manager'){ $selected_ids = $temp_rubric_ids; } } $search_list->addList($rubric_list); if (!empty($temp_rubric_ids)){ $rubric_ids = $temp_rubric_ids; } $session->setValue('cid'.$environment->getCurrentContextID().'_'.$rubric.'_index_ids', $rubric_ids); $campus_search_ids = array_merge($campus_search_ids, $rubric_ids); } } if($interval == 0){ $interval = $search_list->getCount(); } // Set data for view $sublist = $search_list->getSubList($from-1,$interval); $view->setList($sublist); $view->setCountAllShown($search_list->getCount()); $view->setCountAll($count_all); $view->setFrom($from); $view->setInterval($interval); $view->setSearchText($search); $view->setSelectedRestriction($selrestriction); $view->setSelectedFile($selfiles); $view->setAvailableBuzzwords($buzzword_list); $view->setChoosenRubric($selrubric); $view->setSelectedBuzzword($selbuzzword); $view->setSelectedTagArray($seltag_array);
// ensure community rooms are listed before project rooms if ($roomListItem->isCommunityRoom()) { $moveList->reverse(); $moveList->add($roomListItem); $moveList->reverse(); } else { $moveList->add($roomListItem); } $moveIdArray[] = $roomListItem->getItemID(); } $roomListItem = $roomList->getNext(); } $numRoomsMoved = $moveList->getCount(); // check for rooms, that were unable to find if ($numRoomsMoved !== sizeof($csvContent)) { $diff = array_diff($csvContent, $moveIdArray); echo "Die folgenden Raum ID's konnten nicht gefunden werden. Ggf. sind diese Räume gelöscht."; nl(); foreach ($diff as $notFoundId) { echo "- " . $notFoundId; nl(); } nl(); } echo "Die gelisteten $numRoomsMoved Räume sollen umgezogen werden!"; nl(); echo "korrekt? (ja): ";