11use Psr\Http\Message\ServerRequestInterface;
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');
103 $learningProgressToggleCtrlLabel = $this->lng->txt(
'copa_btn_lp_toggle_state_not_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());
138 $old_state = $marks->getCompleted();
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()
An exception for terminatinating execution or to throw for unit testing.
Keeps the state of a view in a simple stringly type key-value store.
Class ilContentPageKioskModeView.
hasPermissionToAccessKioskMode()
@inheritDoc
const CMD_LP_TO_INCOMPLETE
toggleLearningProgress(string $command)
buildInitialState(State $empty_state)
@inheritDoc
buildControls(State $state, ControlBuilder $builder)
@inheritDoc
updatePost(State $state, string $command, array $post)
@inheritDoc
getObjectClass()
@inheritDoc
setObject(ilObject $object)
@inheritDoc
renderContentStyle()
Renders the content style of a ContentPage object into main template.
buildLearningProgressToggleControl(ControlBuilder $builder)
updateGet(State $state, string $command, int $param=null)
@inheritDoc
render(State $state, Factory $factory, URLBuilder $url_builder, array $post=null)
@inheritDoc
const CMD_LP_TO_COMPLETED
Class ilContentPagePageCommandForwarder.
const PRESENTATION_MODE_EMBEDDED_PRESENTATION
presentation mode for embedded presentation, e.g.
Base class to be implemented and put in class-directory of module with the name il$MODULEKioskModeVie...
static _hasCompleted($a_usr_id, $a_obj_id)
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
static getInstance($a_obj_id)
Class ilObject Basic functions for all objects.
Build controls for the view.
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.