ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilMediaPoolGSToolProvider Class Reference
+ Inheritance diagram for ilMediaPoolGSToolProvider:
+ Collaboration diagram for ilMediaPoolGSToolProvider:

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 (protected Container $dic)
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 
 getToolsForContextStack (CalledContexts $called_contexts)
 
 isInterestedInContexts ()
 

Data Fields

const SHOW_FOLDERS_TOOL = 'show_folders_tool'
 

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
 

Detailed Description

Member Function Documentation

◆ getToolsForContextStack()

ilMediaPoolGSToolProvider::getToolsForContextStack ( CalledContexts  $called_contexts)
Parameters
CalledContexts$called_contexts
Returns
Tool[] These Slates can be passed to the MainMenu dynamic for a specific location/context.
See also
DynamicProvider

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

Definition at line 36 of file class.ilMediaPoolGSToolProvider.php.

36 : array
37 {
38 global $DIC;
39
40 $access = $DIC->access();
41
42 $tools = [];
43 $additional_data = $called_contexts->current()->getAdditionalData();
44 if ($additional_data->is(self::SHOW_FOLDERS_TOOL, true)) {
45 $iff = function ($id) {
46 return $this->identification_provider->contextAwareIdentifier($id);
47 };
48 $l = function (string $content) {
49 return $this->dic->ui()->factory()->legacy()->content($content);
50 };
51 $ref_id = $called_contexts->current()->getReferenceId()->toInt();
52
53 if (!$access->checkAccess("read", "", $ref_id)) {
54 return $tools;
55 }
56
57 $title = "Folders";
58 $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(\ilUtil::getImagePath("standard/icon_fldm.svg"), $title);
59 $tools[] = $this->factory->tool($iff("tree"))
60 ->withTitle($title)
61 ->withSymbol($icon)
62 ->withContentWrapper(function () use ($l, $ref_id) {
63 return $l($this->getTree($ref_id));
64 });
65 }
66
67 return $tools;
68 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
factory()
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
$ref_id
Definition: ltiauth.php:66
global $DIC
Definition: shib_login.php:26

References $DIC, $id, $ref_id, ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\current(), factory(), ilUtil\getImagePath(), and ILIAS\GlobalScreen\Scope\Footer\Factory\withTitle().

+ Here is the call graph for this function:

◆ isInterestedInContexts()

ilMediaPoolGSToolProvider::isInterestedInContexts ( )

Field Documentation

◆ SHOW_FOLDERS_TOOL

const ilMediaPoolGSToolProvider::SHOW_FOLDERS_TOOL = 'show_folders_tool'

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