ILIAS  release_8 Revision v8.25-1-g13de6a5eca6
ilLegacyKioskModeView Class Reference
+ Inheritance diagram for ilLegacyKioskModeView:
+ Collaboration diagram for ilLegacyKioskModeView:

Public Member Functions

 __construct (ilObject $object, ilLanguage $lng, ilAccess $access)
 
 buildInitialState (State $empty_state)
 @inheritDoc More...
 
 buildControls (State $state, ControlBuilder $builder)
 @inheritDoc More...
 
 updateGet (State $state, string $command, int $parameter=null)
 @inheritDoc More...
 
 updatePost (State $state, string $command, array $post)
 @inheritDoc More...
 
 render (State $state, Factory $factory, URLBuilder $url_builder, array $post=null)
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\KioskMode\View
 buildInitialState (State $empty_state)
 Build an initial state based on the Provided empty state. More...
 
 buildControls (State $state, ControlBuilder $builder)
 Construct the controls for the view based on the current state. More...
 
 updateGet (State $state, string $command, int $parameter=null)
 Update the state based on the provided command. More...
 
 updatePost (State $state, string $command, array $post)
 Update the state and the object based on the provided command and post-data. More...
 
 render (State $state, UI\Factory $factory, URLBuilder $url_builder, array $post=null)
 Render a state using the ui-factory and URLs from the builder. More...
 

Data Fields

const GET_VIEW_CMD_FROM_LIST_GUI_FOR = ['sahs']
 

Protected Member Functions

 getObjectTitle ()
 
 setObject (\ilObject $object)
 
 hasPermissionToAccessKioskMode ()
 

Protected Attributes

ilObject $object
 
ilLanguage $lng
 
ilAccess $access
 

Private Member Functions

 getMetadata (int $obj_id, string $type)
 
 getTitleByType (string $type)
 

Detailed Description

Definition at line 27 of file class.ilLegacyKioskModeView.php.

Constructor & Destructor Documentation

◆ __construct()

ilLegacyKioskModeView::__construct ( ilObject  $object,
ilLanguage  $lng,
ilAccess  $access 
)

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

References $access, $lng, $object, ILIAS\Repository\access(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildControls()

ilLegacyKioskModeView::buildControls ( State  $state,
ControlBuilder  $builder 
)

@inheritDoc

Implements ILIAS\KioskMode\View.

Definition at line 71 of file class.ilLegacyKioskModeView.php.

72 {
73 if (!$builder instanceof LSControlBuilder) {
74 throw new LogicException("The Legacy Mode in the Learning Sequence requires an LSControlBuilder explicitely.", 1);
75 }
76
77 $ref_id = $this->object->getRefId();
78 $type = $this->object->getType();
79
80 $label = sprintf(
81 $this->lng->txt('lso_start_item'),
82 $this->getTitleByType($type)
83 );
84
86 $ref_id,
87 $type
88 );
89
90 $obj_id = $this->object->getId();
91 if (in_array($type, self::GET_VIEW_CMD_FROM_LIST_GUI_FOR)) {
93 $item_list_gui->initItem($ref_id, $obj_id, $type);
94 $view_link = $item_list_gui->getCommandLink('view');
95 $view_link = str_replace('&', '&', $view_link);
96 $view_link = ILIAS_HTTP_PATH . '/' . $view_link;
97 $url = $view_link;
98 }
99
100 $builder->start($label, $url, $obj_id);
101
102 return $builder;
103 }
static _getListGUIByType(string $type, int $context=ilObjectListGUI::CONTEXT_REPOSITORY)
Build controls for the view.
$ref_id
Definition: ltiauth.php:67
$type
$url

