ILIAS  release_8 Revision v8.19
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 (IdentificationInterface $identification, array $data)
 
Parameters
IdentificationInterface$identification
array$data
Returns
bool
More...
 

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'
 
- Protected Attributes inherited from ilMMAbstractBaseTypeHandlerAction
array $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 45 of file class.ilMMTypeHandlerRepositoryLink.php.

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

45  : isItem
46  {
47  global $DIC;
48  if ($item instanceof RepositoryLink && isset($this->links[$item->getProviderIdentification()->serialize()][self::F_ACTION])) {
49  $ref_id = (int) $this->links[$item->getProviderIdentification()->serialize()][self::F_ACTION];
50  $item = $item->withRefId($ref_id)
52  function () use ($DIC, $ref_id, $item) {
53  $is_visible_parent = $item->isVisible();
54  $has_access = $DIC->access()->checkAccess('join', '', $ref_id)
55  || $DIC->access()->checkAccess('read', '', $ref_id);
56 
57  return $is_visible_parent
58  && $has_access;
59  }
60  );
61  }
62 
63  return $item;
64  }
withVisibilityCallable(callable $is_visible)
Pass a callable which can decide whether your element is visible for the current user.
global $DIC
Definition: feed.php:28
$ref_id
Definition: ltiauth.php:67
+ 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 70 of file class.ilMMTypeHandlerRepositoryLink.php.

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

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

◆ getFieldInfoTranslation()

ilMMTypeHandlerRepositoryLink::getFieldInfoTranslation ( )
protected

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

References $DIC.

104  : string
105  {
106  global $DIC;
107 
108  return $DIC->language()->txt("field_ref_id_info");
109  }
global $DIC
Definition: feed.php:28

◆ getFieldTranslation()

ilMMTypeHandlerRepositoryLink::getFieldTranslation ( )
protected

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

References $DIC.

Referenced by getAdditionalFieldsForSubForm().

93  : string
94  {
95  global $DIC;
96 
97  return $DIC->language()->txt("field_ref_id");
98  }
global $DIC
Definition: feed.php:28
+ 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 36 of file class.ilMMTypeHandlerRepositoryLink.php.

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

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