ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 __construct (Container $dic)
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 

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
[]

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

Definition at line 49 of file OrgUnitToolProvider.php.

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

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  }
string $key
Consumer key/client ID value.
Definition: System.php:193
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ getTree()

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

Definition at line 74 of file OrgUnitToolProvider.php.

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

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

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

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

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

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  }
$ref_id
Definition: ltiauth.php:67
$_GET['client_id']
Definition: saml1-acs.php:21
static getRootOrgRefId()
+ 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.

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

109  : array
110  {
111  $whiteList = array('orgu');
112  $pls = ilOrgUnitExtension::getActivePluginIdsForTree();
113 
114  return array_merge($whiteList, $pls);
115  }
+ 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.

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

40  : ContextCollection
41  {
42  return $this->context_collection->main()->administration();
43  }
+ 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: