45 return ilObjContentPage::class;
55 $this->contentPageObject = $object;
57 $this->ctrl = $DIC->ctrl();
58 $this->mainTemplate = $DIC->ui()->mainTemplate();
59 $this->uiFactory = $DIC->ui()->factory();
60 $this->uiRenderer = $DIC->ui()->renderer();
61 $this->httpRequest = $DIC->http()->request();
62 $this->tabs = $DIC->tabs();
63 $this->
user = $DIC->user();
71 return $this->access->checkAccess(
'read',
'', $this->contentPageObject->getRefId());
99 $this->lng->loadLanguageModule(
'copa');
100 $learningProgressToggleCtrlLabel = $this->lng->txt(
'copa_btn_lp_toggle_state_completed');
101 $cmd = self::CMD_LP_TO_INCOMPLETE;
103 $learningProgressToggleCtrlLabel = $this->lng->txt(
'copa_btn_lp_toggle_state_not_completed');
104 $cmd = self::CMD_LP_TO_COMPLETED;
108 $learningProgressToggleCtrlLabel,
130 if (in_array($command, [
131 self::CMD_LP_TO_COMPLETED,
132 self::CMD_LP_TO_INCOMPLETE
136 $marks =
new ilLPMarks($this->contentPageObject->getId(), $this->
user->getId());
139 $new_state = ($command === self::CMD_LP_TO_COMPLETED);
140 $marks->setCompleted($new_state);
144 if ($old_state != $new_state) {
145 $this->lng->loadLanguageModule(
'trac');
146 $this->messages[] = $this->uiFactory->messageBox()->success(
147 $this->lng->txt(
'trac_updated_status')
172 $this->
user->getId(),
173 $this->contentPageObject->getId(),
174 $this->contentPageObject->getRefId(),
175 $this->contentPageObject->getType()
185 $this->contentPageObject,
190 $this->ctrl->setParameterByClass(ilContentPagePageGUI::class,
'ref_id', $this->contentPageObject->getRefId());
192 return $factory->
legacy(implode(
'', [
193 $this->uiRenderer->render($this->messages),
194 $forwarder->forward($this->ctrl->getLinkTargetByClass([
195 ilRepositoryGUI::class, ilObjContentPageGUI::class, ilContentPagePageGUI::class
206 $this->mainTemplate->addCss(
208 $this->contentPageObject->getStyleSheetId()
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
const CMD_LP_TO_COMPLETED
Class ilContentPagePageCommandForwarder.
buildControls(State $state, ControlBuilder $builder)
static _hasCompleted($a_usr_id, $a_obj_id)
Base class to be implemented and put in class-directory of module with the name il$MODULEKioskModeVie...
renderContentStyle()
Renders the content style of a ContentPage object into main template.
updatePost(State $state, string $command, array $post)
render(State $state, Factory $factory, URLBuilder $url_builder, array $post=null)
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
const PRESENTATION_MODE_EMBEDDED_PRESENTATION
presentation mode for embedded presentation, e.g.
static _tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type='')
buildLearningProgressToggleControl(ControlBuilder $builder)
Keeps the state of a view in a simple stringly type key-value store.
buildInitialState(State $empty_state)
hasPermissionToAccessKioskMode()
updateGet(State $state, string $command, int $param=null)
toggleLearningProgress(string $command)
const CMD_LP_TO_INCOMPLETE
This is how the factory for UI elements looks.
setObject(ilObject $object)
legacy($content)
description: purpose: > This component is used to wrap an existing ILIAS UI element into a UI compon...
static getSyntaxStylePath()
get syntax style path
The URLBuilder allows views to get links that are used somewhere inline in the content.
Class ilContentPageKioskModeView.
Build controls for the view.
static getInstance($a_obj_id)
generic(string $label, string $command, int $parameter=null)
A generic control needs to have a label that tells what it does.