ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\components\OrgUnit\ARHelper\BaseCommands Class Reference

Interface BaseCommands. More...

+ Inheritance diagram for ILIAS\components\OrgUnit\ARHelper\BaseCommands:
+ Collaboration diagram for ILIAS\components\OrgUnit\ARHelper\BaseCommands:

Public Member Functions

 getParentGui ()
 
 setParentGui (BaseCommands $parent_gui)
 
 executeCommand ()
 
 addSubTabs ()
 

Data Fields

const CMD_INDEX = "index"
 
const CMD_DEFAULT_PERMISSIONS = "defaultPermissions"
 
const CMD_ADD = "add"
 
const CMD_CREATE = "create"
 
const CMD_EDIT = "edit"
 
const CMD_UPDATE = "update"
 
const CMD_CONFIRM = "confirm"
 
const CMD_DELETE = "delete"
 
const CMD_CANCEL = "cancel"
 
const AR_ID = "arid"
 

Protected Member Functions

 __construct (protected array $query_namespace=['orgu', 'posedit'])
 
 index ()
 
 getPossibleNextClasses ()
 
 getActiveTabId ()
 
 cancel ()
 
 setContent (string $html)
 
 pushSubTab (string $subtab_id, string $url)
 
 activeSubTab (string $subtab_id)
 
 getParentRefId ()
 
 getRowIdFromQuery ()
 

Protected Attributes

ilLanguage $lng
 
ilCtrl $ctrl
 
ilAccess $access
 
ILIAS HTTP Services $http
 
ilGlobalTemplateInterface $tpl
 
BaseCommands $parent_gui = null
 
URLBuilder $url_builder
 
URLBuilderToken $action_token = null
 
URLBuilderToken $row_id_token
 
DataFactory $data_factory
 
Refinery $refinery
 
ServerRequestInterface $request
 
ILIAS HTTP Wrapper ArrayBasedRequestWrapper $query
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 

Private Attributes

ilTabsGUI $tabsGUI
 

Detailed Description

Interface BaseCommands.

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 34 of file BaseCommands.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\components\OrgUnit\ARHelper\BaseCommands::__construct ( protected array  $query_namespace = ['orgu', 'posedit'])
protected

Definition at line 66 of file BaseCommands.php.

68 {
69 global $DIC;
70
71 $this->lng = $DIC->language();
72 $this->lng->loadLanguageModule("orgu");
73 $this->ctrl = $DIC->ctrl();
74 $this->tabsGUI = $DIC->tabs();
75 $this->access = $DIC->access();
76 $this->http = $DIC->http();
77 $this->tpl = $DIC->ui()->mainTemplate();
78 $this->refinery = $DIC['refinery'];
79 $this->query = $DIC->http()->wrapper()->query();
80 $this->request = $DIC->http()->request();
81 $this->data_factory = new DataFactory();
82
83 $here_uri = $this->data_factory->uri(
84 $this->request->getUri()->__toString()
85 );
86 $this->url_builder = new URLBuilder($here_uri);
88 $this->url_builder->acquireParameters($this->query_namespace, "action", "rowid");
89 $this->url_builder = $url_builder;
90 $this->action_token = $action_token;
91 $this->row_id_token = $row_id_token;
92
93 $this->ui_factory = $DIC['ui.factory'];
94 $this->ui_renderer = $DIC['ui.renderer'];
95 }
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:26

References ILIAS\components\OrgUnit\ARHelper\BaseCommands\$action_token, $DIC, ILIAS\components\OrgUnit\ARHelper\BaseCommands\$row_id_token, ILIAS\components\OrgUnit\ARHelper\BaseCommands\$url_builder, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

Member Function Documentation

◆ activeSubTab()

ILIAS\components\OrgUnit\ARHelper\BaseCommands::activeSubTab ( string  $subtab_id)
protected

Definition at line 190 of file BaseCommands.php.