References $ref_id, $type, $url, ilObjectListGUIFactory\_getListGUIByType(), ilLink\_getStaticLink(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ buildInitialState()

ilLegacyKioskModeView::buildInitialState ( State  $empty_state)

@inheritDoc

Implements ILIAS\KioskMode\View.

Definition at line 63 of file class.ilLegacyKioskModeView.php.

63 : State
64 {
65 return $empty_state;
66 }
Keeps the state of a view in a simple stringly type key-value store.
Definition: State.php:13

◆ getMetadata()

ilLegacyKioskModeView::getMetadata ( int  $obj_id,
string  $type 
)
private
Returns
array<string, string>|[]

Definition at line 149 of file class.ilLegacyKioskModeView.php.

149 : array
150 {
151 $md = new ilMD($obj_id, 0, $type);
152 $meta_data = [];
153
154 $section = $md->getGeneral();
155 if (!$section) {
156 return [];
157 }
158
159 $meta_data['language'] = [];
160 foreach ($section->getLanguageIds() as $id) {
161 $meta_data['language'][] = $section->getLanguage($id)->getLanguageCode();
162 }
163 $meta_data['keywords'] = [];
164 foreach ($section->getKeywordIds() as $id) {
165 $meta_data['keywords'][] = $section->getKeyword($id)->getKeyword();
166 }
167
168 $md_flat = [];
169 foreach ($meta_data as $md_label => $values) {
170 if ($values !== []) {
171 $md_flat[$this->lng->txt($md_label)] = implode(', ', $values);
172 }
173 }
174 return $md_flat;
175 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id, $type, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getObjectTitle()

ilLegacyKioskModeView::getObjectTitle ( )
protected

Definition at line 45 of file class.ilLegacyKioskModeView.php.

45 : string
46 {
47 return $this->object->getTitle();
48 }

◆ getTitleByType()

ilLegacyKioskModeView::getTitleByType ( string  $type)
private

Definition at line 177 of file class.ilLegacyKioskModeView.php.

177 : string
178 {
179 return $this->lng->txt("obj_" . $type);
180 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ hasPermissionToAccessKioskMode()

ilLegacyKioskModeView::hasPermissionToAccessKioskMode ( )
protected

Definition at line 55 of file class.ilLegacyKioskModeView.php.

55 : bool
56 {
57 return true;
58 }

◆ render()

ilLegacyKioskModeView::render ( State  $state,
Factory  $factory,
URLBuilder  $url_builder,
array  $post = null 
)

@inheritDoc

Definition at line 124 of file class.ilLegacyKioskModeView.php.

129 : Component {
130 $obj_type = $this->object->getType();
131 $obj_type_txt = $this->lng->txt('obj_' . $obj_type);
132 $icon = $factory->symbol()->icon()->standard($obj_type, $obj_type_txt, 'large');
133
134 $props = array_merge(
135 [$this->lng->txt('obj_type') => $obj_type_txt],
136 $this->getMetadata($this->object->getId(), $obj_type)
137 );
138
139 return $factory->item()->standard($this->object->getTitle())
140 ->withLeadIcon($icon)
141 ->withDescription($this->object->getDescription())
142 ->withProperties($props);
143 }
$factory
Definition: metadata.php:75
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ setObject()

ilLegacyKioskModeView::setObject ( \ilObject  $object)
protected

Definition at line 50 of file class.ilLegacyKioskModeView.php.

50 : void
51 {
52 $this->object = $object;
53 }

References $object.

◆ updateGet()

ilLegacyKioskModeView::updateGet ( State  $state,
string  $command,
int  $parameter = null 
)

@inheritDoc

Implements ILIAS\KioskMode\View.

Definition at line 108 of file class.ilLegacyKioskModeView.php.

108 : State
109 {
110 return $state;
111 }

◆ updatePost()

ilLegacyKioskModeView::updatePost ( State  $state,
string  $command,
array  $post 
)

@inheritDoc

Implements ILIAS\KioskMode\View.

Definition at line 116 of file class.ilLegacyKioskModeView.php.

116 : State
117 {
118 return $state;
119 }

Field Documentation

◆ $access

ilAccess ilLegacyKioskModeView::$access
protected

Definition at line 33 of file class.ilLegacyKioskModeView.php.

Referenced by __construct().

◆ $lng

ilLanguage ilLegacyKioskModeView::$lng
protected

Definition at line 32 of file class.ilLegacyKioskModeView.php.

Referenced by __construct().

◆ $object

ilObject ilLegacyKioskModeView::$object
protected

Definition at line 31 of file class.ilLegacyKioskModeView.php.

Referenced by __construct(), and setObject().

◆ GET_VIEW_CMD_FROM_LIST_GUI_FOR

const ilLegacyKioskModeView::GET_VIEW_CMD_FROM_LIST_GUI_FOR = ['sahs']

Definition at line 29 of file class.ilLegacyKioskModeView.php.


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