ILIAS  release_8 Revision v8.24
ILIAS\OrgUnit\Provider\OrgUnitToolProvider Class Reference

Class OrgUnitToolProvider. More...

+ Inheritance diagram for ILIAS\OrgUnit\Provider\OrgUnitToolProvider:
+ Collaboration diagram for ILIAS\OrgUnit\Provider\OrgUnitToolProvider:

Public Member Functions

 isInterestedInContexts ()
 
 getToolsForContextStack (CalledContexts $called_contexts)
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\Tool\Provider\AbstractDynamicToolProvider
 __construct (Container $dic)
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 __construct (Container $dic)
 @inheritDoc More...
 
 getFullyQualifiedClassName ()
 @inheritDoc More...
 
 getProviderNameForPresentation ()
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 
 getToolsForContextStack (CalledContexts $called_contexts)
 
 isInterestedInContexts ()
 

Data Fields

const SHOW_ORGU_TREE = 'show_orgu_tree'
 

Private Member Functions

 getTree ()
 
 getTreeRecursion ()
 
 getTreeWhiteList ()
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 globalScreen ()
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Scope\Tool\Provider\AbstractDynamicToolProvider
ToolIdentificationProviderInterface $identification_provider
 
ContextCollection $context_collection
 
ToolFactory $factory
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
Container $dic
 

Detailed Description

Member Function Documentation

◆ getToolsForContextStack()

ILIAS\OrgUnit\Provider\OrgUnitToolProvider::getToolsForContextStack ( CalledContexts  $called_contexts)
Parameters
CalledContexts$called_contexts
Returns
\ILIAS\GlobalScreen\Scope\Tool\Factory\Tool[]

Implements ILIAS\GlobalScreen\Scope\Tool\Provider\DynamicToolProvider.

Definition at line 49 of file OrgUnitToolProvider.php.

49 : 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 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
withSymbol(Symbol $symbol)
@inheritDoc
string $key
Consumer key/client ID value.
Definition: System.php:193

References $id, ILIAS\LTI\ToolProvider\$key, ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\current(), ILIAS\OrgUnit\Provider\OrgUnitToolProvider\getTree(), and ILIAS\GlobalScreen\Scope\MainMenu\Factory\withSymbol().

+ Here is the call graph for this function:

◆ getTree()

ILIAS\OrgUnit\Provider\OrgUnitToolProvider::getTree ( )
private

Definition at line 74 of file OrgUnitToolProvider.php.

74 : 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 }
static getRootOrgRefId()
global $DIC
Definition: feed.php:28
$lng

References $DIC, $lng, ilObjOrgUnit\getRootOrgRefId(), and ILIAS\OrgUnit\Provider\OrgUnitToolProvider\getTreeRecursion().

Referenced by ILIAS\OrgUnit\Provider\OrgUnitToolProvider\getToolsForContextStack().

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

◆ getTreeRecursion()

ILIAS\OrgUnit\Provider\OrgUnitToolProvider::getTreeRecursion ( )
private

Definition at line 86 of file OrgUnitToolProvider.php.

86 : 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 }
Class ilOrgUnitExplorerGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ref_id
Definition: ltiauth.php:67
$_GET['client_id']
Definition: saml1-acs.php:21

References $_GET, $ref_id, ilObjOrgUnit\getRootOrgRefId(), ILIAS\OrgUnit\Provider\OrgUnitToolProvider\getTreeWhiteList(), and ILIAS\Repository\int().

Referenced by ILIAS\OrgUnit\Provider\OrgUnitToolProvider\getTree().

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

◆ getTreeWhiteList()

ILIAS\OrgUnit\Provider\OrgUnitToolProvider::getTreeWhiteList ( )
private
Returns
int[]

Definition at line 109 of file OrgUnitToolProvider.php.

109 : array
110 {
111 $whiteList = array('orgu');
112 $pls = ilOrgUnitExtension::getActivePluginIdsForTree();
113
114 return array_merge($whiteList, $pls);
115 }

Referenced by ILIAS\OrgUnit\Provider\OrgUnitToolProvider\getTreeRecursion().

+ Here is the caller graph for this function:

◆ isInterestedInContexts()

ILIAS\OrgUnit\Provider\OrgUnitToolProvider::isInterestedInContexts ( )
Returns
ContextCollection

Implements ILIAS\GlobalScreen\ScreenContext\ScreenContextAwareProvider.

Definition at line 40 of file OrgUnitToolProvider.php.

40 : ContextCollection
41 {
42 return $this->context_collection->main()->administration();
43 }

References ILIAS\GlobalScreen\ScreenContext\Stack\ContextCollection\main().

+ Here is the call graph for this function:

Field Documentation

◆ SHOW_ORGU_TREE

const ILIAS\OrgUnit\Provider\OrgUnitToolProvider::SHOW_ORGU_TREE = 'show_orgu_tree'

Definition at line 38 of file OrgUnitToolProvider.php.


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