3declare(strict_types=1);
27 $this->access = $access;
32 return $this->
object->getTitle();
66 throw new LogicException(
"The Legacy Mode in the Learning Sequence requires an LSControlBuilder explicitely.", 1);
69 $ref_id = $this->
object->getRefId();
70 $type = $this->
object->getType();
73 $this->lng->txt(
'lso_start_item'),
74 $this->getTitleByType(
$type)
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);
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)
134 $info =
$factory->item()->standard($this->object->getTitle())
135 ->withLeadIcon($icon)
136 ->withDescription($this->object->getDescription())
137 ->withProperties($props);
153 $meta_data[
'language'] = [];
154 foreach (
$section->getLanguageIds() as $id) {
155 $meta_data[
'language'][] =
$section->getLanguage($id)->getLanguageCode();
157 $meta_data[
'keywords'] = [];
158 foreach (
$section->getKeywordIds() as $id) {
159 $meta_data[
'keywords'][] =
$section->getKeyword($id)->getKeyword();
163 foreach ($meta_data as $md_label => $values) {
164 if (count($values) > 0) {
165 $md_flat[$this->lng->txt($md_label)] = implode(
', ', $values);
175 ->tableOfContent($this->getObjectTitle(),
'kommando', 666)
178 ->item(
'item1.2', 11)
181 ->node(
'node3', 1111)
184 ->item(
'item3.2.1', 122)
189 ->locator(
'locator_cmd')
199 ->generic(
'cmd 1',
'x', 1)
200 ->generic(
'cmd 2',
'x', 2)
202 ->mode(
'modecmd', [
'm1',
'm2',
'm3'])
210 return $this->lng->txt(
"obj_" .
$type);
An exception for terminatinating execution or to throw for unit testing.
Keeps the state of a view in a simple stringly type key-value store.
Class ilLegacyKioskModeView.
updateGet(State $state, string $command, int $param=null)
@inheritDoc
debugBuildAllControls(ControlBuilder $builder)
__construct(ilObject $object, ilLanguage $lng, ilAccess $access)
const GET_VIEW_CMD_FROM_LIST_GUI_FOR
buildInitialState(State $empty_state)
@inheritDoc
render(State $state, Factory $factory, URLBuilder $url_builder, array $post=null)
@inheritDoc
updatePost(State $state, string $command, array $post)
@inheritDoc
buildControls(State $state, ControlBuilder $builder)
@inheritDoc
setObject(\ilObject $object)
@inheritDoc
getTitleByType(string $type)
hasPermissionToAccessKioskMode()
@inheritDoc
getMetadata(int $obj_id, string $type)
static _getStaticLink( $a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
static _getListGUIByType($a_type, $a_context=ilObjectListGUI::CONTEXT_REPOSITORY)
Class ilObject Basic functions for all objects.
Build controls for the view.
The URLBuilder allows views to get links that are used somewhere inline in the content.
A kiosk mode view on a certain object.
A component is the most general form of an entity in the UI.
This is how the factory for UI elements looks.