ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjectPluginListGUI.php
Go to the documentation of this file.
1<?php
2
27{
30
31 public function __construct(int $a_context = self::CONTEXT_REPOSITORY)
32 {
33 global $DIC;
34
35 $this->component_factory = $DIC["component.factory"];
36
37 parent::__construct($a_context);
38
39 $this->lng = $DIC->language();
40 $this->user = $DIC->user();
41 }
42
43 final public function init(): void
44 {
45 $this->initListActions();
46 $this->initType();
47 $this->plugin = $this->getPlugin();
48 $this->gui_class_name = $this->getGuiClass();
49 $this->commands = $this->initCommands();
50 }
51
52 abstract public function getGuiClass(): string;
53 abstract public function initCommands(): array;
54
55 public function setType(string $a_val): void
56 {
57 $this->type = $a_val;
58 }
59
63 protected function getPlugin(): ?ilRepositoryObjectPlugin
64 {
65 if (!$this->plugin) {
66 $this->plugin = $this->component_factory->getPlugin($this->getType());
67 }
68 return $this->plugin;
69 }
70
71 public function getType(): string
72 {
73 return $this->type;
74 }
75
76 abstract public function initType();
77
78 public function txt(string $a_str): string
79 {
80 return $this->plugin->txt($a_str);
81 }
82
83 public function getCommandFrame(string $cmd): string
84 {
85 return ilFrameTargetInfo::_getFrame("MainContent");
86 }
87
88 public function getProperties(): array
89 {
90 return [];
91 }
92
93 public function getCommandLink(string $cmd): string
94 {
95 // separate method for this line
96 $cmd_link = "ilias.php?baseClass=ilObjPluginDispatchGUI&amp;" .
97 "cmd=forward&amp;ref_id=" . $this->ref_id . "&amp;forwardCmd=" . $cmd;
98
99 return $cmd_link;
100 }
101
102 protected function initListActions(): void
103 {
104 $this->delete_enabled = true;
105 $this->cut_enabled = true;
106 $this->subscribe_enabled = true;
107 $this->link_enabled = true;
108 $this->info_screen_enabled = true;
109 }
110}
static _getFrame(string $a_class)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilRepositoryObjectPlugin $plugin
getCommandFrame(string $cmd)
Get command target frame.
getProperties()
Get item properties.
__construct(int $a_context=self::CONTEXT_REPOSITORY)
getCommandLink(string $cmd)
Get command link url.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26