ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilMediaPoolGSToolProvider Class Reference

Class ilStaffGSToolProvider. More...

+ 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'
 

Private Member Functions

 getTree (int $ref_id)
 

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

Class ilStaffGSToolProvider.

Author
Alex Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..com
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

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

Member Function Documentation

◆ getToolsForContextStack()

ilMediaPoolGSToolProvider::getToolsForContextStack ( CalledContexts  $called_contexts)

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

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

References $DIC, ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\current(), ilUtil\getImagePath(), and getTree().

30  : array
31  {
32  global $DIC;
33 
34  $access = $DIC->access();
35 
36  $tools = [];
37  $additional_data = $called_contexts->current()->getAdditionalData();
38  if ($additional_data->is(self::SHOW_FOLDERS_TOOL, true)) {
39  $iff = function ($id) {
40  return $this->identification_provider->contextAwareIdentifier($id);
41  };
42  $l = function (string $content) {
43  return $this->dic->ui()->factory()->legacy($content);
44  };
45  $ref_id = $called_contexts->current()->getReferenceId()->toInt();
46 
47  if (!$access->checkAccess("read", "", $ref_id)) {
48  return $tools;
49  }
50 
51  $title = "Folders";
52  $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(\ilUtil::getImagePath("outlined/icon_fldm.svg"), $title);
53  $tools[] = $this->factory->tool($iff("tree"))
54  ->withTitle($title)
55  ->withSymbol($icon)
56  ->withContentWrapper(function () use ($l, $ref_id) {
57  return $l($this->getTree($ref_id));
58  });
59  }
60 
61  return $tools;
62  }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ getTree()

ilMediaPoolGSToolProvider::getTree ( int  $ref_id)
private
Parameters
int$ref_id
Returns
string

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

References Vendor\Package\$e, and ilObjectFactory\getInstanceByRefId().

Referenced by getToolsForContextStack().

70  : string
71  {
72  try {
73  $pool = ilObjectFactory::getInstanceByRefId($ref_id);
74  $pool_gui = new ilObjMediaPoolGUI($ref_id);
75  $exp = new ilMediaPoolExplorerGUI($pool_gui, "listMedia", $pool);
76 
77  return $exp->getHTML(true);
78  } catch (Exception $e) {
79  return "";
80  }
81  }
Media pool explorer GUI class.
User Interface class for media pool objects.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
+ Here is the call graph for this function:
+ Here is the caller 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: