ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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)
 
 getAdditionalFieldsForSubForm (\ILIAS\GlobalScreen\Identification\IdentificationInterface $identification)
 
- 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\MainMenu\Factory\isItem\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  }
38  );
39  // ->withAvailableCallable(
40  // function () use ($ref_id) {
41  // $b = (bool)(ilObject2::_exists($ref_id, true) && !ilObject2::_isInTrash($ref_id));
42  //
43  // return $b;
44  // }
45  // )->withNonAvailableReason($DIC->ui()->factory()->legacy($DIC->language()->txt('deleted')))
46  }
47 
48  return $item;
49  }
withVisibilityCallable(callable $is_visible)
Pass a callable which can decide whether your element is visible for the current user.
global $DIC
Definition: saml.php:7
+ 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 55 of file class.ilMMTypeHandlerRepositoryLink.php.

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

55  : array
56  {
57  global $DIC;
58  $url = $DIC->ui()->factory()->input()->field()->numeric($this->getFieldTranslation());
59  if (isset($this->links[$identification->serialize()][self::F_ACTION]) && is_numeric($this->links[$identification->serialize()][self::F_ACTION])) {
60  $url = $url->withValue((int) $this->links[$identification->serialize()][self::F_ACTION]);
61  }
62 
63  return [self::F_ACTION => $url];
64  }
global $DIC
Definition: saml.php:7
$url
+ Here is the call graph for this function:

◆ getFieldInfoTranslation()

ilMMTypeHandlerRepositoryLink::getFieldInfoTranslation ( )
protected

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

References $DIC.

81  : string
82  {
83  global $DIC;
84 
85  return $DIC->language()->txt("field_ref_id_info");
86  }
global $DIC
Definition: saml.php:7

◆ getFieldTranslation()

ilMMTypeHandlerRepositoryLink::getFieldTranslation ( )
protected

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

References $DIC.

Referenced by getAdditionalFieldsForSubForm().

70  : string
71  {
72  global $DIC;
73 
74  return $DIC->language()->txt("field_ref_id");
75  }
global $DIC
Definition: saml.php:7
+ 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: