19declare(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(),
Builds a Color from either hex- or rgb values.
Keeps the state of a view in a simple stringly type key-value store.
const CMD_TOGGLE_LEARNING_PROGRESS
buildLearningProgressToggleControl(ControlBuilder $builder)
hasPermissionToAccessKioskMode()
Check if the global user has permission to access the kiosk mode of the supplied object.
updateGet(State $state, string $command, ?int $parameter=null)
Update the state based on the provided command.
render(State $state, Factory $factory, URLBuilder $url_builder, ?array $post=null)
ilGlobalTemplateInterface $main_template
buildInitialState(State $empty_state)
Build an initial state based on the Provided empty state.
buildControls(State $state, ControlBuilder $builder)
Construct the controls for the view based on the current state.
updatePost(State $state, string $command, array $post)
Update the state and the object based on the provided command and post-data.
getObjectClass()
Get the class of objects this view displays.
Base class to be implemented and put in class-directory of module with the name il$MODULEKioskModeVie...
setObject(ilObject $object)
Set the object for this view.
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.
const LP_STATUS_COMPLETED_NUM
static _hasUserCompleted(int $a_obj_id, int $a_user_id)
Lookup user object completion.
const LP_STATUS_NOT_ATTEMPTED_NUM
GUI class for file objects.
static getInstance(int $obj_id)
Class ilObject Basic functions for all objects.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface GlobalHttpState.
Build controls for the view.
generic(string $label, string $command, ?int $parameter=null)
A generic control needs to have a label that tells what it does.
The URLBuilder allows views to get links that are used somewhere inline in the content.
A component is the most general form of an entity in the UI.
This is how the factory for UI elements looks.
An entity that renders components to a string output.
static http()
Fetches the global http state from ILIAS.