ILIAS  release_7 Revision v7.30-3-g800a261c036
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
 matchesForType ()
 
 enrichItem (isItem $item)
 
 getAdditionalFieldsForSubForm (IdentificationInterface $identification)
 
 saveFormFields (IdentificationInterface $identification, array $data)
 

Protected Member Functions

 getFieldTranslation ()
 @inheritDoc More...
 
 getFieldInfoTranslation ()
 @inheritDoc More...
 
 getFieldTranslation ()
 
 getFieldInfoTranslation ()
 

Additional Inherited Members

- Data Fields inherited from ilMMAbstractBaseTypeHandlerAction
const F_ACTION = 'action'
 @inheritDoc More...
 
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

Reimplemented from ilMMAbstractBaseTypeHandlerAction.

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

44 : isItem
45 {
46 global $DIC;
47 if ($item instanceof RepositoryLink && isset($this->links[$item->getProviderIdentification()->serialize()][self::F_ACTION])) {
48 $ref_id = (int) $this->links[$item->getProviderIdentification()->serialize()][self::F_ACTION];
49 $item = $item->withRefId($ref_id)
51 function () use ($DIC, $ref_id, $item) {
52 $is_visible_parent = $item->isVisible();
53 $has_access = $DIC->access()->checkAccess('join', '', $ref_id)
54 || $DIC->access()->checkAccess('read', '', $ref_id);
55
56 return $is_visible_parent
57 && $has_access;
58 }
59 );
60 }
61
62 return $item;
63 }
global $DIC
Definition: goto.php:24
withVisibilityCallable(callable $is_visible)
Pass a callable which can decide whether your element is visible for the current user.

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

+ 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 69 of file class.ilMMTypeHandlerRepositoryLink.php.

69 : array
70 {
71 global $DIC;
72 $url = $DIC->ui()->factory()->input()->field()->numeric($this->getFieldTranslation())
73 ->withAdditionalTransformation(
74 $DIC->refinery()->custom()->constraint(
75 function ($value) use ($DIC) : bool {
76 return !$DIC->repositoryTree()->isGrandChild(SYSTEM_FOLDER_ID, $value);
77 },
78 $DIC->language()->txt("msg_ref_id_not_callable")
79 )
80 );
81 if (isset($this->links[$identification->serialize()][self::F_ACTION]) && is_numeric($this->links[$identification->serialize()][self::F_ACTION])) {
82 $url = $url->withValue((int) $this->links[$identification->serialize()][self::F_ACTION]);
83 }
84
85 return [self::F_ACTION => $url];
86 }
const SYSTEM_FOLDER_ID
Definition: constants.php:33
$url

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

+ Here is the call graph for this function:

◆ getFieldInfoTranslation()

ilMMTypeHandlerRepositoryLink::getFieldInfoTranslation ( )
protected

@inheritDoc

Reimplemented from ilMMAbstractBaseTypeHandlerAction.

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

103 : string
104 {
105 global $DIC;
106
107 return $DIC->language()->txt("field_ref_id_info");
108 }

References $DIC.

◆ getFieldTranslation()

ilMMTypeHandlerRepositoryLink::getFieldTranslation ( )
protected

@inheritDoc

Reimplemented from ilMMAbstractBaseTypeHandlerAction.

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

92 : string
93 {
94 global $DIC;
95
96 return $DIC->language()->txt("field_ref_id");
97 }

References $DIC.

Referenced by getAdditionalFieldsForSubForm().

+ Here is the caller graph for this function:

◆ matchesForType()

ilMMTypeHandlerRepositoryLink::matchesForType ( )

Returns
string Classname of matching Type this TypeHandler can handle

Reimplemented from ilMMAbstractBaseTypeHandlerAction.

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

35 : string
36 {
37 return RepositoryLink::class;
38 }

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