ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilMMAbstractBaseTypeHandlerAction Class Reference

Class ilMMAbstractBaseTypeHandlerAction. More...

+ Inheritance diagram for ilMMAbstractBaseTypeHandlerAction:
+ Collaboration diagram for ilMMAbstractBaseTypeHandlerAction:

Public Member Functions

 __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
 getAdditionalFieldsForSubForm (IdentificationInterface $identification)
 
 saveFormFields (IdentificationInterface $identification, array $data)
 

Data Fields

const F_ACTION = 'action'
 
const F_EXTERNAL = 'external'
 ilMMAbstractBaseTypeHandlerAction constructor. More...
 

Protected Member Functions

 getFieldTranslation ()
 
 getFieldInfoTranslation ()
 

Protected Attributes

 $links = []
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMMAbstractBaseTypeHandlerAction::__construct ( )

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

References enrichItem(), ActiveRecord\getArray(), and matchesForType().

29  {
30  $this->links = ilMMTypeActionStorage::getArray('identification', [self::F_ACTION, self::F_EXTERNAL]);
31  }
static getArray($key=null, $values=null)
+ Here is the call graph for this function:

Member Function Documentation

◆ enrichItem()

ilMMAbstractBaseTypeHandlerAction::enrichItem ( isItem  $item)
abstract

Parameters
isItem$item
Returns
isItem

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

Referenced by __construct().

+ Here is the caller graph for this function:

◆ getAdditionalFieldsForSubForm()

ilMMAbstractBaseTypeHandlerAction::getAdditionalFieldsForSubForm ( \ILIAS\GlobalScreen\Identification\IdentificationInterface  $identification)

Definition at line 57 of file class.ilMMAbstractBaseTypeHandlerAction.php.

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

57  : array
58  {
59  global $DIC;
60  $url = $DIC->ui()->factory()->input()->field()->text($this->getFieldTranslation())->withRequired(true)->withByline($this->getFieldInfoTranslation());
61  if (isset($this->links[$identification->serialize()][self::F_ACTION])) {
62  $url = $url->withValue($this->links[$identification->serialize()][self::F_ACTION]);
63  }
64  $external = $DIC->ui()->factory()->input()->field()->checkbox($DIC->language()->txt('field_external'), $DIC->language()->txt('field_external_info'));
65  if (isset($this->links[$identification->serialize()][self::F_EXTERNAL])) {
66  $external = $external->withValue((bool) $this->links[$identification->serialize()][self::F_EXTERNAL]);
67  }
68 
69  return [self::F_ACTION => $url, self::F_EXTERNAL => $external];
70  }
global $DIC
Definition: saml.php:7
$url
+ Here is the call graph for this function:

◆ getFieldInfoTranslation()

ilMMAbstractBaseTypeHandlerAction::getFieldInfoTranslation ( )
abstractprotected

Referenced by getAdditionalFieldsForSubForm().

+ Here is the caller graph for this function:

◆ getFieldTranslation()

ilMMAbstractBaseTypeHandlerAction::getFieldTranslation ( )
abstractprotected
Returns
string

Referenced by getAdditionalFieldsForSubForm().

+ Here is the caller graph for this function:

◆ matchesForType()

ilMMAbstractBaseTypeHandlerAction::matchesForType ( )
abstract
Returns
string Classname of matching Type this TypeHandler can handle

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

Referenced by __construct().

+ Here is the caller graph for this function:

◆ saveFormFields()

ilMMAbstractBaseTypeHandlerAction::saveFormFields ( \ILIAS\GlobalScreen\Identification\IdentificationInterface  $identification,
array  $data 
)

Definition at line 46 of file class.ilMMAbstractBaseTypeHandlerAction.php.

References ilMMTypeActionStorage\find(), and League\Flysystem\Adapter\Polyfill\update().

46  : bool
47  {
48  ilMMTypeActionStorage::find($identification->serialize())->setAction((string) $data[self::F_ACTION])->setExternal((bool) $data[self::F_EXTERNAL])->update();
49 
50  return true;
51  }
static find($primary_key, array $add_constructor_args=array())
update($pash, $contents, Config $config)
$data
Definition: bench.php:6
+ Here is the call graph for this function:

Field Documentation

◆ $links

ilMMAbstractBaseTypeHandlerAction::$links = []
protected

Definition at line 17 of file class.ilMMAbstractBaseTypeHandlerAction.php.

◆ F_ACTION

const ilMMAbstractBaseTypeHandlerAction::F_ACTION = 'action'

Definition at line 21 of file class.ilMMAbstractBaseTypeHandlerAction.php.

◆ F_EXTERNAL

const ilMMAbstractBaseTypeHandlerAction::F_EXTERNAL = 'external'

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