ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilLegacyKioskModeView Class Reference

Class ilLegacyKioskModeView. More...

+ 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 $param=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)
 @inheritDoc More...
 
 hasPermissionToAccessKioskMode ()
 @inheritDoc More...
 

Protected Attributes

 $object
 

Private Member Functions

 getMetadata (int $obj_id, string $type)
 
 debugBuildAllControls (ControlBuilder $builder)
 
 getTitleByType (string $type)
 

Detailed Description

Class ilLegacyKioskModeView.

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

Constructor & Destructor Documentation

◆ __construct()

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

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

24 {
25 $this->object = $object;
26 $this->lng = $lng;
27 $this->access = $access;
28 }
$lng

References $lng, and $object.

Member Function Documentation

◆ buildControls()

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

@inheritDoc

Implements ILIAS\KioskMode\View.

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

64 {
65 if (!$builder instanceof LSControlBuilder) {
66 throw new LogicException("The Legacy Mode in the Learning Sequence requires an LSControlBuilder explicitely.", 1);
67 }
68
69 $ref_id = $this->object->getRefId();
70 $type = $this->object->getType();
71
72 $label = sprintf(
73 $this->lng->txt('lso_start_item'),
74 $this->getTitleByType($type)
75 );
76
78 $ref_id,
79 $type,
80 true,
81 false
82 );
83
84 if (in_array($type, self::GET_VIEW_CMD_FROM_LIST_GUI_FOR)) {
85 $obj_id = $this->object->getId();
87 $item_list_gui->initItem($ref_id, $obj_id, $type);
88 $view_link = $item_list_gui->getCommandLink('view');
89 $view_link = str_replace('&', '&', $view_link);
90 $view_link = ILIAS_HTTP_PATH . '/' . $view_link;
91 $url = $view_link;
92 }
93
94 $builder->start($label, $url, 0);
95
96 // return $this->debugBuildAllControls($builder);
97 return $builder;
98 }
Class LSControlBuilder.
static _getListGUIByType($a_type, $a_context=ilObjectListGUI::CONTEXT_REPOSITORY)
Build controls for the view.
$builder
Definition: parser.php:5
$type
$url

References $builder, $type, $url, ilObjectListGUIFactory\_getListGUIByType(), ilLink\_getStaticLink(), and ILIAS_HTTP_PATH.

+ Here is the call graph for this function:

◆ buildInitialState()

ilLegacyKioskModeView::buildInitialState ( State  $empty_state)

@inheritDoc

Implements ILIAS\KioskMode\View.

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

55 : State
56 {
57 return $empty_state;
58 }
Keeps the state of a view in a simple stringly type key-value store.
Definition: State.php:10

◆ debugBuildAllControls()

ilLegacyKioskModeView::debugBuildAllControls ( ControlBuilder  $builder)
private

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

172 {
174
175 ->tableOfContent($this->getObjectTitle(), 'kommando', 666)
176 ->node('node1')
177 ->item('item1.1', 1)
178 ->item('item1.2', 11)
179 ->end()
180 ->item('item2', 111)
181 ->node('node3', 1111)
182 ->item('item3.1', 2)
183 ->node('node3.2')
184 ->item('item3.2.1', 122)
185 ->end()
186 ->end()
187 ->end()
188
189 ->locator('locator_cmd')
190 ->item('item 1', 1)
191 ->item('item 2', 2)
192 ->item('item 3', 3)
193 ->end()
194
195 ->done('cmd', 1)
196 ->next('cmd', 1)
197 ->previous('', 1)
198 //->exit('cmd', 1)
199 ->generic('cmd 1', 'x', 1)
200 ->generic('cmd 2', 'x', 2)
201 //->toggle('toggle', 'cmd_on', 'cmd_off')
202 ->mode('modecmd', ['m1', 'm2', 'm3'])
203 ;
204
205 return $builder;
206 }

References $builder.

◆ getMetadata()

ilLegacyKioskModeView::getMetadata ( int  $obj_id,
string  $type 
)
private

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

143 : array
144 {
145 $md = new ilMD($obj_id, 0, $type);
146 $meta_data = [];
147
148 $section = $md->getGeneral();
149 if (!$section) {
150 return [];
151 }
152
153 $meta_data['language'] = [];
154 foreach ($section->getLanguageIds() as $id) {
155 $meta_data['language'][] = $section->getLanguage($id)->getLanguageCode();
156 }
157 $meta_data['keywords'] = [];
158 foreach ($section->getKeywordIds() as $id) {
159 $meta_data['keywords'][] = $section->getKeyword($id)->getKeyword();
160 }
161
162 $md_flat = [];
163 foreach ($meta_data as $md_label => $values) {
164 if (count($values) > 0) {
165 $md_flat[$this->lng->txt($md_label)] = implode(', ', $values);
166 }
167 }
168 return $md_flat;
169 }
$section
Definition: Utf8Test.php:83

References $section, and $type.

◆ getObjectTitle()

ilLegacyKioskModeView::getObjectTitle ( )
protected

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

30 : string
31 {
32 return $this->object->getTitle();
33 }

◆ getTitleByType()

ilLegacyKioskModeView::getTitleByType ( string  $type)
private

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

208 : string
209 {
210 return $this->lng->txt("obj_" . $type);
211 }

References $type.

◆ hasPermissionToAccessKioskMode()

ilLegacyKioskModeView::hasPermissionToAccessKioskMode ( )
protected

@inheritDoc

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

46 : bool
47 {
48 return true;
49 //return $this->access->checkAccess('read', '', $this->contentPageObject->getRefId());
50 }

◆ render()

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

@inheritDoc

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

124 : Component {
125 $obj_type = $this->object->getType();
126 $obj_type_txt = $this->lng->txt('obj_' . $obj_type);
127 $icon = $factory->symbol()->icon()->standard($obj_type, $obj_type_txt, 'large');
128 $md = $this->getMetadata((int) $this->object->getId(), $obj_type);
129 $props = array_merge(
130 [$this->lng->txt('obj_type') => $obj_type_txt],
131 $this->getMetadata((int) $this->object->getId(), $obj_type)
132 );
133
134 $info = $factory->item()->standard($this->object->getTitle())
135 ->withLeadIcon($icon)
136 ->withDescription($this->object->getDescription())
137 ->withProperties($props);
138
139 return $info;
140 }
getMetadata(int $obj_id, string $type)
A component is the most general form of an entity in the UI.
Definition: Component.php:14
$factory
Definition: metadata.php:58

◆ setObject()

ilLegacyKioskModeView::setObject ( \ilObject  $object)
protected

@inheritDoc

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

39 {
40 $this->object = $object;
41 }

References $object.

◆ updateGet()

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

@inheritDoc

Implements ILIAS\KioskMode\View.

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

103 : State
104 {
105 return $state;
106 }

◆ updatePost()

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

@inheritDoc

Implements ILIAS\KioskMode\View.

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

111 : State
112 {
113 return $state;
114 }

Field Documentation

◆ $object

ilLegacyKioskModeView::$object
protected

Definition at line 18 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 16 of file class.ilLegacyKioskModeView.php.


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