ILIAS  release_8 Revision v8.24
class.ilObjWorkflowEngineGUI.php
Go to the documentation of this file.
1<?php
2
20
29{
30 private \ILIAS\WorkflowEngine\Service $service;
35 public ilTree $tree;
38 protected Container $dic;
39
40 public function __construct($a_data, int $a_id, bool $a_call_by_reference = true, bool $a_prepare_output = true)
41 {
42 global $DIC;
43
44 $this->ilTabs = $DIC['ilTabs'];
45 $this->lng = $DIC['lng'];
46 $this->lng->loadLanguageModule('wfe');
47 $this->ilCtrl = $DIC['ilCtrl'];
48 $this->tpl = $DIC['tpl'];
49 $this->tree = $DIC['tree'];
50 $this->ilLocator = $DIC['ilLocator'];
51 $this->ilToolbar = $DIC['ilToolbar'];
52 $this->dic = $DIC;
53 $this->service = $DIC->workflowEngine();
54 $this->type = 'wfe';
55 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
56 $this->assignObject();
57 }
58
59 public function executeCommand(): void
60 {
61 $next_class = $this->ilCtrl->getNextClass();
62
63 if ($next_class === '' || $next_class === null) {
64 $this->prepareAdminOutput();
65 $this->tpl->setContent($this->dispatchCommand($this->ilCtrl->getCmd('dashboard.view')));
66 return;
67 }
68
69 switch ($next_class) {
70 case 'ilpermissiongui':
71 $this->prepareAdminOutput();
72 $this->initTabs('permissions');
73 $this->ilTabs->setTabActive('perm_settings');
74 $perm_gui = new ilPermissionGUI($this);
75 $this->ctrl->forwardCommand($perm_gui);
76 break;
77 }
78 }
79
80 public function dispatchCommand(string $cmd): string
81 {
82 return $this->dispatchToSettings('view');
83 }
84
85 public function prepareAdminOutput(): void
86 {
87 $this->tpl->loadStandardTemplate();
88
89 $this->tpl->setTitleIcon(ilUtil::getImagePath('icon_wfe.svg'));
90 $this->tpl->setTitle($this->getObject()->getTitle());
91 $this->tpl->setDescription($this->getObject()->getDescription());
92
93 $this->initLocator();
94 }
95
96 public function initTabs(string $section): void
97 {
98 global $DIC;
99 $rbacsystem = $DIC->rbac()->system();
100
101 if ($rbacsystem->checkAccess('visible,read', $this->getObject()->getRefId())) {
102 $this->ilTabs->addTab(
103 'settings',
104 $this->lng->txt('settings'),
105 $this->ilCtrl->getLinkTarget($this, 'settings.view')
106 );
107 }
108 if ($rbacsystem->checkAccess('edit_permission', $this->getObject()->getRefId())) {
109 $this->ilTabs->addTab(
110 'perm_settings',
111 $this->lng->txt('perm_settings'),
112 $this->ilCtrl->getLinkTargetByClass(['ilobjworkflowenginegui', 'ilpermissiongui'], 'perm')
113 );
114 }
115
116 $this->ilTabs->setTabActive($section);
117 }
118
119 public function initLocator(): void
120 {
121 $path = $this->tree->getPathFull($this->service->internal()->request()->getRefId());
122 array_shift($path);
123 foreach ($path as $key => $row) {
124 if ($row["title"] === "Workflow Engine") {
125 $row["title"] = $this->lng->txt("obj_wfe");
126 }
127
128 $this->ilCtrl->setParameter($this, "ref_id", $row["child"]);
129 $this->ilLocator->addItem(
130 $row["title"],
131 $this->ilCtrl->getLinkTarget($this, "dashboard.view"),
132 ilFrameTargetInfo::_getFrame("MainContent"),
133 $row["child"]
134 );
135
136 $this->ilCtrl->setParameter($this, "ref_id", $this->service->internal()->request()->getRefId());
137 }
138
139 $this->tpl->setLocator();
140 }
141
142 public function dispatchToSettings(string $command): string
143 {
144 $this->initTabs('settings');
145 $target_handler = new ilWorkflowEngineSettingsGUI($this);
146 return $target_handler->handle($command);
147 }
148}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
Class ilCtrl provides processing control methods.
getNextClass($a_gui_class=null)
@inheritDoc
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
getCmd(string $fallback_command=null)
@inheritDoc
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
static _getFrame(string $a_class)
language handling
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjWorkflowEngineGUI.
ILIAS WorkflowEngine Service $service
__construct($a_data, int $a_id, bool $a_call_by_reference=true, bool $a_prepare_output=true)
ilGlobalTemplateInterface $tpl
Class ilObjectGUI Basic methods of all Output classes.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$path
Definition: ltiservices.php:32
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
string $key
Consumer key/client ID value.
Definition: System.php:193