ILIAS
release_8 Revision v8.24
◀ ilDoc Overview
OrgUnitToolProvider.php
Go to the documentation of this file.
1
<?php
19
namespace
ILIAS\OrgUnit\Provider
;
20
21
use
ILIAS\GlobalScreen\Scope\Tool\Provider\AbstractDynamicToolProvider
;
22
use
ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts
;
23
use
ILIAS\GlobalScreen\ScreenContext\Stack\ContextCollection
;
24
use
ILIAS\UI\Component\Tree\Tree
;
25
use
ILIAS\UI\Component\Tree\TreeRecursion
;
26
use
ilObjOrgUnit
;
27
use
ilObjOrgUnitGUI
;
28
use
ilOrgUnitExplorerGUI
;
29
use
ilOrgUnitExtension
;
30
use
ilTree
;
31
36
class
OrgUnitToolProvider
extends
AbstractDynamicToolProvider
37
{
38
public
const
SHOW_ORGU_TREE
=
'show_orgu_tree'
;
39
40
public
function
isInterestedInContexts
():
ContextCollection
41
{
42
return
$this->context_collection->
main
()->administration();
43
}
44
49
public
function
getToolsForContextStack
(
CalledContexts
$called_contexts): array
50
{
51
$tools = [];
52
53
if
($called_contexts->
current
()->getAdditionalData()->is(self::SHOW_ORGU_TREE,
true
)) {
54
$iff =
function
(
string
$id
) {
55
return
$this->identification_provider->contextAwareIdentifier(
$id
);
56
};
57
58
$t =
function
(
string
$key
):
string
{
59
return
$this->dic->language()->txt(
$key
);
60
};
61
62
$tools[] = $this->factory->treeTool($iff(
'tree_new'
))
63
->withTitle($t(
'tree'
))
64
->
withSymbol
($this->dic->ui()->factory()->symbol()->icon()->standard(
65
'orgu'
,
66
'Orgu'
67
))
68
->withTree($this->
getTree
());
69
}
70
71
return
$tools;
72
}
73
74
private
function
getTree
():
Tree
75
{
76
global
$DIC
;
77
$lng
=
$DIC
->language();
78
$tree = $this->
getTreeRecursion
();
79
80
$parent_node_id =
$DIC
->repositoryTree()->getParentId(
ilObjOrgUnit::getRootOrgRefId
());
81
82
return
$this->dic->ui()->factory()->tree()->expandable(
$lng
->txt(
"org_units"
), $tree)
83
->withData($tree->getChildsOfNode($parent_node_id));
84
}
85
86
private
function
getTreeRecursion
():
TreeRecursion
87
{
88
$tree =
new
ilOrgUnitExplorerGUI
(
89
"orgu_explorer"
,
90
ilObjOrgUnitGUI::class,
91
"showTree"
,
92
new
ilTree
(1),
93
$this->dic[
"ilAccess"
]
94
);
95
$tree->setTypeWhiteList($this->
getTreeWhiteList
());
96
$tree->setRootId(
ilObjOrgUnit::getRootOrgRefId
());
97
$ref_id
= (
int
)(
$_GET
[
'item_ref_id'
] ??
$_GET
[
'ref_id'
] ?? 0);
98
if
(
$ref_id
!== 0) {
99
$tree->setPathOpen((
int
)
$ref_id
);
100
}
101
$tree->setOrderField(
'title'
);
102
103
return
$tree;
104
}
105
109
private
function
getTreeWhiteList
(): array
110
{
111
$whiteList = array(
'orgu'
);
112
$pls = ilOrgUnitExtension::getActivePluginIdsForTree();
113
114
return
array_merge($whiteList, $pls);
115
}
116
}
$id
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition:
plugin.php:23
ILIAS\GlobalScreen\Scope\Tool\Provider\AbstractDynamicToolProvider
Class AbstractDynamicToolProvider.
Definition:
AbstractDynamicToolProvider.php:33
ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts
Class CalledContexts.
Definition:
CalledContexts.php:32
ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\current
current()
Definition:
CalledContexts.php:35
ILIAS\GlobalScreen\ScreenContext\Stack\ContextCollection
Definition:
ContextCollection.php:30
ILIAS\GlobalScreen\ScreenContext\Stack\ContextCollection\main
main()
Definition:
ContextCollection.php:102
ILIAS\OrgUnit\Provider\OrgUnitToolProvider
Class OrgUnitToolProvider.
Definition:
OrgUnitToolProvider.php:37
ILIAS\OrgUnit\Provider\OrgUnitToolProvider\getTree
getTree()
Definition:
OrgUnitToolProvider.php:74
ILIAS\OrgUnit\Provider\OrgUnitToolProvider\getTreeWhiteList
getTreeWhiteList()
Definition:
OrgUnitToolProvider.php:109
ILIAS\OrgUnit\Provider\OrgUnitToolProvider\getToolsForContextStack
getToolsForContextStack(CalledContexts $called_contexts)
Definition:
OrgUnitToolProvider.php:49
ILIAS\OrgUnit\Provider\OrgUnitToolProvider\SHOW_ORGU_TREE
const SHOW_ORGU_TREE
Definition:
OrgUnitToolProvider.php:38
ILIAS\OrgUnit\Provider\OrgUnitToolProvider\getTreeRecursion
getTreeRecursion()
Definition:
OrgUnitToolProvider.php:86
ILIAS\OrgUnit\Provider\OrgUnitToolProvider\isInterestedInContexts
isInterestedInContexts()
Definition:
OrgUnitToolProvider.php:40
ilObjOrgUnitGUI
Class ilObjOrgUnit GUI class.
Definition:
class.ilObjOrgUnitGUI.php:42
ilObjOrgUnit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.ilObjOrgUnit.php:28
ilObjOrgUnit\getRootOrgRefId
static getRootOrgRefId()
Definition:
class.ilObjOrgUnit.php:195
ilOrgUnitExplorerGUI
Class ilOrgUnitExplorerGUI.
Definition:
class.ilOrgUnitExplorerGUI.php:28
ilOrgUnitExtension
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.ilOrgUnitExtension.php:24
ilTree
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.ilTree.php:30
$DIC
global $DIC
Definition:
feed.php:28
ILIAS\UI\Component\Tree\TreeRecursion
Interface for mapping data-structures to the Tree.
Definition:
TreeRecursion.php:39
ILIAS\UI\Component\Tree\Tree
This describes a Tree Control.
Definition:
Tree.php:29
$ref_id
$ref_id
Definition:
ltiauth.php:67
ILIAS\GlobalScreen\Scope\MainMenu\Factory\withSymbol
withSymbol(Symbol $symbol)
@inheritDoc
Definition:
hasSymbolTrait.php:38
ILIAS\LTI\ToolProvider\$key
string $key
Consumer key/client ID value.
Definition:
System.php:193
ILIAS\OrgUnit\Provider
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
OrgUnitMainBarProvider.php:19
ILIAS\Repository\int
int(string $key)
Definition:
trait.BaseGUIRequest.php:61
$_GET
$_GET['client_id']
Definition:
saml1-acs.php:21
$lng
$lng
Definition:
save_question_post_data.php:24
Modules
OrgUnit
classes
Provider
OrgUnitToolProvider.php
Generated on Sun Nov 2 2025 22:01:15 for ILIAS by
1.9.4 (using
Doxyfile
)