191 {
192 $this->tabsGUI->activateSubTab($subtab_id);
193 }

Referenced by ilOrgUnitUserAssignmentGUI\assignmentsRecursive(), ilOrgUnitPositionGUI\defaultPermissions(), ilOrgUnitPositionGUI\edit(), and ilOrgUnitUserAssignmentGUI\index().

+ Here is the caller graph for this function:

◆ addSubTabs()

ILIAS\components\OrgUnit\ARHelper\BaseCommands::addSubTabs ( )

Reimplemented in ilOrgUnitPositionGUI, and ilOrgUnitUserAssignmentGUI.

Definition at line 215 of file BaseCommands.php.

215 : void
216 {
217 }

◆ cancel()

ILIAS\components\OrgUnit\ARHelper\BaseCommands::cancel ( )
protected
Exceptions

ilCtrlException

Reimplemented in ilOrgUnitPositionGUI, and ilOrgUnitUserAssignmentGUI.

Definition at line 122 of file BaseCommands.php.

122 : void
123 {
124 $this->ctrl->redirect($this, self::CMD_INDEX);
125 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ executeCommand()

ILIAS\components\OrgUnit\ARHelper\BaseCommands::executeCommand ( )
Exceptions

ilCtrlException

Reimplemented in ilOrgUnitUserAssignmentGUI.

Definition at line 135 of file BaseCommands.php.

136 {
137 global $DIC;
138 $this->ctrl = $DIC->ctrl();
139 $this->http = $DIC->http();
140 $this->access = $DIC->access();
141 $this->tabsGUI = $DIC->tabs();
142 $this->lng = $DIC->language();
143 $this->tpl = $DIC->ui()->mainTemplate();
144 $this->lng->loadLanguageModule("orgu");
145
146 $cmd = $this->ctrl->getCmd(self::CMD_INDEX);
147
148 if ($this->action_token &&
149 $this->query->has($this->action_token->getName())
150 ) {
151 $cmd = $this->query->retrieve(
152 $this->action_token->getName(),
153 $this->refinery->to()->string()
154 );
155 }
156
157 $next_class = $this->ctrl->getNextClass();
158 if ($next_class) {
159 foreach ($this->getPossibleNextClasses() as $class) {
160 if (strtolower($class) === $next_class) {
161 $instance = new $class();
162 if ($instance instanceof BaseCommands) {
163 $instance->setParentGui($this);
164 $this->ctrl->forwardCommand($instance);
165 }
166
167 return;
168 }
169 }
170 }
171
172 if ($this->getActiveTabId()) {
173 $this->tabsGUI->activateTab($this->getActiveTabId());
174 }
175
176 switch ($cmd) {
177 default:
178 if ($this->checkRequestReferenceId()) {
179 $this->{$cmd}();
180 }
181 break;
182 }
183 }

References $DIC, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\components\OrgUnit\ARHelper\BaseCommands\getActiveTabId(), ILIAS\components\OrgUnit\ARHelper\BaseCommands\getPossibleNextClasses(), ILIAS\FileDelivery\http(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getActiveTabId()

ILIAS\components\OrgUnit\ARHelper\BaseCommands::getActiveTabId ( )
protected

Reimplemented in ilOrgUnitPositionGUI.

Definition at line 114 of file BaseCommands.php.

114 : ?string
115 {
116 return null;
117 }

Referenced by ILIAS\components\OrgUnit\ARHelper\BaseCommands\executeCommand().

+ Here is the caller graph for this function:

◆ getParentGui()

ILIAS\components\OrgUnit\ARHelper\BaseCommands::getParentGui ( )

◆ getParentRefId()

ILIAS\components\OrgUnit\ARHelper\BaseCommands::getParentRefId ( )
protected

Definition at line 208 of file BaseCommands.php.

208 : ?int
209 {
210 $ref_id = $this->http->request()->getQueryParams()["ref_id"];
211
212 return $ref_id;
213 }
$ref_id
Definition: ltiauth.php:66

References $ref_id, and ILIAS\FileDelivery\http().

Referenced by ilOrgUnitUserAssignmentGUI\assignmentsRecursive(), ilOrgUnitPermissionGUI\index(), ilOrgUnitUserAssignmentGUI\index(), and ilOrgUnitUserAssignmentGUI\remove().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPossibleNextClasses()

ILIAS\components\OrgUnit\ARHelper\BaseCommands::getPossibleNextClasses ( )
protected

Reimplemented in ilOrgUnitPositionGUI.

Definition at line 109 of file BaseCommands.php.

109 : array
110 {
111 return array();
112 }

Referenced by ILIAS\components\OrgUnit\ARHelper\BaseCommands\executeCommand().

+ Here is the caller graph for this function:

◆ getRowIdFromQuery()

ILIAS\components\OrgUnit\ARHelper\BaseCommands::getRowIdFromQuery ( )
protected

Definition at line 219 of file BaseCommands.php.

219 : int
220 {
221 if ($this->query->has($this->row_id_token->getName())) {
222 return $this->query->retrieve(
223 $this->row_id_token->getName(),
224 $this->refinery->custom()->transformation(fn($v) => (int) array_shift($v))
225 );
226 }
227 throw new \Exception('no position-id in query');
228 }

Referenced by ilOrgUnitPositionGUI\defaultPermissions(), ilOrgUnitPositionGUI\getPositionFromRequest(), ilOrgUnitPositionGUI\getSinglePosLinkTarget(), and ilOrgUnitPositionGUI\updateDefaultPermissions().

+ Here is the caller graph for this function:

◆ index()

ILIAS\components\OrgUnit\ARHelper\BaseCommands::index ( )
abstractprotected

◆ pushSubTab()

ILIAS\components\OrgUnit\ARHelper\BaseCommands::pushSubTab ( string  $subtab_id,
string  $url 
)
protected

Definition at line 185 of file BaseCommands.php.

186 {
187 $this->tabsGUI->addSubTab($subtab_id, $this->lng->txt($subtab_id), $url);
188 }
$url
Definition: shib_logout.php:68

References $url, and ILIAS\Repository\lng().

Referenced by ilOrgUnitPositionGUI\addSubTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setContent()

ILIAS\components\OrgUnit\ARHelper\BaseCommands::setContent ( string  $html)
protected

Definition at line 127 of file BaseCommands.php.

128 {
129 $this->tpl->setContent($html);
130 }

Referenced by ilOrgUnitUserAssignmentGUI\assignmentsRecursive(), and ilOrgUnitUserAssignmentGUI\index().

+ Here is the caller graph for this function:

◆ setParentGui()

ILIAS\components\OrgUnit\ARHelper\BaseCommands::setParentGui ( BaseCommands  $parent_gui)

Definition at line 102 of file BaseCommands.php.

103 {
104 $this->parent_gui = $parent_gui;
105 }

References ILIAS\components\OrgUnit\ARHelper\BaseCommands\$parent_gui.

Field Documentation

◆ $access

ilAccess ILIAS\components\OrgUnit\ARHelper\BaseCommands::$access
protected

Definition at line 50 of file BaseCommands.php.

◆ $action_token

URLBuilderToken ILIAS\components\OrgUnit\ARHelper\BaseCommands::$action_token = null
protected

◆ $ctrl

ilCtrl ILIAS\components\OrgUnit\ARHelper\BaseCommands::$ctrl
protected

Definition at line 48 of file BaseCommands.php.

◆ $data_factory

DataFactory ILIAS\components\OrgUnit\ARHelper\BaseCommands::$data_factory
protected

Definition at line 58 of file BaseCommands.php.

◆ $http

ILIAS HTTP Services ILIAS\components\OrgUnit\ARHelper\BaseCommands::$http
protected

Definition at line 51 of file BaseCommands.php.

◆ $lng

ilLanguage ILIAS\components\OrgUnit\ARHelper\BaseCommands::$lng
protected

Definition at line 47 of file BaseCommands.php.

Referenced by ilOrgUnitPositionGUI\getAuthorityDescription().

◆ $parent_gui

BaseCommands ILIAS\components\OrgUnit\ARHelper\BaseCommands::$parent_gui = null
protected

◆ $query

ILIAS HTTP Wrapper ArrayBasedRequestWrapper ILIAS\components\OrgUnit\ARHelper\BaseCommands::$query
protected

Definition at line 61 of file BaseCommands.php.

◆ $refinery

Refinery ILIAS\components\OrgUnit\ARHelper\BaseCommands::$refinery
protected

Definition at line 59 of file BaseCommands.php.

◆ $request

ServerRequestInterface ILIAS\components\OrgUnit\ARHelper\BaseCommands::$request
protected

Definition at line 60 of file BaseCommands.php.

◆ $row_id_token

URLBuilderToken ILIAS\components\OrgUnit\ARHelper\BaseCommands::$row_id_token
protected

◆ $tabsGUI

ilTabsGUI ILIAS\components\OrgUnit\ARHelper\BaseCommands::$tabsGUI
private

Definition at line 49 of file BaseCommands.php.

◆ $tpl

ilGlobalTemplateInterface ILIAS\components\OrgUnit\ARHelper\BaseCommands::$tpl
protected

Definition at line 52 of file BaseCommands.php.

◆ $ui_factory

UIFactory ILIAS\components\OrgUnit\ARHelper\BaseCommands::$ui_factory
protected

Definition at line 63 of file BaseCommands.php.

◆ $ui_renderer

UIRenderer ILIAS\components\OrgUnit\ARHelper\BaseCommands::$ui_renderer
protected

Definition at line 64 of file BaseCommands.php.

◆ $url_builder

URLBuilder ILIAS\components\OrgUnit\ARHelper\BaseCommands::$url_builder
protected

◆ AR_ID

const ILIAS\components\OrgUnit\ARHelper\BaseCommands::AR_ID = "arid"

Definition at line 45 of file BaseCommands.php.

◆ CMD_ADD

const ILIAS\components\OrgUnit\ARHelper\BaseCommands::CMD_ADD = "add"

Definition at line 38 of file BaseCommands.php.

◆ CMD_CANCEL

const ILIAS\components\OrgUnit\ARHelper\BaseCommands::CMD_CANCEL = "cancel"

◆ CMD_CONFIRM

const ILIAS\components\OrgUnit\ARHelper\BaseCommands::CMD_CONFIRM = "confirm"

Definition at line 42 of file BaseCommands.php.

◆ CMD_CREATE

const ILIAS\components\OrgUnit\ARHelper\BaseCommands::CMD_CREATE = "create"

◆ CMD_DEFAULT_PERMISSIONS

const ILIAS\components\OrgUnit\ARHelper\BaseCommands::CMD_DEFAULT_PERMISSIONS = "defaultPermissions"

Definition at line 37 of file BaseCommands.php.

◆ CMD_DELETE

const ILIAS\components\OrgUnit\ARHelper\BaseCommands::CMD_DELETE = "delete"

Definition at line 43 of file BaseCommands.php.

◆ CMD_EDIT

const ILIAS\components\OrgUnit\ARHelper\BaseCommands::CMD_EDIT = "edit"

Definition at line 40 of file BaseCommands.php.

◆ CMD_INDEX

const ILIAS\components\OrgUnit\ARHelper\BaseCommands::CMD_INDEX = "index"

Definition at line 36 of file BaseCommands.php.

Referenced by ilObjOrgUnitGUI\executeCommand(), and ilObjOrgUnitGUI\getTabs().

◆ CMD_UPDATE

const ILIAS\components\OrgUnit\ARHelper\BaseCommands::CMD_UPDATE = "update"

The documentation for this class was generated from the following file: