ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 {
12  protected static $list_by_type = array();
13 
17  protected $objDefinition;
18 
22  protected $block;
23 
29  {
30  global $DIC;
31 
32  $this->objDefinition = $DIC['objDefinition'];
33  $this->block = $block;
34  }
35 
41  public function byType($a_type)
42  {
44  if (!array_key_exists($a_type, self::$list_by_type)) {
45  $class = $this->objDefinition->getClassName($a_type);
46  if (!$class) {
47  throw new ilException(sprintf("Could not find a class for object type: %s", $a_type));
48  }
49 
50  $location = $this->objDefinition->getLocation($a_type);
51  if (!$location) {
52  throw new ilException(sprintf("Could not find a class location for object type: %s", $a_type));
53  }
54 
55  $full_class = 'ilObj' . $class . 'ListGUI';
56  require_once $location . '/class.' . $full_class . '.php';
57  $item_list_gui = new $full_class();
58 
59  $item_list_gui->setContainerObject($this->block);
60  $item_list_gui->enableNotes(false);
61  $item_list_gui->enableComments(false);
62  $item_list_gui->enableTags(false);
63 
64  $item_list_gui->enableIcon(true);
65  $item_list_gui->enableDelete(false);
66  $item_list_gui->enableCut(false);
67  $item_list_gui->enableCopy(false);
68  $item_list_gui->enableLink(false);
69  $item_list_gui->enableInfoScreen(true);
70  $item_list_gui->enableSubscribe($this->block->getViewSettings()->enabledSelectedItems());
71 
72  if ($this->block->getCurrentDetailLevel() < 3 || $this->block->isManagedView()) {
73  $item_list_gui->enableDescription(false);
74  $item_list_gui->enableProperties(false);
75  $item_list_gui->enablePreconditions(false);
76  $item_list_gui->enableNoticeProperties(false);
77  }
78 
79  if ($this->block->getCurrentDetailLevel() < 2 || $this->block->isManagedView()) {
80  $item_list_gui->enableCommands(true, true);
81  }
82 
83  self::$list_by_type[$a_type] = $item_list_gui;
84  }
85 
86  return (clone self::$list_by_type[$a_type]);
87  }
88 }
global $DIC
Definition: saml.php:7
$location
Definition: buildRTE.php:44
Class ilPDSelectedItemsBlockListGUIFactory.
$a_type
Definition: workflow.php:92
__construct(ilPDSelectedItemsBlockGUI $block)
ilPDSelectedItemsBlockListGUIFactory constructor.
Create styles array
The data for the language used.
BlockGUI class for Selected Items on Personal Desktop.