ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilObjectPluginListGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once "Services/Object/classes/class.ilObjectListGUI.php";
5 
13 abstract class ilObjectPluginListGUI extends ilObjectListGUI
14 {
15 
19  public function __construct($a_context = self::CONTEXT_REPOSITORY)
20  {
21  global $DIC;
22 
23  parent::__construct($a_context);
24 
25  $this->lng = $DIC->language();
26  $this->user = $DIC->user();
27  }
28 
29 
33  protected $plugin;
34 
38  final public function init()
39  {
40  $this->initListActions();
41  $this->initType();
42  $this->plugin = $this->getPlugin();
43  $this->gui_class_name = $this->getGuiClass();
44  $this->commands = $this->initCommands();
45  }
46 
47  abstract public function getGuiClass();
48  abstract public function initCommands();
49 
55  public function setType($a_val)
56  {
57  $this->type = $a_val;
58  }
59 
63  protected function getPlugin()
64  {
65  if (!$this->plugin) {
66  $this->plugin =
69  "Repository",
70  "robj",
71  ilPlugin::lookupNameForId(IL_COMP_SERVICE, "Repository", "robj", $this->getType())
72  );
73  }
74  return $this->plugin;
75  }
76 
82  public function getType()
83  {
84  return $this->type;
85  }
86 
87  abstract public function initType();
88 
92  public function txt($a_str)
93  {
94  return $this->plugin->txt($a_str);
95  }
96 
97 
98 
106  public function getCommandFrame($a_cmd)
107  {
108  return ilFrameTargetInfo::_getFrame("MainContent");
109  }
110 
119  public function getProperties()
120  {
121  $lng = $this->lng;
123 
124  $props = array();
125 
126  return $props;
127  }
128 
129 
137  public function getCommandLink($a_cmd)
138  {
139 
140  // separate method for this line
141  $cmd_link = "ilias.php?baseClass=ilObjPluginDispatchGUI&amp;" .
142  "cmd=forward&amp;ref_id=" . $this->ref_id . "&amp;forwardCmd=" . $a_cmd;
143 
144  return $cmd_link;
145  }
146 
147  protected function initListActions()
148  {
149  $this->delete_enabled = true;
150  $this->cut_enabled = true;
151  $this->subscribe_enabled = true;
152  $this->link_enabled = true;
153  $this->info_screen_enabled = true;
154  }
155 }
static getPluginObject(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname)
getProperties()
Get item properties.
user()
Definition: user.php:4
getCommandFrame($a_cmd)
Get command target frame.
static lookupNameForId(string $a_ctype, string $a_cname, string $a_slot_id, string $a_plugin_id)
Class ilObjectListGUI.
global $DIC
Definition: goto.php:24
__construct($a_context=self::CONTEXT_REPOSITORY)
Constructor.
ListGUI implementation for Example object plugin.
getCommandLink($a_cmd)
Get command link url.
static _getFrame($a_class, $a_type='')
Get content frame name.
__construct(Container $dic, ilPlugin $plugin)
$ilUser
Definition: imgupload.php:18
const IL_COMP_SERVICE