19 declare(strict_types=1);
53 return ilObjContentPage::class;
60 $this->contentPageObject = $object;
62 $this->
ctrl = $DIC->ctrl();
64 $this->uiFactory = $DIC->ui()->factory();
65 $this->uiRenderer = $DIC->ui()->renderer();
66 $this->
http = $DIC->http();
68 $this->
tabs = $DIC->tabs();
69 $this->
user = $DIC->user();
70 $cs = $DIC->contentStyle();
71 $this->content_style_gui = $cs->gui();
72 $this->content_style_domain = $cs->domain()->styleForRefId($object->
getRefId());
79 return $this->
access->checkAccess(
'read',
'', $this->contentPageObject->getRefId());
98 $this->
lng->loadLanguageModule(
'copa');
99 $learningProgressToggleCtrlLabel = $this->
lng->txt(
'copa_btn_lp_toggle_state_completed');
100 $cmd = self::CMD_LP_TO_INCOMPLETE;
102 $learningProgressToggleCtrlLabel = $this->
lng->txt(
'copa_btn_lp_toggle_state_not_completed');
103 $cmd = self::CMD_LP_TO_COMPLETED;
107 $learningProgressToggleCtrlLabel,
123 if (in_array($command, [
124 self::CMD_LP_TO_COMPLETED,
125 self::CMD_LP_TO_INCOMPLETE
129 $marks =
new ilLPMarks($this->contentPageObject->getId(), $this->
user->getId());
131 $old_state = $marks->getCompleted();
132 $new_state = ($command === self::CMD_LP_TO_COMPLETED);
133 $marks->setCompleted($new_state);
137 if ((
int) $old_state !== (
int) $new_state) {
138 $this->
lng->loadLanguageModule(
'trac');
139 $this->messages[] = $this->uiFactory->messageBox()->success(
140 $this->
lng->txt(
'trac_updated_status')
159 $this->
user->getId(),
160 $this->contentPageObject->getId(),
161 $this->contentPageObject->getRefId(),
162 $this->contentPageObject->getType()
172 $this->contentPageObject,
176 $this->content_style_domain
180 $this->
ctrl->setParameterByClass(ilContentPagePageGUI::class,
'ref_id', $this->contentPageObject->getRefId());
182 return $factory->
legacy()->content(implode(
'', [
183 $this->uiRenderer->render($this->messages),
184 $forwarder->forward($this->
ctrl->getLinkTargetByClass([
185 ilRepositoryGUI::class, ilObjContentPageGUI::class, ilContentPagePageGUI::class
196 $this->content_style_gui->addCss(
198 $this->contentPageObject->getRefId()
ILIAS Style Content GUIService $content_style_gui
legacy()
description: purpose: > legacy components are used as provisional elements in the UI framework while...
buildControls(State $state, ControlBuilder $builder)
Construct the controls for the view based on the current state.
Base class to be implemented and put in class-directory of module with the name il$MODULEKioskModeVie...
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...
ilGlobalTemplateInterface $mainTemplate
renderContentStyle()
Renders the content style of a ContentPage object into main template.
updatePost(State $state, string $command, array $post)
Update the state and the object based on the provided command and post-data.
Translations $translation
ilObjContentPage $contentPageObject
const string CMD_LP_TO_INCOMPLETE
Class handles translation mode for an object.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
buildLearningProgressToggleControl(ControlBuilder $builder)
generic(string $label, string $command, ?int $parameter=null)
A generic control needs to have a label that tells what it does.
buildInitialState(State $empty_state)
Build an initial state based on the Provided empty state.
render(State $state, Factory $factory, URLBuilder $url_builder, ?array $post=null)
static _tracProgress(int $a_user_id, int $a_obj_id, int $a_ref_id, string $a_obj_type='')
static _hasCompleted(int $a_usr_id, int $a_obj_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
hasPermissionToAccessKioskMode()
static http()
Fetches the global http state from ILIAS.
toggleLearningProgress(string $command)
This is how the factory for UI elements looks.
final const string PRESENTATION_MODE_EMBEDDED_PRESENTATION
presentation mode for embedded presentation, e.g.
ILIAS Style Content Object ObjectFacade $content_style_domain
setObject(ilObject $object)
static getSyntaxStylePath()
const string CMD_LP_TO_COMPLETED
The URLBuilder allows views to get links that are used somewhere inline in the content.
Build controls for the view.
static getInstance(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)