51 $this->lng = $DIC->language();
52 $this->tree = $DIC->repositoryTree();
53 $this->object_cache = $DIC[
'ilObjDataCache'];
54 $this->accessHandler = $DIC->rbac()->system();
75 if ($this->viewSettings->isSortedByLocation()) {
130 return $items_groups;
158 return $this->tree->getRootId() ==
$refId;
166 $nd = $this->tree->getNodeData($this->tree->getRootId());
167 $title =
$nd[
'title'];
169 if ($title ==
'ILIAS') {
170 $title = $this->lng->txt(
'repository');
181 require_once
'Services/Object/classes/class.ilObjectListGUIPreloader.php';
185 foreach ($item_groups as $item_group) {
186 foreach ($item_group->getItems() as $item) {
187 $obj_ids[] = $item[
'obj_id'];
188 $listPreloader->addItem($item[
'obj_id'], $item[
'type'], $item[
'ref_id']);
192 $listPreloader->preload();
203 $objDefinition = $DIC[
"objDefinition"];
205 $object_types_by_container = $DIC[
'objDefinition']->getGroupedRepositoryObjectTypes(array(
'cat',
'crs',
'grp',
'fold'));
207 $grouped_items = array();
209 foreach ($object_types_by_container as $container_object_type => $container_data) {
212 if (!$objDefinition->isPlugin($container_object_type)) {
213 $title = $this->lng->txt(
'objs_' . $container_object_type);
215 include_once(
"./Services/Component/classes/class.ilPlugin.php");
217 $title = $pl->txt(
"objs_" . $container_object_type);
220 $group->setLabel($title);
221 $group->setItems($this->provider->getItems($container_data[
'objs']));
223 $grouped_items[] = $group;
226 return $grouped_items;
234 $items = $this->provider->getItems();
236 if (0 == count($items)) {
241 'upcoming' => array(),
242 'ongoing' => array(),
244 'not_dated' => array()
246 foreach ($items as $key => $item) {
247 if ($item[
'start'] && $item[
'start']->
get(
IL_CAL_UNIX) > 0 && $item[
'start'] instanceof
ilDateTime) {
249 $groups[
'upcoming'][] = $item;
250 } elseif ($item[
'end']->
get(
IL_CAL_UNIX) > time()) {
251 $groups[
'ongoing'][] = $item;
253 $groups[
'ended'][] = $item;
256 $groups[
'not_dated'][] = $item;
260 uasort($groups[
'upcoming'],
function ($left, $right) {
267 return strcmp($left[
'title'], $right[
'title']);
270 uasort($groups[
'ongoing'],
function ($left, $right) {
277 return strcmp($left[
'title'], $right[
'title']);
280 uasort($groups[
'ended'],
function ($left, $right) {
287 return strcmp($left[
'title'], $right[
'title']);
290 uasort($groups[
'not_dated'],
function ($left, $right) {
291 return strcmp($left[
'title'], $right[
'title']);
295 $upcoming->setLabel($this->lng->txt(
'pd_upcoming'));
296 $upcoming->setItems($groups[
'upcoming']);
299 $ongoing->setLabel($this->lng->txt(
'pd_ongoing'));
300 $ongoing->setItems($groups[
'ongoing']);
303 $ended->setLabel($this->lng->txt(
'pd_ended'));
304 $ended->setItems($groups[
'ended']);
307 $not_dated->setLabel($this->lng->txt(
'pd_not_date'));
308 $not_dated->setItems($groups[
'not_dated']);
310 return array_filter([
316 return count($group->
getItems()) > 0;
325 $grouped_items = array();
327 $items = $this->provider->getItems();
329 $parent_ref_ids = array_values(array_unique(array_map(
function ($item) {
330 return $item[
'parent_ref'];
332 $this->object_cache->preloadReferenceCache($parent_ref_ids);
334 foreach ($items as $key => $item) {
335 if (!array_key_exists(
'grp_' . $item[
'parent_ref'], $grouped_items)) {
342 $group->setLabel($this->object_cache->lookupTitle($this->object_cache->lookupObjId($item[
'parent_ref'])));
344 $grouped_items[
'grp_' . $item[
'parent_ref']] = $group;
347 $grouped_items[
'grp_' . $item[
'parent_ref']]->pushItem($item);
350 return $grouped_items;
Class ilPDSelectedItemsBlockMembershipsViewGUI.
__construct(ilPDSelectedItemsBlockViewSettings $viewSettings, ilPDSelectedItemsBlockProvider $provider)
ilPDSelectedItemsBlockViewGUI constructor.
Class ilPDSelectedItemsBlockViewGUI.
static preloadByObjIds(array $a_obj_ids)
Preload list gui data.
Class ilPDSelectedItemsBlockGroup.
Class ilPDSelectedItemsBlockSelectedItemsViewGUI.
static getPluginObjectByType($type)
Return either a repoObject plugin or a orgunit extension plugin or null if the type is not a plugin...
Preloader for object list GUIs.
preloadItemGroups(array $item_groups)
Class ilPDSelectedItemsBlockMembershipsProvider.
const CONTEXT_PERSONAL_DESKTOP
static bySettings(ilPDSelectedItemsBlockViewSettings $viewSettings)
setIsInManageMode(bool $isInManageMode)
getMinimumDetailLevelForSection()
Class ilPDSelectedItemsBlockMembershipsProvider.
Interface ilPDSelectedItemsBlockProvider.
isMembershipsViewActive()