19declare(strict_types=1);
99 public const TAB_LP =
"learning_progress";
123 protected Psr\Http\Message\ServerRequestInterface
$request;
126 public static function _goto(
string $target): void
129 $main_tpl =
$DIC->ui()->mainTemplate();
133 $err =
$DIC[
'ilErr'];
135 $targetParameters = explode(
'_', $target);
136 $id = (
int) $targetParameters[0];
138 if (!self::isAccessible(
$id)) {
139 $err->raiseError(
$lng->
txt(
'msg_no_perm_read'), $err->FATAL);
142 if (self::hasAccess(self::ACCESS_READ,
$id)) {
145 if (isset(
$request->getQueryParams()[
'gotolp'])) {
150 ilRepositoryGUI::class,
151 [ilObjLearningSequenceGUI::class],
156 if (self::hasAccess(self::ACCESS_VISIBLE,
$id)) {
161 $main_tpl->setOnScreenMessage(
'info', sprintf(
162 $lng->
txt(
'msg_no_perm_read_item'),
182 return $DIC->access()->checkAccess($mode,
'',
$id);
189 $target_class = end($classes);
192 foreach (
$params as $key => $value) {
197 array_splice($classes, 0, 0, $base_class);
206 $this->
ctrl = $DIC[
'ilCtrl'];
207 $this->
lng = $DIC[
'lng'];
208 $this->
user = $DIC[
'ilUser'];
209 $this->
profile = $DIC[
'user']->getProfile();
210 $this->
tabs = $DIC[
'ilTabs'];
211 $this->
toolbar = $DIC[
'ilToolbar'];
212 $this->
help = $DIC[
'ilHelp'];
213 $this->
settings = $DIC[
'ilSetting'];
214 $this->
access = $DIC[
'ilAccess'];
215 $this->rbac_review =
$DIC[
'rbacreview'];
216 $this->ui_factory =
$DIC[
'ui.factory'];
217 $this->ui_renderer =
$DIC[
'ui.renderer'];
218 $this->request =
$DIC->http()->request();
220 $this->log =
$DIC[
"ilLoggerFactory"]->getRootLogger();
221 $this->app_event_handler =
$DIC[
'ilAppEventHandler'];
222 $this->navigation_history =
$DIC[
'ilNavigationHistory'];
223 $this->obj_definition =
$DIC[
'objDefinition'];
224 $this->tpl =
$DIC[
"tpl"];
225 $this->obj_service =
$DIC->object();
226 $this->
toolbar = $DIC[
'ilToolbar'];
227 $this->request_wrapper =
$DIC->http()->wrapper()->query();
228 $this->post_wrapper =
$DIC->http()->wrapper()->post();
230 $this->content_style =
$DIC->contentStyle();
232 $this->
help->setScreenIdComponent($this->type);
233 $this->
lng->loadLanguageModule($this->type);
235 $this->data_factory =
new Data\Factory();
237 $this->ref_id = $this->request_wrapper->retrieve(
"ref_id", $this->
refinery->kindlyTo()->int());
245 $this->object->getRefId(),
246 $this->object->getId(),
253 $next_class = $this->
ctrl->getNextClass($this);
254 $cmd = $this->
ctrl->getCmd();
257 parent::prepareOutput();
264 $next_class ===
'ilobjlearningsequencelearnergui'
270 switch ($next_class) {
271 case "ilcommonactiondispatchergui":
275 case "ilinfoscreengui":
276 $this->
tabs->setTabActive(self::TAB_INFO);
279 case "ilpermissiongui":
280 $this->
tabs->setTabActive(self::TAB_PERMISSIONS);
283 case "ilobjlearningsequencesettingsgui":
285 if (!$this->
checkAccess(
"write",
'', $this->ref_id)) {
286 $this->tpl->setOnScreenMessage(
'failure', sprintf(
287 $this->
lng->txt(
'msg_no_perm_read_item'),
288 $this->object->getTitle()
291 $this->
ctrl->redirect($this,
'view');
294 $this->
tabs->activateTab(self::TAB_SETTINGS);
297 case "ilobjlearningsequencecontentgui":
299 if (!$this->
checkAccess(
"read",
'', $this->ref_id)) {
300 $this->tpl->setOnScreenMessage(
'failure', sprintf(
301 $this->
lng->txt(
'msg_no_perm_read_item'),
302 $this->object->getTitle()
305 $this->
ctrl->redirect($this,
'view');
309 $this->
tabs->activateTab(self::TAB_CONTENT_MAIN);
313 case "ilobjlearningsequencelearnergui":
315 $this->
tabs->activateTab(self::TAB_CONTENT_MAIN);
319 case "illearningsequencemembershipgui":
320 $this->
tabs->setTabActive(self::TAB_MEMBERS);
323 case 'illearningprogressgui':
324 $this->
tabs->setTabActive(self::TAB_LP);
329 $gui->addFormat(
"xml");
330 $this->
tabs->setTabActive(self::TAB_EXPORT);
333 case 'ilobjectcopygui':
335 $gui->setType(
'lso');
338 case 'ilobjindividualassessmentgui':
339 $struct = [
'ilrepositorygui',
'ilobjindividualassessmentgui'];
340 if ($cmd ===
'edit') {
341 $struct[] =
'ilindividualassessmentsettingsgui';
343 $this->
ctrl->redirectByClass($struct, $cmd);
346 $struct = [
'ilrepositorygui',
'ilobjtestgui'];
347 $this->
ctrl->redirectByClass($struct, $cmd);
349 case 'ilobjlearningsequencelppollinggui':
350 $gui = $this->
object->getLocalDI()[
"gui.learner.lp"];
353 case "ilobjlearningsequenceeditintrogui":
354 $which_page = LSOPageType::INTRO;
356 $gui_class =
'ilObjLearningSequenceEditIntroGUI';
358 case "ilobjlearningsequenceeditextrogui":
359 if (!isset($which_page)) {
362 $gui_class =
'ilObjLearningSequenceEditExtroGUI';
368 if (!$this->
object->hasContentPage($which_page)) {
369 $this->
object->createContentPage($which_page);
372 $gui =
new $gui_class(
374 $this->object->getContentPageId()
380 if (!is_null(
$out)) {
404 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
'showSummary');
407 $this->
ctrl->redirectByClass(ilObjLearningSequenceSettingsGUI::class, $cmd);
410 $this->
ctrl->redirectByClass(ilObjLearningSequenceContentGUI::class, $cmd);
414 $this->
ctrl->redirectByClass(ilLearningSequenceMembershipGUI::class, $cmd);
478 $this->manageContent();
482 throw new ilException(
"ilObjLearningSequenceGUI: Invalid command '$cmd'");
486 throw new ilException(
"ilObjLearningSequenceGUI: Can't forward to next class $next_class");
496 if (strtolower($this->request_wrapper->retrieve(
"baseClass", $this->refinery->kindlyTo()->string())) === strtolower(self::class)) {
497 $tpl->printToStdOut();
503 $this->content_style->gui()->addCss(
513 $this->
access->checkAccess(
'read',
'', $this->ref_id)
515 $link = ilLink::_getLink($this->ref_id, $this->type);
516 $this->navigation_history->addItem($this->ref_id, $link, $this->type);
544 protected function view(): void
547 $this->
tabs->clearSubTabs();
552 $this->
ctrl->redirectByClass(ilObjLearningSequenceContentGUI::class, $cmd);
555 $this->
ctrl->redirectByClass(ilObjLearningSequenceLearnerGUI::class, $cmd);
578 return $this->
object->getLocalDI()[
"gui.learner"];
591 $this->request_wrapper,
600 $for_user = $this->
user->getId();
601 if ($this->request_wrapper->has(
"user_id")) {
602 $for_user = $this->request_wrapper->retrieve(
"user_id", $this->
refinery->kindlyTo()->int());
618 parent::createObject();
621 protected function save(): void
623 parent::saveObject();
629 $new_object->
getId(),
631 $this->app_event_handler,
636 $participant->updateNotification(
637 $this->
user->getId(),
638 (
bool) $this->settings->get(
'mail_lso_admin_notification',
"1")
648 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'object_added'),
true);
649 $this->
ctrl->setParameter($this,
"ref_id", $new_object->
getRefId());
653 $this->
ctrl->getLinkTarget($this, self::CMD_SETTINGS,
"",
false,
false)
661 $usr_id = $this->
user->getId();
662 $this->
getObject()->getLSRoles()->leave($usr_id);
664 $this->
ctrl->redirectByClass(
'ilObjLearningSequenceLearnerGUI', self::CMD_LEARNER_VIEW);
672 self::TAB_CONTENT_MAIN,
673 $this->
lng->txt(self::TAB_CONTENT_MAIN),
674 $this->ctrl->getLinkTarget($this, $cmd,
"",
false,
false)
681 $this->
lng->txt(self::TAB_INFO),
682 $this->getLinkTarget(self::CMD_INFO)
689 $this->
lng->txt(self::TAB_SETTINGS),
690 $this->getLinkTarget(self::CMD_SETTINGS)
699 $this->
getObject()->getLSSettings()->getMembersGallery()
700 && $this->
getObject()->getLSRoles()->isMember($this->
user->getId())
708 $this->
lng->txt(self::TAB_MEMBERS),
709 $this->ctrl->getLinkTarget($this, $cmd,
"",
false,
false)
717 $this->
lng->txt(self::TAB_LP),
718 $this->ctrl->getLinkTargetByClass(array(
'ilobjlearningsequencegui',
'illearningprogressgui'),
'')
725 $this->
lng->txt(self::TAB_EXPORT),
726 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
732 self::TAB_PERMISSIONS,
733 $this->
lng->txt(self::TAB_PERMISSIONS),
734 $this->getLinkTarget(self::CMD_PERMISSIONS)
741 $this->
tabs->addSubTab(
742 self::TAB_VIEW_CONTENT,
743 $this->
lng->txt(self::TAB_VIEW_CONTENT),
744 $this->getLinkTarget(self::CMD_LEARNER_VIEW)
748 $this->
tabs->addSubTab(
750 $this->
lng->txt(self::TAB_MANAGE),
751 $this->getLinkTarget(self::CMD_CONTENT)
754 $this->
tabs->addSubTab(
755 self::TAB_EDIT_INTRO,
756 $this->
lng->txt(
"lso_settings_intro"),
757 $this->ctrl->getLinkTargetByClass(
758 strtolower(
'ilObjLearningSequenceEditIntroGUI'),
762 $this->
tabs->addSubTab(
763 self::TAB_EDIT_EXTRO,
764 $this->
lng->txt(
"lso_settings_extro"),
765 $this->ctrl->getLinkTargetByClass(
766 strtolower(
'ilObjLearningSequenceEditExtroGUI'),
771 $this->
tabs->activateSubTab($active);
776 return $this->
access->checkAccess($which,
"", $this->ref_id);
795 strtolower(
'ilObjLearningSequenceGUI'),
798 return $this->
ctrl->getLinkTargetByClass($class_path, $cmd);
805 return 'ilObjLearningSequenceContentGUI';
807 return 'ilObjLearningSequenceLearnerGUI';
809 return 'ilObjLearningSequenceSettingsGUI';
811 return 'ilInfoScreenGUI';
813 return 'ilPermissionGUI';
816 throw new InvalidArgumentException(
'cannot resolve class for command: ' . $cmd);
821 $link = chr(13) . chr(10) . chr(13) . chr(10);
822 $link .= $this->
lng->txt(
'lso_mail_permanent_link');
823 $link .= chr(13) . chr(10) . chr(13) . chr(10);
824 $link .= ilLink::_getLink($this->
object->getRefId());
826 return rawurlencode(base64_encode($link));
839 $local_roles = $this->
object->getLocalLearningSequenceRoles();
840 $lso_member = $this->
object->getDefaultMemberRole();
841 $lso_roles = array();
843 if (in_array($lso_member, $local_roles)) {
845 unset($local_roles[$lso_roles[$lso_member]]);
848 foreach ($local_roles as $title => $role_id) {
862 array_keys($this->obj_definition->getSubObjects(
'lso',
false)),
872 $udfs = $this->
profile->getAllUserDefinedFields();
874 $this->
profile->getDataForMultiple(array_keys($a_data)),
875 function (array
$c, ProfileData $v) use ($a_data, $udfs): array {
876 $c[$v->getId()] = $a_data[$v->getId()];
877 foreach ($udfs as $field) {
878 $field_id = $field->getIdentifier();
879 $c[$v->getId()][
'udf_' . $field_id] = (
string) $v->getAdditionalFieldByIdentifier($field_id);
888 $this->
ctrl->setParameterByClass(ilRepositoryGUI::class,
'ref_id', $this->ref_id);
892 ilRepositoryGUI::class,
897 $this->
ctrl->clearParametersByClass(ilRepositoryGUI::class);
Builds a Color from either hex- or rgb values.
Class ArrayBasedRequestWrapper.
Render add new item selector.
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)
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...
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder,...
ILIAS Container InternalGUIService $gui
trashObject()
Show trash content of object.
cutObject()
cut object(s) out from a container and write the information to clipboard @access public
performPasteIntoMultipleObjectsObject()
undeleteObject()
Get objects back from trash.
linkObject()
create an new reference of an object in tree it's like a hard link of unix
keepObjectsInClipboardObject()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const SORT_NEW_ITEMS_ORDER_CREATION
const SORT_NEW_ITEMS_POSITION_BOTTOM
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
setTargetScript(string $a_target_script)
@inheritDoc
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
Base class for ILIAS Exception handling.
Export User Interface Class.
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...
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
const LP_CONTEXT_REPOSITORY
Class ilObjUserTrackingGUI.
GUI class for learning sequence membership features.
static _isParticipant(int $a_ref_id, int $a_usr_id)
Static function to check if a user is a participant of the container object.
Last visited history for repository items.
Class ilObjLearningSequenceGUI @ilCtrl_isCalledBy ilObjLearningSequenceGUI: ilRepositoryGUI @ilCtrl_i...
addCustomData(array $a_data)
ILIAS Style Content Service $content_style
const CMD_ENABLE_ADMINISTRATION_PANEL
enableDragDropFileUpload()
Enables the file upload into this object by dropping files.
showPossibleSubObjects()
show possible sub objects (pull down menu)
recordLearningSequenceRead()
getAdditionalOKTypes()
append additional types to ilRepositoryExplorerGUI's positive list
checkAccess(string $which)
getTabs()
@abstract overwrite in derived GUI class of your object type
addSubTabsForContent(string $active)
ILIAS UI Factory $ui_factory
static _goto(string $target)
const CMD_MEMBERS_GALLERY
afterSave(ilObject $new_object)
Post (successful) object creation hook.
Data Factory $data_factory
ilNavigationHistory $navigation_history
ilObjectService $obj_service
ilRbacReview $rbac_review
Psr Http Message ServerRequestInterface $request
const CMD_DELETE_CONFIRMED
static hasAccess(string $mode, int $id)
ILIAS Refinery Factory $refinery
ILIAS HTTP Wrapper RequestWrapper $request_wrapper
ILIAS UI Renderer $ui_renderer
const MAIL_ALLOWED_TUTORS
initDidacticTemplate(ilPropertyFormGUI $form)
getLinkTarget(string $cmd)
ArrayBasedRequestWrapper $post_wrapper
static isAccessible(int $id)
static forwardByClass(string $base_class, array $classes, array $params, string $cmd='')
const CMD_REMOVE_FROM_DESK
getClassForTabs(string $cmd)
static _getTranslation(string $a_role_title)
static _enabledLearningProgress()
GUI class for the workflow of copying objects.
confirmedDeleteObject()
confirmed deletion of object -> objects are moved to trash or deleted immediately,...
buildAddNewItemElements(array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
cancelCreation()
cancel create action and go back to repository parent
ilGlobalTemplateInterface $tpl
deleteObject(bool $error=false)
Display deletion confirmation screen.
getCreatableObjectTypes()
addHeaderAction()
Add header action menu.
static _gotoRepositoryNode(int $ref_id, string $cmd="")
getReturnLocation(string $cmd, string $default_location="")
Get return location for command (command is method name without "Object", e.g.
redrawHeaderActionObject()
Ajax call: redraw action header only.
Class ilObject Basic functions for all objects.
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
class ilRbacReview Contains Review functions of core Rbac.
static redirect(string $a_script)
Interface RequestWrapper.
setPermanentLink(string $a_type, ?int $a_id, string $a_append="", string $a_target="", string $a_title="")
Generates and sets a permanent ilias link.
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.
setContent(string $a_html)
Sets content for standard template.
An entity that renders components to a string output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc