ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilPDSelectedItemsBlockListGUIFactory.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
24  protected static array $list_by_type = [];
28 
29  public function __construct(
32  ) {
33  global $DIC;
34 
35  $this->objDefinition = $DIC['objDefinition'];
36  $this->block = $block;
37  $this->blockView = $blockView;
38  }
39 
43  public function byType(string $a_type): ilObjectListGUI
44  {
46  if (!array_key_exists($a_type, self::$list_by_type)) {
47  $class = $this->objDefinition->getClassName($a_type);
48  if (!$class) {
49  throw new ilException(sprintf("Could not find a class for object type: %s", $a_type));
50  }
51 
52  $location = $this->objDefinition->getLocation($a_type);
53  if (!$location) {
54  throw new ilException(sprintf("Could not find a class location for object type: %s", $a_type));
55  }
56 
57  $full_class = 'ilObj' . $class . 'ListGUI';
58  require_once $location . '/class.' . $full_class . '.php';
59  $item_list_gui = new $full_class();
60 
61  $item_list_gui->setContainerObject($this->block);
62  $item_list_gui->enableNotes(false);
63  $item_list_gui->enableComments(false);
64  $item_list_gui->enableTags(false);
65 
66  $item_list_gui->enableIcon(true);
67  $item_list_gui->enableDelete(false);
68  $item_list_gui->enableCut(false);
69  $item_list_gui->enableCopy(false);
70  $item_list_gui->enableLink(false);
71  $item_list_gui->enableInfoScreen(true);
72 
73  $item_list_gui->enableCommands(true, true);
74 
75  self::$list_by_type[$a_type] = $item_list_gui;
76  }
77 
78  return (clone self::$list_by_type[$a_type]);
79  }
80 }
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: buildRTE.php:22
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
parses the objects.xml it handles the xml-description of all ilias objects
ilPDSelectedItemsBlockGUI: ilColumnGUI ilPDSelectedItemsBlockGUI: ilCommonActionDispatcherGUI ...
__construct(ilPDSelectedItemsBlockGUI $block, ilPDSelectedItemsBlockViewGUI $blockView)