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

Class ilMMTypeHandlerRepositoryLink. More...

+ Inheritance diagram for ilMMTypeHandlerRepositoryLink:
+ Collaboration diagram for ilMMTypeHandlerRepositoryLink:

Public Member Functions

 matchesForType ()
 
Returns
string Classname of matching Type this TypeHandler can handle
More...
 
 enrichItem (isItem $item)
 
Parameters
isItem$item
Returns
isItem
More...
 
 getAdditionalFieldsForSubForm (IdentificationInterface $identification)
 
Parameters
IdentificationInterface$identification
Returns
Input[]
More...
 
- Public Member Functions inherited from ilMMAbstractBaseTypeHandlerAction
 __construct ()
 
 matchesForType ()
 
 enrichItem (isItem $item)
 
Parameters
isItem$item
Returns
isItem
More...
 
 saveFormFields (\ILIAS\GlobalScreen\Identification\IdentificationInterface $identification, array $data)
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\MainMenu\Collector\Handler\TypeHandler
 saveFormFields (IdentificationInterface $identification, array $data)
 

Protected Member Functions

 getFieldTranslation ()
 
 getFieldInfoTranslation ()
 
- Protected Member Functions inherited from ilMMAbstractBaseTypeHandlerAction
 getFieldTranslation ()
 
 getFieldInfoTranslation ()
 

Additional Inherited Members

- Data Fields inherited from ilMMAbstractBaseTypeHandlerAction
const F_ACTION = 'action'
 
const F_EXTERNAL = 'external'
 ilMMAbstractBaseTypeHandlerAction constructor. More...
 
- Protected Attributes inherited from ilMMAbstractBaseTypeHandlerAction
 $links = []
 

Detailed Description

Member Function Documentation

◆ enrichItem()

ilMMTypeHandlerRepositoryLink::enrichItem ( isItem  $item)

Parameters
isItem$item
Returns
isItem

Implements ILIAS\GlobalScreen\Scope\MainMenu\Collector\Handler\TypeHandler.

Definition at line 28 of file class.ilMMTypeHandlerRepositoryLink.php.

References $DIC, ILIAS\GlobalScreen\Scope\isGlobalScreenItem\getProviderIdentification(), and ILIAS\GlobalScreen\Scope\MainMenu\Factory\isItem\withVisibilityCallable().

28  : isItem
29  {
30  global $DIC;
31  if ($item instanceof RepositoryLink && isset($this->links[$item->getProviderIdentification()->serialize()][self::F_ACTION])) {
32  $ref_id = (int) $this->links[$item->getProviderIdentification()->serialize()][self::F_ACTION];
33  $item = $item->withRefId($ref_id)
35  function () use ($DIC, $ref_id) {
36  return (bool) $DIC->access()->checkAccess('visible', '', $ref_id)
37  || $DIC->access()->checkAccess('read', '', $ref_id);
38  }
39  );
40  }
41 
42  return $item;
43  }
withVisibilityCallable(callable $is_visible)
Pass a callable which can decide whether your element is visible for the current user.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ getAdditionalFieldsForSubForm()

ilMMTypeHandlerRepositoryLink::getAdditionalFieldsForSubForm ( IdentificationInterface  $identification)

Parameters
IdentificationInterface$identification
Returns
Input[]

Implements ILIAS\GlobalScreen\Scope\MainMenu\Collector\Handler\TypeHandler.

Definition at line 49 of file class.ilMMTypeHandlerRepositoryLink.php.

References $DIC, $url, and getFieldTranslation().

49  : array
50  {
51  global $DIC;
52  $url = $DIC->ui()->factory()->input()->field()->numeric($this->getFieldTranslation());
53  if (isset($this->links[$identification->serialize()][self::F_ACTION]) && is_numeric($this->links[$identification->serialize()][self::F_ACTION])) {
54  $url = $url->withValue((int) $this->links[$identification->serialize()][self::F_ACTION]);
55  }
56 
57  return [self::F_ACTION => $url];
58  }
$DIC
Definition: xapitoken.php:46
$url
+ Here is the call graph for this function:

◆ getFieldInfoTranslation()

ilMMTypeHandlerRepositoryLink::getFieldInfoTranslation ( )
protected

Definition at line 75 of file class.ilMMTypeHandlerRepositoryLink.php.

References $DIC.

75  : string
76  {
77  global $DIC;
78 
79  return $DIC->language()->txt("field_ref_id_info");
80  }
$DIC
Definition: xapitoken.php:46

◆ getFieldTranslation()

ilMMTypeHandlerRepositoryLink::getFieldTranslation ( )
protected

Definition at line 64 of file class.ilMMTypeHandlerRepositoryLink.php.

References $DIC.

Referenced by getAdditionalFieldsForSubForm().

64  : string
65  {
66  global $DIC;
67 
68  return $DIC->language()->txt("field_ref_id");
69  }
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ matchesForType()

ilMMTypeHandlerRepositoryLink::matchesForType ( )

Returns
string Classname of matching Type this TypeHandler can handle

Implements ILIAS\GlobalScreen\Scope\MainMenu\Collector\Handler\TypeHandler.

Definition at line 19 of file class.ilMMTypeHandlerRepositoryLink.php.

19  : string
20  {
21  return RepositoryLink::class;
22  }

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