ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilPDSelectedItemsBlockListGUIFactory.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
8 {
10  protected static $list_by_type = [];
11 
13  protected $objDefinition;
14 
16  protected $block;
17 
19  protected $blockView;
20 
26  public function __construct(
29  ) {
30  global $DIC;
31 
32  $this->objDefinition = $DIC['objDefinition'];
33  $this->block = $block;
34  $this->blockView = $blockView;
35  }
36 
42  public function byType($a_type)
43  {
45  if (!array_key_exists($a_type, self::$list_by_type)) {
46  $class = $this->objDefinition->getClassName($a_type);
47  if (!$class) {
48  throw new ilException(sprintf("Could not find a class for object type: %s", $a_type));
49  }
50 
51  $location = $this->objDefinition->getLocation($a_type);
52  if (!$location) {
53  throw new ilException(sprintf("Could not find a class location for object type: %s", $a_type));
54  }
55 
56  $full_class = 'ilObj' . $class . 'ListGUI';
57  require_once $location . '/class.' . $full_class . '.php';
58  $item_list_gui = new $full_class();
59 
60  $item_list_gui->setContainerObject($this->block);
61  $item_list_gui->enableNotes(false);
62  $item_list_gui->enableComments(false);
63  $item_list_gui->enableTags(false);
64 
65  $item_list_gui->enableIcon(true);
66  $item_list_gui->enableDelete(false);
67  $item_list_gui->enableCut(false);
68  $item_list_gui->enableCopy(false);
69  $item_list_gui->enableLink(false);
70  $item_list_gui->enableInfoScreen(true);
71 
72  $item_list_gui->enableCommands(true, true);
73 
74  self::$list_by_type[$a_type] = $item_list_gui;
75  }
76 
77  return (clone self::$list_by_type[$a_type]);
78  }
79 }
$location
Definition: buildRTE.php:44
Class ilPDSelectedItemsBlockViewGUI.
Class ilPDSelectedItemsBlockListGUIFactory.
global $DIC
Definition: goto.php:24
ilPDSelectedItemsBlockGUI: ilColumnGUI ilPDSelectedItemsBlockGUI: ilCommonActionDispatcherGUI ...
__construct(ilPDSelectedItemsBlockGUI $block, ilPDSelectedItemsBlockViewGUI $blockView)
ilPDSelectedItemsBlockListGUIFactory constructor.