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

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
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
Container $dic
 

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.

References $DIC, Vendor\Package\$e, $id, $ref_id, ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\current(), ilUtil\getImagePath(), and ilObjectFactory\getInstanceByRefId().

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);
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("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  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
global $DIC
Definition: feed.php:28
$ref_id
Definition: ltiauth.php:67
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ isInterestedInContexts()

ilMediaPoolGSToolProvider::isInterestedInContexts ( )
Returns
ContextCollection

Implements ILIAS\GlobalScreen\ScreenContext\ScreenContextAwareProvider.

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

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

+ Here is the call graph for this function:

Field Documentation

◆ SHOW_FOLDERS_TOOL

const ilMediaPoolGSToolProvider::SHOW_FOLDERS_TOOL = 'show_folders_tool'

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