ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilObjWorkflowEngineGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2016 ILIAS open source, Extended GPL, see docs/LICENSE */
3
5require_once './Services/Object/classes/class.ilObject2GUI.php';
6
20{
22 public $ilCtrl;
23
25 public $ilTabs;
26
28 public $lng;
29
31 public $tpl;
32
34 public $tree;
35
37 public $ilLocator;
38
40 public $ilToolbar;
41
45 protected $dic;
46
50 public function __construct()
51 {
52 global $DIC;
53
54 $this->ilTabs = $DIC['ilTabs'];
55 $this->lng = $DIC['lng'];
56 $this->lng->loadLanguageModule('wfe');
57 $this->ilCtrl = $DIC['ilCtrl'];
58 $this->tpl = $DIC['tpl'];
59 $this->tree = $DIC['tree'];
60 $this->ilLocator = $DIC['ilLocator'];
61 $this->ilToolbar = $DIC['ilToolbar'];
62 $this->dic = $DIC;
63
64 parent::__construct((int) $_GET['ref_id']);
65 $this->assignObject();
66 }
67
71 public function getType()
72 {
73 return null;
74 }
75
76 public function executeCommand()
77 {
78 $next_class = $this->ilCtrl->getNextClass();
79
80 if ($next_class == '') {
81 $this->prepareAdminOutput();
82 $this->tpl->setContent($this->dispatchCommand($this->ilCtrl->getCmd('dashboard.view')));
83 return;
84 }
85
86 switch ($next_class) {
87 case 'ilpermissiongui':
88 $this->prepareAdminOutput();
89 $this->initTabs('permissions');
90 $this->ilTabs->setTabActive('perm_settings');
91 require_once 'Services/AccessControl/classes/class.ilPermissionGUI.php';
92 $perm_gui = new ilPermissionGUI($this);
93 $this->ctrl->forwardCommand($perm_gui);
94 break;
95 }
96 }
97
103 public function dispatchCommand($cmd)
104 {
105 $cmd_parts = explode('.', $cmd);
106 return $this->dispatchToSettings($cmd_parts[1]);
107 }
108
112 public function prepareAdminOutput()
113 {
114 $this->tpl->loadStandardTemplate();
115
116 $this->tpl->setTitleIcon(ilUtil::getImagePath('icon_wfe.svg'));
117 $this->tpl->setTitle($this->object->getPresentationTitle());
118 $this->tpl->setDescription($this->object->getLongDescription());
119
120 $this->initLocator();
121 }
122
126 public function initTabs($section)
127 {
128 global $DIC;
130 $rbacsystem = $DIC['rbacsystem'];
131
132 if ($rbacsystem->checkAccess('visible,read', $this->object->getRefId())) {
133 $this->ilTabs->addTab(
134 'settings',
135 $this->lng->txt('settings'),
136 $this->ilCtrl->getLinkTarget($this, 'settings.view')
137 );
138 }
139 if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
140 $this->ilTabs->addTab(
141 'perm_settings',
142 $this->lng->txt('perm_settings'),
143 $this->ilCtrl->getLinkTargetByClass(array('ilobjworkflowenginegui','ilpermissiongui'), 'perm')
144 );
145 }
146 $this->ilTabs->setTabActive($section);
147 }
148
152 public function initLocator()
153 {
154 $path = $this->tree->getPathFull((int) $_GET["ref_id"]);
155 array_shift($path);
156 foreach ((array) $path as $key => $row) {
157 if ($row["title"] == "Workflow Engine") {
158 $row["title"] = $this->lng->txt("obj_wfe");
159 }
160
161 $this->ilCtrl->setParameter($this, "ref_id", $row["child"]);
162 $this->ilLocator->addItem(
163 $row["title"],
164 $this->ilCtrl->getLinkTarget($this, "dashboard.view"),
165 ilFrameTargetInfo::_getFrame("MainContent"),
166 $row["child"]
167 );
168
169 $this->ilCtrl->setParameter($this, "ref_id", $_GET["ref_id"]);
170 }
171
172 $this->tpl->setLocator();
173 }
174
180 public function dispatchToSettings($command)
181 {
182 $this->initTabs('settings');
184 require_once './Services/WorkflowEngine/classes/administration/class.ilWorkflowEngineSettingsGUI.php';
185 $target_handler = new ilWorkflowEngineSettingsGUI($this);
186 return $target_handler->handle($command);
187 }
188}
$section
Definition: Utf8Test.php:83
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
This class provides processing control methods.
getCmd($a_default_cmd="", $a_safe_commands="")
Determines current get/post command.
getNextClass($a_gui_class=null)
Get next class in the control path from the current class to the target command class.
getLinkTarget( $a_gui_obj, $a_cmd="", $a_anchor="", $a_asynch=false, $xml_style=false)
Get link target for command using gui object.
setParameter($a_obj, $a_parameter, $a_value)
Set parameters that should be passed a form and link of a gui class.
static _getFrame($a_class, $a_type='')
Get content frame name.
@noinspection PhpIncludeInspection
__construct()
ilObjWorkflowEngineGUI constructor.
New implementation of ilObjectGUI.
assignObject()
create object instance as internal property (repository/workspace switch)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Class ilWorkflowEngineSettingsGUI.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc