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');
109 $cmd = self::CMD_LP_TO_INCOMPLETE;
111 $learningProgressToggleCtrlLabel = $this->lng->txt(
'copa_btn_lp_toggle_state_not_completed');
112 $cmd = self::CMD_LP_TO_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());
147 $new_state = ($command === self::CMD_LP_TO_COMPLETED);
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()
const CMD_LP_TO_COMPLETED
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)
builtLearningProgressToggleControl(ControlBuilder $builder)
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.
setObject(\ilObject $object)
static _tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type='')
Keeps the state of a view in a simple stringly type key-value store.
buildInitialState(State $empty_state)
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
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.
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
static getContentStylePath($a_style_id, $add_random=true)
get content 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.