47 string $requested_back_page,
52 $this->requested_obj_id = $request_obj_id;
56 $this->requested_back_page = (
int) $requested_back_page;
85 $this->chapter_has_no_active_page =
false;
86 $this->deactivated_page =
false;
90 $requested_obj_id = 0;
94 if ($requested_obj_id == 0) {
95 $obj_id = $this->lm_tree->getRootId();
97 if ($this->cmd ==
"resume") {
101 if ($last_accessed_page &&
102 $last_accessed_page != $this->lm_tree->getLastActivePage()) {
103 $obj_id = $last_accessed_page;
111 $this->lm->getType(),
112 (bool) $this->lm_set->get(
"time_scheduled_page_activation")
117 $this->deactivated_page =
true;
121 if (!$this->lm_tree->isInTree($obj_id)) {
122 $this->current_page_id = $obj_id;
126 $curr_node = $this->lm_tree->getNodeData($obj_id);
130 $this->lm->getType(),
131 (bool) $this->lm_set->get(
"time_scheduled_page_activation")
138 if ($act_data[
"show_activation_info"] ??
false) {
142 if ($curr_node[
"type"] ==
"pg" &&
144 $page_id = $curr_node[
"obj_id"];
149 while ($succ_node && !$active) {
150 $succ_node = $this->lm_tree->fetchSuccessorNode($page_id,
"pg");
151 if (!is_null($succ_node)) {
152 $page_id = $succ_node[
"obj_id"];
155 $this->lm->getType(),
156 (bool) $this->lm_set->get(
"time_scheduled_page_activation")
161 if (is_null($succ_node) || $succ_node[
"type"] !=
"pg") {
162 $this->chapter_has_no_active_page =
true;
163 $this->current_page_id = 0;
169 $this->lm->getPublicAccessMode() ==
'selected') {
172 while ($public ===
false && $page_id > 0) {
173 $succ_node = $this->lm_tree->fetchSuccessorNode($page_id,
'pg');
174 $page_id = $succ_node[
'obj_id'];
180 if ($this->lm_tree->isInTree($page_id)) {
181 $path = $this->lm_tree->getPathId($page_id);
182 if (!in_array($requested_obj_id,
$path)) {
183 $this->chapter_has_no_active_page =
true;
188 $this->current_page_id = $page_id;
195 if (empty($page_id)) {
208 $user_id = $this->
user->getId();
215 if ($this->chapter_has_no_active_page &&
219 if ($this->deactivated_page) {
227 if ($this->lm_tree->isInTree($c_id)) {
228 $succ_node = $this->lm_tree->fetchSuccessorNode($c_id,
"pg");
230 if (is_array($succ_node)) {
231 $c_id = $succ_node[
"obj_id"];
235 $this->lm->getType(),
236 (bool) $this->lm_set->get(
"time_scheduled_page_activation")
239 if (is_array($succ_node) && $succ_node[
"obj_id"] > 0 &&
241 ($this->lm->getPublicAccessMode() ==
"selected" &&
245 if (is_array($succ_node) && $succ_node[
"obj_id"] > 0 && !$active) {
248 if ($act_data[
"show_activation_info"] &&
259 if (is_array($succ_node)) {
260 return (
int) $succ_node[
"obj_id"];
269 $user_id = $this->
user->getId();
274 if ($this->deactivated_page) {
281 if ($this->lm_tree->isInTree($c_id)) {
282 $pre_node = $this->lm_tree->fetchPredecessorNode($c_id,
"pg");
284 if (is_array($pre_node)) {
285 $c_id = $pre_node[
"obj_id"];
288 $this->lm->getType(),
289 (bool) $this->lm_set->get(
"time_scheduled_page_activation")
292 if (is_array($pre_node) && $pre_node[
"obj_id"] > 0 &&
294 ($this->lm->getPublicAccessMode() ==
"selected" &&
298 if (is_array($pre_node) && $pre_node[
"obj_id"] > 0 && !$active) {
301 if ($act_data[
"show_activation_info"] &&
312 if (is_array($pre_node)) {
313 return (
int) $pre_node[
"obj_id"];
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
static _isPagePublic(int $a_node_id, bool $a_check_public_mode=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupActivationData(int $a_id, string $a_parent_type, string $a_lang="-")
Lookup activation data.
static now()
Return current timestamp in Y-m-d H:i:s format.
__construct(ilObjUser $user, int $request_obj_id, ilLMTree $lm_tree, ilObjLearningModule $lm, ilSetting $lm_set, string $requested_back_page, string $cmd, int $focus_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
bool $chapter_has_no_active_page
static _getLastAccessedPage(int $a_ref_id, int $a_user_id=0)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $a_obj_id, int $a_lm_id=0)
static _lookupContObjID(int $a_id)
get learning module id for lm object
isChapterWithoutActivePage()
Has current chapter no active page?