19 declare(strict_types=1);
51 return ilObjFile::class;
59 $this->file_obj = $object;
61 $this->
ctrl = $DIC->ctrl();
62 $this->main_template = $DIC->ui()->mainTemplate();
63 $this->ui_factory = $DIC->ui()->factory();
64 $this->ui_renderer = $DIC->ui()->renderer();
65 $this->
http = $DIC->http();
67 $this->
tabs = $DIC->tabs();
68 $this->
user = $DIC->user();
73 return $this->
access->checkAccess(
'read',
'', $this->file_obj->getRefId());
92 if ($command === self::CMD_TOGGLE_LEARNING_PROGRESS) {
105 $file_gui =
new ilObjFileGUI($this->file_obj->getRefId());
106 return $factory->
legacy($file_gui->buildInfoScreen(
true)->getHTML());
111 $this->
lng->loadLanguageModule(
'file');
113 $learning_progress_toggle_ctrl_label = $this->
lng->txt(
'file_btn_lp_toggle_state_completed');
115 $learning_progress_toggle_ctrl_label = $this->
lng->txt(
'file_btn_lp_toggle_state_not_completed');
119 $learning_progress_toggle_ctrl_label,
120 self::CMD_TOGGLE_LEARNING_PROGRESS,
129 $this->file_obj->getId(),
130 $this->
user->getId(),
135 $this->file_obj->getId(),
136 $this->
user->getId(),
const LP_STATUS_COMPLETED_NUM
static _hasUserCompleted(int $a_obj_id, int $a_user_id)
Lookup user object completion.
Interface GlobalHttpState.
An entity that renders components to a string output.
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...
updateGet(State $state, string $command, int $parameter=null)
Update the state based on the provided command.
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.
legacy(string $content)
description: purpose: > This component is used to wrap an existing ILIAS UI element into a UI compon...
Keeps the state of a view in a simple stringly type key-value store.
static http()
Fetches the global http state from ILIAS.
setObject(ilObject $object)
Set the object for this view.
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)
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.
static getInstance(int $obj_id)
generic(string $label, string $command, int $parameter=null)
A generic control needs to have a label that tells what it does.
render(State $state, Factory $factory, URLBuilder $url_builder, array $post=null)