ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilSessionObjectListGUIFactory.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
30 {
31  private static array $item_list_gui = [];
32 
37  public static function factory(string $a_type): ?ilObjectListGUI
38  {
39  global $DIC;
40 
41  $objDefinition = $DIC['objDefinition'];
42 
43  if (isset(self::$item_list_gui[$a_type])) {
44  return self::$item_list_gui[$a_type];
45  }
46 
47  if (!$a_type) {
48  return null;
49  }
50 
51  try {
52  $item_list_gui = ilObjectListGUIFactory::_getListGUIByType($a_type);
53  } catch (ilObjectException $e) {
54  return null;
55  }
56  if (!$item_list_gui instanceof ilObjectListGUI) {
57  return null;
58  }
59  $item_list_gui->enableDelete(false);
60  $item_list_gui->enableCut(false);
61  $item_list_gui->enableCopy(false);
62  $item_list_gui->enableSubscribe(true);
63  $item_list_gui->enableIcon(true);
64  $item_list_gui->enableLink(false);
65  $item_list_gui->enablePath(false);
66  $item_list_gui->enableLinkedPath(false);
67  $item_list_gui->enableSearchFragments(false);
68  $item_list_gui->enableRelevance(false);
69  $item_list_gui->enableCheckbox(false);
70  return self::$item_list_gui[$a_type] = $item_list_gui;
71  }
72 }
static factory(string $a_type)
Get list gui by type This method caches all the returned list guis.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
static _getListGUIByType(string $type, int $context=ilObjectListGUI::CONTEXT_REPOSITORY)