3 declare(strict_types=1);
89 public static function _goto(
string $target)
93 $request = $DIC->http()->request();
94 $lng = $DIC->language();
97 $targetParameters = explode(
'_', $target);
98 $id = (int) $targetParameters[0];
100 if (!self::isAccessible($id)) {
101 $err->raiseError(
$lng->txt(
'msg_no_perm_read'), $err->FATAL);
104 if (self::hasAccess(self::ACCESS_READ, $id)) {
105 $params = [
'ref_id' => $id];
107 if (isset($request->getQueryParams()[
'gotolp'])) {
108 $params[
'gotolp'] = 1;
111 self::forwardByClass(
112 ilRepositoryGUI::class,
113 [ilRepositoryGUI::class, ilObjLearningSequenceGUI::class],
119 if (self::hasAccess(self::ACCESS_VISIBLE, $id)) {
123 if (self::hasAccess(self::ACCESS_READ, ROOT_FOLDER_ID)) {
125 $lng->txt(
'msg_no_perm_read_item'),
129 self::forwardByClass(ilRepositoryGUI::class, [ilRepositoryGUI::class], [
'ref_id' => ROOT_FOLDER_ID]);
136 self::hasAccess(self::ACCESS_READ, $id) ||
137 self::hasAccess(self::ACCESS_VISIBLE, $id) ||
138 self::hasAccess(self::ACCESS_READ, ROOT_FOLDER_ID)
142 protected static function hasAccess(
string $mode,
int $id) : bool
145 return $DIC->access()->checkAccess($mode,
'', $id);
148 protected static function forwardByClass(
string $base_class, array $classes, array $params,
string $cmd =
'')
151 $ctrl = $DIC->ctrl();
152 $target_class = end($classes);
154 $ctrl->setTargetScript(
'ilias.php');
155 $ctrl->initBaseClass($base_class);
157 foreach ($params as $key => $value) {
158 $ctrl->setParameterByClass($target_class, $key, $value);
161 $ctrl->redirectByClass($classes, $cmd);
166 $this->ref_id = (int)
$_GET[
'ref_id'];
172 $this->ctrl = $DIC[
'ilCtrl'];
173 $this->lng = $DIC[
'lng'];
174 $this->
user = $DIC[
'ilUser'];
175 $this->tabs = $DIC[
'ilTabs'];
176 $this->toolbar = $DIC[
'ilToolbar'];
177 $this->
help = $DIC[
'ilHelp'];
178 $this->
settings = $DIC[
'ilSetting'];
179 $this->access = $DIC[
'ilAccess'];
180 $this->rbac_review = $DIC[
'rbacreview'];
181 $this->ui_factory = $DIC[
'ui.factory'];
182 $this->ui_renderer = $DIC[
'ui.renderer'];
184 $this->log = $DIC[
"ilLoggerFactory"]->getRootLogger();
185 $this->app_event_handler = $DIC[
'ilAppEventHandler'];
186 $this->navigation_history = $DIC[
'ilNavigationHistory'];
187 $this->obj_definition = $DIC[
'objDefinition'];
188 $this->tpl = $DIC[
"tpl"];
189 $this->obj_service = $DIC->object();
190 $this->toolbar = $DIC[
'ilToolbar'];
192 $this->
help->setScreenIdComponent($this->obj_type);
193 $this->lng->loadLanguageModule($this->obj_type);
196 $this->data_factory = new \ILIAS\Data\Factory();
202 $this->object->getType(),
203 $this->
object->getRefId(),
204 $this->
object->getId(),
211 $next_class = $this->ctrl->getNextClass($this);
212 $cmd = $this->ctrl->getCmd();
215 parent::prepareOutput();
222 $next_class ===
'ilobjlearningsequencelearnergui' 226 $tpl->setPermanentLink(
"lso", $this->ref_id);
228 switch ($next_class) {
229 case "ilcommonactiondispatchergui":
231 $this->ctrl->forwardCommand($gui);
233 case "ilinfoscreengui":
236 case "ilpermissiongui":
239 case "ilobjlearningsequencesettingsgui":
242 case "ilobjlearningsequencecontentgui":
245 case "ilobjlearningsequencelearnergui":
248 case "illearningsequencemembershipgui":
251 case 'ilmailmembersearchgui':
254 case 'illearningprogressgui':
260 case 'ilobjectcopygui':
263 $this->ctrl->forwardCommand($cp);
265 case 'ilobjindividualassessmentgui':
266 $struct = [
'ilrepositorygui',
'ilobjindividualassessmentgui'];
267 if ($cmd ===
'edit') {
268 $struct[] =
'ilindividualassessmentsettingsgui';
270 $this->ctrl->redirectByClass($struct, $cmd);
273 $struct = [
'ilrepositorygui',
'ilobjtestgui'];
274 $this->ctrl->redirectByClass($struct, $cmd);
279 $cmd = self::CMD_VIEW;
283 case self::CMD_IMPORT:
287 case self::CMD_INFO_SCREEN:
291 case self::CMD_LEARNER_VIEW:
292 case self::CMD_CONTENT:
293 case self::CMD_MEMBERS:
294 case self::CMD_SETTINGS:
296 case self::CMD_CREATE:
298 case self::CMD_UNPARTICIPATE:
301 case self::CMD_CANCEL:
306 case self::CMD_REMOVE_FROM_DESK:
310 case self::CMD_ADD_TO_DESK:
317 case self::CMD_CUT_SHOWTREE:
320 case self::CMD_CUT_CLIPBOARD:
326 case self::CMD_DELETE:
329 case self::CMD_DELETE_CONFIRMED:
332 case self::CMD_PERFORM_PASTE:
335 case self::CMD_SHOW_TRASH:
338 case self::CMD_UNDELETE:
342 case self::CMD_CANCEL_CUT:
343 case self::CMD_CANCEL_DELETE:
344 case self::CMD_CANCEL_LINK:
345 $cmd = self::CMD_CONTENT;
350 throw new ilException(
"ilObjLearningSequenceGUI: Invalid command '$cmd'");
354 throw new ilException(
"ilObjLearningSequenceGUI: Can't forward to next class $next_class");
366 $this->access->checkAccess(
'read',
'', $this->ref_id)
369 $this->navigation_history->addItem($this->ref_id, $link, $this->obj_type);
373 protected function info(
string $cmd = self::CMD_INFO)
375 $this->tabs->setTabActive(self::TAB_INFO);
376 $this->ctrl->setCmdClass(
'ilinfoscreengui');
377 $this->ctrl->setCmd($cmd);
379 $this->ctrl->forwardCommand($info);
382 protected function permissions(
string $cmd = self::CMD_PERMISSIONS)
384 $this->tabs->setTabActive(self::TAB_PERMISSIONS);
386 $this->ctrl->setCmd($cmd);
387 $this->ctrl->forwardCommand($perm_gui);
390 protected function settings(
string $cmd = self::CMD_SETTINGS)
392 $this->tabs->activateTab(self::TAB_SETTINGS);
400 $this->ctrl->setCmd($cmd);
401 $this->ctrl->forwardCommand($gui);
406 $this->tabs->clearSubTabs();
416 $this->
info(self::CMD_INFO);
422 $this->tabs->activateTab(self::TAB_CONTENT_MAIN);
424 $this->tabs->activateSubTab(self::TAB_MANAGE);
435 $this->ctrl->setCmd($cmd);
436 $this->ctrl->forwardCommand($gui);
439 protected function learnerView(
string $cmd = self::CMD_LEARNER_VIEW)
441 $this->tabs->activateTab(self::TAB_CONTENT_MAIN);
443 $this->tabs->activateSubTab(self::TAB_VIEW_CONTENT);
445 $gui = $this->
object->getLocalDI()[
"gui.learner"];
447 $this->ctrl->setCmd($cmd);
448 $this->ctrl->forwardCommand($gui);
453 $may_manage_members = $this->
checkAccess(
"edit_members");
454 $this->ctrl->setCmdClass(
'ilLearningSequenceMembershipGUI');
455 if ($may_manage_members) {
464 $this->tabs->setTabActive(self::TAB_MEMBERS);
479 $this->ctrl->setCmd($cmd);
480 $this->ctrl->forwardCommand($ms_gui);
485 $this->tabs->setTabActive(self::TAB_LP);
487 $for_user = $this->
user->getId();
489 if (
$_GET[
'user_id']) {
490 $for_user =
$_GET[
'user_id'];
499 if ($cmd === self::CMD_LP) {
503 $this->ctrl->setCmd($cmd);
504 $this->ctrl->forwardCommand($lp_gui);
509 $this->tabs->setTabActive(self::TAB_EXPORT);
511 $gui->addFormat(
"xml");
513 $this->ctrl->forwardCommand($gui);
523 parent::createObject();
528 parent::saveObject();
534 (
int) $new_object->
getId(),
541 $participant->updateNotification($this->
user->getId(), $this->
settings->get(
'mail_lso_admin_notification',
true));
544 $settings = new \ilContainerSortingSettings($new_object->
getId());
551 ilUtil::sendSuccess($this->lng->txt(
'object_added'),
true);
552 $this->ctrl->setParameter($this,
"ref_id", $new_object->
getRefId());
556 $this->ctrl->getLinkTarget($this, self::CMD_SETTINGS,
"",
false,
false)
564 $usr_id = (int) $this->
user->getId();
565 $this->
getObject()->getLSRoles()->leave($usr_id);
572 $this->ls_object->leave($usr_id);
579 self::TAB_CONTENT_MAIN,
580 $this->lng->txt(self::TAB_CONTENT_MAIN),
581 $this->ctrl->getLinkTarget($this, self::CMD_VIEW,
"",
false,
false)
588 $this->lng->txt(self::TAB_INFO),
596 $this->lng->txt(self::TAB_SETTINGS),
604 $this->
getObject()->getLSSettings()->getMembersGallery()
606 $this->
getObject()->getLSRoles()->isMember((
int) $this->
user->getId())
611 $this->lng->txt(self::TAB_MEMBERS),
612 $this->ctrl->getLinkTarget($this, self::CMD_MEMBERS,
"",
false,
false)
620 $this->lng->txt(self::TAB_LP),
628 $this->lng->txt(self::TAB_EXPORT),
629 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
635 self::TAB_PERMISSIONS,
636 $this->lng->txt(self::TAB_PERMISSIONS),
649 $this->tabs->addSubTab(
650 self::TAB_VIEW_CONTENT,
651 $this->lng->txt(self::TAB_VIEW_CONTENT),
656 $this->tabs->addSubTab(
658 $this->lng->txt(self::TAB_MANAGE),
666 return $this->access->checkAccess($which,
"", $this->ref_id);
675 $may_edit_lp_settings = $this->
checkAccess(
'edit_learning_progress');
677 return ($lp_access || $may_edit_lp_settings);
684 strtolower(
'ilObjLearningSequenceGUI'),
687 return $this->ctrl->getLinkTargetByClass($class_path, $cmd);
693 case self::CMD_CONTENT:
694 return 'ilObjLearningSequenceContentGUI';
695 case self::CMD_LEARNER_VIEW:
696 return 'ilObjLearningSequenceLearnerGUI';
697 case self::CMD_SETTINGS:
698 return 'ilObjLearningSequenceSettingsGUI';
700 return 'ilInfoScreenGUI';
701 case self::CMD_PERMISSIONS:
702 return 'ilPermissionGUI';
704 return 'ilLearningProgressGUI';
712 $link = chr(13) . chr(10) . chr(13) . chr(10);
713 $link .= $this->lng->txt(
'lso_mail_permanent_link');
714 $link .= chr(13) . chr(10) . chr(13) . chr(10);
717 return rawurlencode(base64_encode($link));
722 if ($this->
object === null) {
739 $local_roles = $this->
object->getLocalLearningSequenceRoles(
false);
740 $lso_member = $this->
object->getDefaultMemberRole();
741 $lso_roles = array();
743 if (in_array($lso_member, $local_roles)) {
745 unset($local_roles[$lso_roles[$lso_member]]);
748 foreach ($local_roles as $title => $role_id) {
760 $types = array_filter(
761 array_keys($this->obj_definition->getSubObjects(
'lso',
false)),
763 return $type !==
'rolf';
773 foreach ($a_data as $usr_id => $user_data) {
774 $res_data[$usr_id] = $user_data;
777 foreach ($udf_data->getAll() as $field => $value) {
778 list(
$f, $field_id) = explode(
'_', $field);
779 $res_data[$usr_id][
'udf_' . $field_id] = (string) $value;
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
static hasAccess(string $mode, int $id)
const MAIL_ALLOWED_TUTORS
cancelCreation()
cancel create action and go back to repository parent
GUI class for the workflow of copying objects.
static _isParticipant($ref_id, $usr_id)
const CMD_DELETE_CONFIRMED
static isAccessible(int $id)
trashObject()
Show trash content of object.
const CMD_REMOVE_FROM_DESK
learningProgress(string $cmd=self::CMD_LP)
static _lookupTitle($a_id)
lookup object title
confirmedDeleteObject()
confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
Class ilObjLearningSequenceSettingsGUI.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Export User Interface Class.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
static _enabledLearningProgress()
check wether learing progress is enabled or not
const SORT_NEW_ITEMS_POSITION_BOTTOM
initDidacticTemplate(ilPropertyFormGUI $form)
undeleteObject()
Get objects back from trash.
getId()
get object id public
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
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)
const SORT_NEW_ITEMS_ORDER_CREATION
afterSave(ilObject $new_object)
manageContent(string $cmd=self::CMD_CONTENT)
static _lookupObjId($a_id)
static getInstanceByRefId(int $ref_id)
settings(string $cmd=self::CMD_SETTINGS)
static forwardByClass(string $base_class, array $classes, array $params, string $cmd='')
Class ilObjLearningSequenceContentGUI.
showPasteTreeObject()
Show paste tree.
importFileObject($parent_id=null, $a_catch_errors=true)
Import.
getAdditionalWhitelistTypes()
append additional types to ilRepositoryExplorerGUI's whitelist
getLinkTarget(string $cmd)
learnerView(string $cmd=self::CMD_LEARNER_VIEW)
const CMD_MEMBERS_GALLERY
removeMember(int $usr_id)
getClassForTabs(string $cmd)
static _getTranslation($a_role_title)
removeFromDeskObject()
Remove from desktop public.
recordLearningSequenceRead()
performPasteIntoMultipleObjectsObject()
static _goto(string $target)
__construct(Container $dic, ilPlugin $plugin)
const LP_CONTEXT_REPOSITORY
info(string $cmd=self::CMD_INFO)
addToDeskObject()
Add desktop item public.
getCreationMode()
get creation mode
cutObject()
cut object(s) out from a container and write the information to clipboard
getRefId()
get reference id public
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
deleteObject($a_error=false)
Display deletion confirmation screen.
Class ilObjLearningSequenceGUI.
static _getInstance()
Get instance of ilPrivacySettings.
permissions(string $cmd=self::CMD_PERMISSIONS)
static redirect($a_script)
addHeaderAction()
Add header action menu.
Class ilObjUserTrackingGUI.
getReturnLocation($a_cmd, $a_location="")
get return location for command (command is method name without "Object", e.g.
keepObjectsInClipboardObject()
Keep objects in the clipboard.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
GUI class for learning sequence membership features.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Confirmation screen class.