ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ()
 
 getType ()
 
 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 68 of file class.ilLegacyKioskModeView.php.

69 {
70 if (!$builder instanceof LSControlBuilder) {
71 throw new LogicException("The Legacy Mode in the Learning Sequence requires an LSControlBuilder explicitely.", 1);
72 }
73
74 $label = $this->lng->txt('lso_start_item') . ' ' . $this->getTitleByType($this->getType());
75
76 $ref_id = $this->object->getRefId();
77 $obj_id = (int) $this->object->getId();
78 $type = $this->object->getType();
79
81 $ref_id,
82 $type,
83 true,
84 false
85 );
86
87 if (in_array($type, self::GET_VIEW_CMD_FROM_LIST_GUI_FOR)) {
89 $item_list_gui->initItem($ref_id, $obj_id);
90 $view_link = $item_list_gui->getCommandLink('view');
91 $view_link = str_replace('&', '&', $view_link);
92 $view_link = ILIAS_HTTP_PATH . '/' . $view_link;
93 $url = $view_link;
94 }
95
96 $builder->start($label, $url, $obj_id);
97 //return $this->debugBuildAllControls($builder);
98 return $builder;
99 }
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(), getTitleByType(), and getType().

+ Here is the call graph for this function:

◆ buildInitialState()

ilLegacyKioskModeView::buildInitialState ( State  $empty_state)

@inheritDoc

Implements ILIAS\KioskMode\View.

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

60 : State
61 {
62 return $empty_state;
63 }
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 172 of file class.ilLegacyKioskModeView.php.

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

References $builder.

◆ getMetadata()

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

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

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

References $id, $section, $type, and $values.

◆ 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 209 of file class.ilLegacyKioskModeView.php.

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

References $type.

Referenced by buildControls().

+ Here is the caller graph for this function:

◆ getType()

ilLegacyKioskModeView::getType ( )
protected

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

35 : string
36 {
37 return $this->object->getType();
38 }

Referenced by buildControls().

+ Here is the caller graph for this function:

◆ hasPermissionToAccessKioskMode()

ilLegacyKioskModeView::hasPermissionToAccessKioskMode ( )
protected

@inheritDoc

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

51 : bool
52 {
53 return true;
54 //return $this->access->checkAccess('read', '', $this->contentPageObject->getRefId());
55 }

◆ render()

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

@inheritDoc

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

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

◆ setObject()

ilLegacyKioskModeView::setObject ( \ilObject  $object)
protected

@inheritDoc

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

44 {
45 $this->object = $object;
46 }

References $object.

◆ updateGet()

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

@inheritDoc

Implements ILIAS\KioskMode\View.

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

104 : State
105 {
106 return $state;
107 }
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
Definition: linkback.php:10

References $state.

◆ updatePost()

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

@inheritDoc

Implements ILIAS\KioskMode\View.

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

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

References $state.

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: