Skip to content

Commit

Permalink
Tracking: change main menu link depending on access (33736)
Browse files Browse the repository at this point in the history
  • Loading branch information
schmitz-ilias committed Oct 10, 2023
1 parent 9304175 commit ff0eff0
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Services/Tracking/classes/Provider/LPMainBarProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public function getStaticSubItems(): array
$title
);
$ctrl = $DIC->ctrl();

$target_class = ilObjUserTracking::_hasLearningProgressLearner() ?
'ilLPListOfProgressGUI' : 'ilLPListOfObjectsGUI';

return [
$this->mainmenu->link($this->if->identifier('mm_pd_lp'))
->withTitle($title)
Expand All @@ -43,7 +47,7 @@ public function getStaticSubItems(): array
["ilDashboardGUI",
"ilAchievementsGUI",
"ilLearningProgressGUI",
"ilLPListOfProgressGUI"
$target_class
]
)
)
Expand All @@ -60,12 +64,11 @@ public function getStaticSubItems(): array
)
->withAvailableCallable(
function () {
return ilObjUserTracking::_enabledLearningProgress(
)
&& (ilObjUserTracking::_hasLearningProgressOtherUsers(
)
|| ilObjUserTracking::_hasLearningProgressLearner(
));
return ilObjUserTracking::_enabledLearningProgress() &&
(
ilObjUserTracking::_hasLearningProgressOtherUsers() ||
ilObjUserTracking::_hasLearningProgressLearner()
);
}
),
];
Expand Down

0 comments on commit ff0eff0

Please sign in to comment.