11use Psr\Http\Message\ServerRequestInterface;
53 return \ilObjContentPage::class;
63 $this->contentPageObject = $object;
65 $this->ctrl =
$DIC->ctrl();
66 $this->mainTemplate =
$DIC->ui()->mainTemplate();
67 $this->uiFactory =
$DIC->ui()->factory();
68 $this->uiRenderer =
$DIC->ui()->renderer();
69 $this->httpRequest =
$DIC->http()->request();
70 $this->tabs =
$DIC->tabs();
71 $this->
user = $DIC->user();
79 return $this->access->checkAccess(
'read',
'', $this->contentPageObject->getRefId());
107 $this->lng->loadLanguageModule(
'copa');
108 $learningProgressToggleCtrlLabel = $this->lng->txt(
'copa_btn_lp_toggle_state_completed');
111 $learningProgressToggleCtrlLabel = $this->lng->txt(
'copa_btn_lp_toggle_state_not_completed');
116 $learningProgressToggleCtrlLabel,
138 if (in_array($command, [
139 self::CMD_LP_TO_COMPLETED,
140 self::CMD_LP_TO_INCOMPLETE
144 $marks =
new ilLPMarks($this->contentPageObject->getId(), $this->user->getId());
146 $old_state = $marks->getCompleted();
148 $marks->setCompleted($new_state);
152 if ($old_state != $new_state) {
153 $this->lng->loadLanguageModule(
'trac');
154 $this->messages[] = $this->uiFactory->messageBox()->success(
155 $this->lng->txt(
'trac_updated_status')
180 $this->
user->getId(),
181 $this->contentPageObject->getId(),
182 $this->contentPageObject->getRefId(),
183 $this->contentPageObject->getType()
188 $forwarder = new \ilContentPagePageCommandForwarder(
193 $this->contentPageObject
197 $this->ctrl->setParameterByClass(\ilContentPagePageGUI::class,
'ref_id', $this->contentPageObject->getRefId());
199 return $factory->legacy(implode(
'', [
200 $this->uiRenderer->render($this->messages),
201 $forwarder->forward($this->ctrl->getLinkTargetByClass([
202 \ilRepositoryGUI::class, \ilObjContentPageGUI::class, \ilContentPagePageGUI::class
213 $this->mainTemplate->addCss(
215 $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
setObject(\ilObject $object)
@inheritDoc
toggleLearningProgress(string $command)
buildInitialState(State $empty_state)
@inheritDoc
buildControls(State $state, ControlBuilder $builder)
@inheritDoc
updatePost(State $state, string $command, array $post)
@inheritDoc
getObjectClass()
@inheritDoc
builtLearningProgressToggleControl(ControlBuilder $builder)
renderContentStyle()
Renders the content style of a ContentPage object into main template.
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
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.