ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 ()
 @inheritDoc More...
 
 getToolsForContextStack (CalledContexts $called_contexts)
 @inheritDoc More...
 
- 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
 $identification_provider
 
 $context_collection
 
 $factory
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 $dic
 

Detailed Description

Member Function Documentation

◆ getToolsForContextStack()

ILIAS\OrgUnit\Provider\OrgUnitToolProvider::getToolsForContextStack ( CalledContexts  $called_contexts)

@inheritDoc

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

Definition at line 35 of file OrgUnitToolProvider.php.

35 : array
36 {
37 $tools = [];
38
39 if ($called_contexts->current()->getAdditionalData()->is(self::SHOW_ORGU_TREE, true)) {
40 $iff = function (string $id) {
41 return $this->identification_provider->contextAwareIdentifier($id);
42 };
43
44 $t = function (string $key) : string {
45 return $this->dic->language()->txt($key);
46 };
47
48 $tools[] = $this->factory->treeTool($iff('tree_new'))
49 ->withTitle($t('tree'))
50 ->withSymbol($this->dic->ui()->factory()->symbol()->icon()->standard('orgu', 'Orgu'))
51 ->withTree($this->getTree());
52 }
53
54 return $tools;
55 }
withSymbol(Symbol $symbol)
@inheritDoc

References 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 57 of file OrgUnitToolProvider.php.

57 : Tree
58 {
59 global $DIC;
60 $lng = $DIC->language();
61 $tree = $this->getTreeRecursion();
62
63 $parent_node_id = $DIC->repositoryTree()->getParentId(ilObjOrgUnit::getRootOrgRefId());
64
65 return $this->dic->ui()->factory()->tree()->expandable($lng->txt("org_units"), $tree)
66 ->withData($tree->getChildsOfNode($parent_node_id));
67 }
static getRootOrgRefId()
$lng
$DIC
Definition: xapitoken.php:46

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 69 of file OrgUnitToolProvider.php.

69 : TreeRecursion
70 {
71 $tree = new ilOrgUnitExplorerGUI(
72 "orgu_explorer",
73 ilObjOrgUnitGUI::class,
74 "showTree",
75 new ilTree(1),
76 $this->dic["ilAccess"]
77 );
78 $tree->setTypeWhiteList($this->getTreeWhiteList());
79 $tree->setRootId(ilObjOrgUnit::getRootOrgRefId());
80 $tree->setPathOpen($_GET['item_ref_id'] ?? $_GET['ref_id'] ?? '');
81
82 return $tree;
83 }
$_GET["client_id"]
Class ilOrgUnitExplorerGUI.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...

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

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

Definition at line 85 of file OrgUnitToolProvider.php.

85 : array
86 {
87 $whiteList = array('orgu');
88 $pls = ilOrgUnitExtension::getActivePluginIdsForTree();
89
90 return array_merge($whiteList, $pls);
91 }

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

+ Here is the caller graph for this function:

◆ isInterestedInContexts()

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

@inheritDoc

Implements ILIAS\GlobalScreen\ScreenContext\ScreenContextAwareProvider.

Definition at line 27 of file OrgUnitToolProvider.php.

27 : ContextCollection
28 {
29 return $this->context_collection->main()->administration();
30 }

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 22 of file OrgUnitToolProvider.php.


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