19 declare(strict_types=1);
97 public const TAB_LP =
"learning_progress";
125 public static function _goto(
string $target): void
128 $main_tpl = $DIC->ui()->mainTemplate();
130 $request = $DIC->http()->request();
131 $lng = $DIC->language();
132 $err = $DIC[
'ilErr'];
134 $targetParameters = explode(
'_', $target);
135 $id = (
int) $targetParameters[0];
137 if (!self::isAccessible(
$id)) {
138 $err->raiseError(
$lng->
txt(
'msg_no_perm_read'), $err->FATAL);
141 if (self::hasAccess(self::ACCESS_READ,
$id)) {
144 if (isset($request->getQueryParams()[
'gotolp'])) {
148 self::forwardByClass(
149 ilRepositoryGUI::class,
150 [ilObjLearningSequenceGUI::class],
155 if (self::hasAccess(self::ACCESS_VISIBLE,
$id)) {
160 $main_tpl->setOnScreenMessage(
'info', sprintf(
161 $lng->
txt(
'msg_no_perm_read_item'),
165 self::forwardByClass(ilRepositoryGUI::class, [ilRepositoryGUI::class], [
'ref_id' =>
ROOT_FOLDER_ID]);
172 self::hasAccess(self::ACCESS_READ, $id) ||
173 self::hasAccess(self::ACCESS_VISIBLE, $id) ||
181 return $DIC->access()->checkAccess($mode,
'', $id);
187 $ctrl = $DIC->ctrl();
188 $target_class = end($classes);
191 foreach ($params as
$key => $value) {
196 array_splice($classes, 0, 0, $base_class);
205 $this->
ctrl = $DIC[
'ilCtrl'];
206 $this->
lng = $DIC[
'lng'];
207 $this->
user = $DIC[
'ilUser'];
208 $this->
tabs = $DIC[
'ilTabs'];
209 $this->
toolbar = $DIC[
'ilToolbar'];
210 $this->
help = $DIC[
'ilHelp'];
211 $this->
settings = $DIC[
'ilSetting'];
212 $this->
access = $DIC[
'ilAccess'];
213 $this->rbac_review = $DIC[
'rbacreview'];
214 $this->ui_factory = $DIC[
'ui.factory'];
215 $this->ui_renderer = $DIC[
'ui.renderer'];
216 $this->request = $DIC->http()->request();
218 $this->log = $DIC[
"ilLoggerFactory"]->getRootLogger();
219 $this->app_event_handler = $DIC[
'ilAppEventHandler'];
220 $this->navigation_history = $DIC[
'ilNavigationHistory'];
221 $this->obj_definition = $DIC[
'objDefinition'];
222 $this->tpl = $DIC[
"tpl"];
223 $this->obj_service = $DIC->object();
224 $this->
toolbar = $DIC[
'ilToolbar'];
225 $this->request_wrapper = $DIC->http()->wrapper()->query();
226 $this->post_wrapper = $DIC->http()->wrapper()->post();
228 $this->content_style = $DIC->contentStyle();
230 $this->
help->setScreenIdComponent($this->obj_type);
231 $this->
lng->loadLanguageModule($this->obj_type);
233 $this->data_factory =
new Data\Factory();
235 $this->ref_id = $this->request_wrapper->retrieve(
"ref_id", $this->
refinery->kindlyTo()->int());
243 $this->
object->getRefId(),
244 $this->
object->getId(),
251 $next_class = $this->
ctrl->getNextClass($this);
252 $cmd = $this->
ctrl->getCmd();
255 parent::prepareOutput();
262 $next_class ===
'ilobjlearningsequencelearnergui' 268 switch ($next_class) {
269 case "ilcommonactiondispatchergui":
273 case "ilinfoscreengui":
276 case "ilpermissiongui":
279 case "ilobjlearningsequencesettingsgui":
283 case "ilobjlearningsequencecontentgui":
287 case "ilobjlearningsequencelearnergui":
290 case "illearningsequencemembershipgui":
293 case 'illearningprogressgui':
299 case 'ilobjectcopygui':
302 $this->
ctrl->forwardCommand($cp);
304 case 'ilobjindividualassessmentgui':
305 $struct = [
'ilrepositorygui',
'ilobjindividualassessmentgui'];
306 if ($cmd ===
'edit') {
307 $struct[] =
'ilindividualassessmentsettingsgui';
309 $this->
ctrl->redirectByClass($struct, $cmd);
312 $struct = [
'ilrepositorygui',
'ilobjtestgui'];
313 $this->
ctrl->redirectByClass($struct, $cmd);
315 case 'ilobjlearningsequencelppollinggui':
316 $gui = $this->
object->getLocalDI()[
"gui.learner.lp"];
317 $this->
ctrl->setCmd($cmd);
321 case "ilobjlearningsequenceeditintrogui":
322 $which_page = LSOPageType::INTRO;
323 $which_tab = self::TAB_EDIT_INTRO;
324 $gui_class =
'ilObjLearningSequenceEditIntroGUI';
326 case "ilobjlearningsequenceeditextrogui":
328 if (!isset($which_page)) {
330 $which_tab = self::TAB_EDIT_EXTRO;
331 $gui_class =
'ilObjLearningSequenceEditExtroGUI';
337 if (!$this->
object->hasContentPage($which_page)) {
338 $this->
object->createContentPage($which_page);
341 $gui =
new $gui_class(
343 $this->object->getContentPageId()
345 $this->
ctrl->setCmd($cmd);
350 if (!is_null(
$out)) {
358 $cmd = self::CMD_CONTENT;
360 $cmd = self::CMD_VIEW;
365 case self::CMD_IMPORT:
369 case self::CMD_INFO_SCREEN:
373 case self::CMD_LEARNER_VIEW:
374 case self::CMD_CONTENT:
375 case self::CMD_MEMBERS:
376 case self::CMD_SETTINGS:
378 case self::CMD_CREATE:
379 case self::CMD_UNPARTICIPATE:
381 $this->tpl->setOnScreenMessage(
'info', sprintf(
382 $this->
lng->txt(
'msg_no_perm_read_item'),
383 $this->
object->getTitle()
389 case self::CMD_CANCEL:
394 case self::CMD_REMOVE_FROM_DESK:
398 case self::CMD_ADD_TO_DESK:
405 case self::CMD_CUT_SHOWTREE:
408 case self::CMD_CUT_CLIPBOARD:
414 case self::CMD_DELETE:
417 case self::CMD_DELETE_CONFIRMED:
420 case self::CMD_PERFORM_PASTE:
423 case self::CMD_SHOW_TRASH:
426 case self::CMD_UNDELETE:
430 case self::CMD_CANCEL_CUT:
431 case self::CMD_CANCEL_DELETE:
432 case self::CMD_CANCEL_LINK:
433 $cmd = self::CMD_CONTENT;
437 case self::CMD_REDRAW_HEADER:
442 case self::CMD_ENABLE_ADMINISTRATION_PANEL:
448 throw new ilException(
"ilObjLearningSequenceGUI: Invalid command '$cmd'");
452 throw new ilException(
"ilObjLearningSequenceGUI: Can't forward to next class $next_class");
462 if (strtolower($this->request_wrapper->retrieve(
"baseClass", $this->refinery->kindlyTo()->string())) === strtolower(self::class)) {
463 $tpl->printToStdOut();
469 $this->content_style->gui()->addCss(
479 $this->
access->checkAccess(
'read',
'', $this->ref_id)
481 $link = ilLink::_getLink($this->ref_id, $this->obj_type);
482 $this->navigation_history->addItem($this->ref_id, $link, $this->obj_type);
486 protected function info(
string $cmd = self::CMD_INFO): void
488 $this->
tabs->setTabActive(self::TAB_INFO);
489 $this->
ctrl->setCmdClass(
'ilinfoscreengui');
490 $this->
ctrl->setCmd($cmd);
492 $this->
ctrl->forwardCommand($info);
495 protected function permissions(
string $cmd = self::CMD_PERMISSIONS): void
497 $this->
tabs->setTabActive(self::TAB_PERMISSIONS);
499 $this->
ctrl->setCmd($cmd);
500 $this->
ctrl->forwardCommand($perm_gui);
503 protected function settings(
string $cmd = self::CMD_SETTINGS): void
505 $this->
tabs->activateTab(self::TAB_SETTINGS);
516 $this->
ctrl->setCmd($cmd);
520 protected function view(): void
523 $this->
tabs->clearSubTabs();
531 $this->
info(self::CMD_INFO);
537 $this->
tabs->activateTab(self::TAB_CONTENT_MAIN);
553 $this->
ctrl->setCmd($cmd);
557 protected function learnerView(
string $cmd = self::CMD_LEARNER_VIEW): void
560 $this->
tabs->activateTab(self::TAB_CONTENT_MAIN);
563 $gui = $this->
object->getLocalDI()[
"gui.learner"];
565 $this->
ctrl->setCmd($cmd);
571 $may_manage_members = $this->
checkAccess(
"edit_members");
572 $this->
ctrl->setCmdClass(
'ilLearningSequenceMembershipGUI');
573 if ($may_manage_members) {
582 $this->
tabs->setTabActive(self::TAB_MEMBERS);
592 $this->request_wrapper,
598 $this->
ctrl->setCmd($cmd);
599 $this->
ctrl->forwardCommand($ms_gui);
604 $this->
tabs->setTabActive(self::TAB_LP);
606 $for_user = $this->
user->getId();
608 if ($this->request_wrapper->has(
"user_id")) {
609 $for_user = $this->request_wrapper->retrieve(
"user_id", $this->
refinery->kindlyTo()->int());
617 $this->
ctrl->forwardCommand($lp_gui);
622 $this->
tabs->setTabActive(self::TAB_EXPORT);
624 $gui->addFormat(
"xml");
636 parent::createObject();
639 protected function save(): void
641 parent::saveObject();
647 $new_object->
getId(),
654 $participant->updateNotification(
655 $this->
user->getId(),
656 (bool) $this->
settings->get(
'mail_lso_admin_notification',
"1")
666 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'object_added'),
true);
667 $this->
ctrl->setParameter($this,
"ref_id", $new_object->
getRefId());
671 $this->
ctrl->getLinkTarget($this, self::CMD_SETTINGS,
"",
false,
false)
679 $usr_id = $this->
user->getId();
680 $this->
getObject()->getLSRoles()->leave($usr_id);
689 self::TAB_CONTENT_MAIN,
690 $this->
lng->txt(self::TAB_CONTENT_MAIN),
691 $this->
ctrl->getLinkTarget($this, self::CMD_VIEW,
"",
false,
false)
698 $this->
lng->txt(self::TAB_INFO),
706 $this->
lng->txt(self::TAB_SETTINGS),
714 $this->
getObject()->getLSSettings()->getMembersGallery()
716 $this->
getObject()->getLSRoles()->isMember($this->
user->getId())
721 $this->
lng->txt(self::TAB_MEMBERS),
722 $this->
ctrl->getLinkTarget($this, self::CMD_MEMBERS,
"",
false,
false)
730 $this->
lng->txt(self::TAB_LP),
731 $this->
ctrl->getLinkTargetByClass(array(
'ilobjlearningsequencegui',
'illearningprogressgui'),
'')
738 $this->
lng->txt(self::TAB_EXPORT),
739 $this->
ctrl->getLinkTargetByClass(
"ilexportgui",
"")
745 self::TAB_PERMISSIONS,
746 $this->
lng->txt(self::TAB_PERMISSIONS),
763 $this->
tabs->addSubTab(
764 self::TAB_VIEW_CONTENT,
765 $this->
lng->txt(self::TAB_VIEW_CONTENT),
770 $this->
tabs->addSubTab(
772 $this->
lng->txt(self::TAB_MANAGE),
776 $this->
tabs->addSubTab(
777 self::TAB_EDIT_INTRO,
778 $this->
lng->txt(
"lso_settings_intro"),
779 $this->
ctrl->getLinkTargetByClass(
780 strtolower(
'ilObjLearningSequenceEditIntroGUI'),
784 $this->
tabs->addSubTab(
785 self::TAB_EDIT_EXTRO,
786 $this->
lng->txt(
"lso_settings_extro"),
787 $this->
ctrl->getLinkTargetByClass(
788 strtolower(
'ilObjLearningSequenceEditExtroGUI'),
793 $this->
tabs->activateSubTab($active);
798 return $this->
access->checkAccess($which,
"", $this->ref_id);
817 strtolower(
'ilObjLearningSequenceGUI'),
820 return $this->
ctrl->getLinkTargetByClass($class_path, $cmd);
826 case self::CMD_CONTENT:
827 return 'ilObjLearningSequenceContentGUI';
828 case self::CMD_LEARNER_VIEW:
829 return 'ilObjLearningSequenceLearnerGUI';
830 case self::CMD_SETTINGS:
831 return 'ilObjLearningSequenceSettingsGUI';
833 return 'ilInfoScreenGUI';
834 case self::CMD_PERMISSIONS:
835 return 'ilPermissionGUI';
843 $link = chr(13) . chr(10) . chr(13) . chr(10);
844 $link .= $this->
lng->txt(
'lso_mail_permanent_link');
845 $link .= chr(13) . chr(10) . chr(13) . chr(10);
846 $link .= ilLink::_getLink($this->
object->getRefId());
848 return rawurlencode(base64_encode($link));
861 $local_roles = $this->
object->getLocalLearningSequenceRoles();
862 $lso_member = $this->
object->getDefaultMemberRole();
863 $lso_roles = array();
865 if (in_array($lso_member, $local_roles)) {
867 unset($local_roles[$lso_roles[$lso_member]]);
870 foreach ($local_roles as $title => $role_id) {
884 array_keys($this->obj_definition->getSubObjects(
'lso',
false)),
895 foreach ($a_data as $usr_id => $user_data) {
896 $res_data[$usr_id] = $user_data;
899 foreach ($udf_data->getAll() as $field => $value) {
900 list(, $field_id) = explode(
'_', $field);
901 $res_data[$usr_id][
'udf_' . $field_id] = (string) $value;
921 $this->tpl->setOnScreenMessage(
'info', sprintf(
922 $this->
lng->txt(
'msg_no_perm_read_item'),
923 $this->
object->getTitle()
925 $this->
ctrl->redirect($this, self::CMD_VIEW);
redrawHeaderActionObject()
Ajax call: redraw action header only.
renderObject()
Redirects to Manage Content to make deletion screen work.
static hasAccess(string $mode, int $id)
ILIAS Refinery Factory $refinery
const MAIL_ALLOWED_TUTORS
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
cancelCreation()
cancel create action and go back to repository parent
Psr Http Message ServerRequestInterface $request
GUI class for the workflow of copying objects.
denyAccessIfNotWritePermission()
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
const CMD_DELETE_CONFIRMED
static isAccessible(int $id)
trashObject()
Show trash content of object.
ilRbacReview $rbac_review
enableDragDropFileUpload()
static _gotoRepositoryNode(int $ref_id, string $cmd="")
const CMD_REMOVE_FROM_DESK
setParameterByClass(string $a_class, string $a_parameter, $a_value)
confirmedDeleteObject()
confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
deleteObject(bool $error=false)
Display deletion confirmation screen.
Data Factory $data_factory
const CMD_ENABLE_ADMINISTRATION_PANEL
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
add(int $a_usr_id, int $a_role)
static _lookupObjId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
importFileObject(int $parent_id=null)
static _isParticipant(int $a_ref_id, int $a_usr_id)
addCustomData(array $a_data)
Interface ilCtrlBaseClassInterface describes ilCtrl base classes.
Export User Interface Class.
static _enabledLearningProgress()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addSubTabsForContent(string $active)
const SORT_NEW_ITEMS_POSITION_BOTTOM
ilGlobalTemplateInterface $tpl
static _lookupTitle(int $obj_id)
setContent(string $a_html)
Sets content for standard template.
initDidacticTemplate(ilPropertyFormGUI $form)
undeleteObject()
Get objects back from trash.
ILIAS UI Renderer $ui_renderer
linkObject()
create an new reference of an object in tree it's like a hard link of unix
manage_members(string $cmd=self::CMD_MANAGE_MEMBERS)
ILIAS HTTP Wrapper RequestWrapper $request_wrapper
const SORT_NEW_ITEMS_ORDER_CREATION
afterSave(ilObject $new_object)
manageContent(string $cmd=self::CMD_CONTENT)
static _getTranslation(string $a_role_title)
ILIAS UI Factory $ui_factory
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
settings(string $cmd=self::CMD_SETTINGS)
static forwardByClass(string $base_class, array $classes, array $params, string $cmd='')
getLinkTarget(string $cmd)
learnerView(string $cmd=self::CMD_LEARNER_VIEW)
const CMD_MEMBERS_GALLERY
checkAccess(string $which)
getClassForTabs(string $cmd)
Last visited history for repository items.
static redirect(string $a_script)
ILIAS Style Content Service $content_style
recordLearningSequenceRead()
setPermanentLink(string $a_type, ?int $a_id, string $a_append="", string $a_target="", string $a_title="")
Generates and sets a permanent ilias link.
setTargetScript(string $a_target_script)
performPasteIntoMultipleObjectsObject()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _goto(string $target)
getReturnLocation(string $cmd, string $default_location="")
Get return location for command (command is method name without "Object", e.g.
const LP_CONTEXT_REPOSITORY
info(string $cmd=self::CMD_INFO)
ArrayBasedRequestWrapper $post_wrapper
cutObject()
cut object(s) out from a container and write the information to clipboard public ...
ilAppEventHandler $app_event_handler
ILIAS Container InternalGUIService $gui
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder...
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
Class ilObjLearningSequenceGUI ilObjLearningSequenceGUI: ilRepositoryGUI ilObjLearningSequenceGUI: ...
ilObjectService $obj_service
getAdditionalOKTypes()
append additional types to ilRepositoryExplorerGUI's positive list
permissions(string $cmd=self::CMD_PERMISSIONS)
ilObjLearningSequence $ls_object
static _lookupType(int $id, bool $reference=false)
addHeaderAction()
Add header action menu.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
keepObjectsInClipboardObject()
GUI class for learning sequence membership features.
ilNavigationHistory $navigation_history
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...