19 declare(strict_types=1);
54 return ilObjFile::class;
62 $this->file_obj = $object;
64 $this->
ctrl = $DIC->ctrl();
65 $this->main_template = $DIC->ui()->mainTemplate();
66 $this->ui_factory = $DIC->ui()->factory();
67 $this->ui_renderer = $DIC->ui()->renderer();
68 $this->
http = $DIC->http();
70 $this->
tabs = $DIC->tabs();
71 $this->
user = $DIC->user();
76 return $this->
access->checkAccess(
'read',
'', $this->file_obj->getRefId());
95 if ($command === self::CMD_TOGGLE_LEARNING_PROGRESS) {
108 $file_gui =
new ilObjFileGUI($this->file_obj->getRefId());
109 return $factory->
legacy()->content($file_gui->buildInfoScreen(
true)->getHTML());
114 $this->
lng->loadLanguageModule(
'file');
116 $learning_progress_toggle_ctrl_label = $this->
lng->txt(
'file_btn_lp_toggle_state_completed');
118 $learning_progress_toggle_ctrl_label = $this->
lng->txt(
'file_btn_lp_toggle_state_not_completed');
122 $learning_progress_toggle_ctrl_label,
123 self::CMD_TOGGLE_LEARNING_PROGRESS,
132 $this->file_obj->getId(),
133 $this->
user->getId(),
138 $this->file_obj->getId(),
139 $this->
user->getId(),
const LP_STATUS_COMPLETED_NUM
static _hasUserCompleted(int $a_obj_id, int $a_user_id)
Lookup user object completion.
legacy()
description: purpose: > legacy components are used as provisional elements in the UI framework while...
Base class to be implemented and put in class-directory of module with the name il$MODULEKioskModeVie...
buildControls(State $state, ControlBuilder $builder)
Construct the controls for the view based on the current state.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
updatePost(State $state, string $command, array $post)
Update the state and the object based on the provided command and post-data.
generic(string $label, string $command, ?int $parameter=null)
A generic control needs to have a label that tells what it does.
Keeps the state of a view in a simple stringly type key-value store.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static http()
Fetches the global http state from ILIAS.
setObject(ilObject $object)
Set the object for this view.
This is how the factory for UI elements looks.
ilGlobalTemplateInterface $main_template
hasPermissionToAccessKioskMode()
const LP_STATUS_NOT_ATTEMPTED_NUM
const CMD_TOGGLE_LEARNING_PROGRESS
The URLBuilder allows views to get links that are used somewhere inline in the content.
GUI class for file objects.
buildInitialState(State $empty_state)
Build an initial state based on the Provided empty state.
buildLearningProgressToggleControl(ControlBuilder $builder)
updateGet(State $state, string $command, ?int $parameter=null)
Update the state based on the provided command.
static writeStatus(int $a_obj_id, int $a_user_id, int $a_status, int $a_percentage=0, bool $a_force_per=false, ?int &$a_old_status=self::LP_STATUS_NOT_ATTEMPTED_NUM)
Write status for user and object.
Build controls for the view.
render(State $state, Factory $factory, URLBuilder $url_builder, ?array $post=null)
static getInstance(int $obj_id)