ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ilGuidedTourAdminGUI Class Reference

@ilCtrl_Calls ilGuidedTourAdminGUI: ilGuidedTourPageGUI, ilExportGUI, ilRepoStandardUploadHandlerGUI More...

+ Collaboration diagram for ilGuidedTourAdminGUI:

Public Member Functions

 __construct (protected \ILIAS\Help\GuidedTour\InternalDataService $data, protected \ILIAS\Help\GuidedTour\InternalDomainService $domain, protected \ILIAS\Help\GuidedTour\InternalGUIService $gui)
 
 executeCommand ()
 
 forwardToPageObject ()
 
 saveTour ()
 
 saveSettings ()
 
 saveStep ()
 
 editStep (int $step_id)
 
 editPage (int $step_id)
 
 confirmStepDeletion (int $step_id)
 
 deleteStep ()
 

Protected Member Functions

 setSettingsTabs (string $active)
 
 listTours ()
 
 getResetTourModal (int $tour_id)
 
 resetTour ()
 
 getDeleteTourModal (int $tour_id)
 
 deleteTour ()
 
 getCreateForm ()
 
 addTour ()
 
 editSettings ()
 
 getSettingsForm ()
 
 setStepsHeader ()
 
 setSingleStepHeader ()
 
 listSteps ()
 
 getStepTable ()
 
 addStep ()
 
 getStepForm (?Step $step=null)
 
 setSubTabs (string $active)
 
 idSettings ()
 
 getIdForm ()
 
 saveIdSettings ()
 
 saveOrder ()
 
 importTourForm ()
 
 getImportForm ()
 
 handleImportUpload (FileUpload $upload, UploadResult $result)
 
 importTourFile (string $filename, string $path)
 
 importTour ()
 

Protected Attributes

ILIAS Help GuidedTour UserFinished UserFinishedManager $finish_manager
 
ILIAS Help GuidedTour Tour TourManager $tm
 

Private Attributes

ILIAS Help GuidedTour Step StepManager $step_manager
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilGuidedTourAdminGUI::__construct ( protected \ILIAS\Help\GuidedTour\InternalDataService  $data,
protected \ILIAS\Help\GuidedTour\InternalDomainService  $domain,
protected \ILIAS\Help\GuidedTour\InternalGUIService  $gui 
)

Definition at line 38 of file class.ilGuidedTourAdminGUI.php.

42 {
43 $ctrl = $this->gui->ctrl();
44 $this->tm = $domain->tour();
45 $ctrl->saveParameterByClass(self::class, "tour_id");
46 $this->step_manager = $domain->step();
47 $this->finish_manager = $domain->userFinished();
48 }

Member Function Documentation

◆ addStep()

ilGuidedTourAdminGUI::addStep ( )
protected

Definition at line 506 of file class.ilGuidedTourAdminGUI.php.

506 : void
507 {
508 $this->setSingleStepHeader();
509 $mt = $this->gui->ui()->mainTemplate();
510 $lng = $this->domain->lng();
511 $mt->setOnScreenMessage("info", $lng->txt("gdtr_edit_step_info"));
512 $mt->setContent($this->getStepForm()->render());
513 }
global $lng
Definition: privfeed.php:31

References $lng, getStepForm(), and setSingleStepHeader().

+ Here is the call graph for this function:

◆ addTour()

ilGuidedTourAdminGUI::addTour ( )
protected

Definition at line 329 of file class.ilGuidedTourAdminGUI.php.

329 : void
330 {
331 $mt = $this->gui->ui()->mainTemplate();
332 $mt->setContent($this->getCreateForm()->render());
333 }

References getCreateForm().

+ Here is the call graph for this function:

◆ confirmStepDeletion()

ilGuidedTourAdminGUI::confirmStepDeletion ( int  $step_id)

Definition at line 673 of file class.ilGuidedTourAdminGUI.php.

673 : void
674 {
675 $lng = $this->domain->lng();
676 $ctrl = $this->gui->ctrl();
677 $table = $this->getStepTable();
678 $step = $this->step_manager->getById($step_id);
679 $ctrl->setParameterByClass(self::class, "step_id", $step_id);
680 $title = $this->step_manager->getStepName($step->getType());
681 if ($step->getElementId() !== "") {
682 $title .= " (" . $step->getElementId() . ")";
683 }
684 $table->renderDeletionConfirmation(
685 $lng->txt("gdtr_delete_step"),
686 $lng->txt("gdtr_delete_step_mess"),
687 "deleteStep",
688 [
689 $step_id => $title
690 ]
691 );
692 }

References $lng, and getStepTable().

+ Here is the call graph for this function:

◆ deleteStep()

ilGuidedTourAdminGUI::deleteStep ( )

Definition at line 694 of file class.ilGuidedTourAdminGUI.php.

694 : void
695 {
696 $ctrl = $this->gui->ctrl();
697 $mt = $this->gui->ui()->mainTemplate();
698 $lng = $this->domain->lng();
699 $tour_id = $this->gui->standardRequest()->getTourId();
700 $step_id = $this->gui->standardRequest()->getStepId();
701
702 $this->step_manager->delete($tour_id, $step_id);
703 $mt->setOnScreenMessage("success", $lng->txt("gdtr_deleted_step"), true);
704 $ctrl->redirectByClass(self::class, "listSteps");
705 }

References $lng.

◆ deleteTour()

ilGuidedTourAdminGUI::deleteTour ( )
protected

Definition at line 310 of file class.ilGuidedTourAdminGUI.php.

310 : void
311 {
312 $mt = $this->gui->ui()->mainTemplate();
313 $lng = $this->domain->lng();
314 $ctrl = $this->gui->ctrl();
315 $tour_id = $this->gui->standardRequest()->getTourId();
316 $this->tm->deleteTour($tour_id);
317 $mt->setOnScreenMessage("success", $lng->txt("gdtr_deleted_tour"), true);
318 $ctrl->redirectByClass(self::class, "listTours");
319 }

References $lng.

◆ editPage()

ilGuidedTourAdminGUI::editPage ( int  $step_id)

Definition at line 594 of file class.ilGuidedTourAdminGUI.php.

594 : void
595 {
596 $ctrl = $this->gui->ctrl();
597 $ctrl->setParameterByClass(self::class, "step_id", $step_id);
598 $ctrl->redirectByClass(ilGuidedTourPageGUI::class, "edit");
599 }

◆ editSettings()

ilGuidedTourAdminGUI::editSettings ( )
protected

Definition at line 351 of file class.ilGuidedTourAdminGUI.php.

351 : void
352 {
353 $this->setStepsHeader();
354 $this->setSettingsTabs("settings");
355 $mt = $this->gui->ui()->mainTemplate();
356 $mt->setContent($this->getSettingsForm()->render());
357 }

References getSettingsForm(), setSettingsTabs(), and setStepsHeader().

+ Here is the call graph for this function:

◆ editStep()

ilGuidedTourAdminGUI::editStep ( int  $step_id)

Definition at line 581 of file class.ilGuidedTourAdminGUI.php.

581 : void
582 {
583 $mt = $this->gui->mainTemplate();
584 $lng = $this->domain->lng();
585 $this->setSingleStepHeader();
586 $mt->setOnScreenMessage("info", $lng->txt("gdtr_edit_step_info"));
587 $ctrl = $this->gui->ctrl();
588 $ctrl->setParameterByClass(self::class, "step_id", $step_id);
589 $step = $this->step_manager->getById($step_id);
590 $form = $this->getStepForm($step);
591 $mt->setContent($form->render());
592 }

References $lng, getStepForm(), and setSingleStepHeader().

+ Here is the call graph for this function:

◆ executeCommand()

ilGuidedTourAdminGUI::executeCommand ( )

Definition at line 50 of file class.ilGuidedTourAdminGUI.php.

50 : void
51 {
52 $ctrl = $this->gui->ctrl();
53 $mt = $this->gui->ui()->mainTemplate();
54
55 $next_class = $ctrl->getNextClass($this);
56 $cmd = $ctrl->getCmd("listTours");
57
58 switch ($next_class) {
59 case strtolower(ilExportGUI::class):
60 $this->setStepsHeader();
61 $this->setSettingsTabs("export");
62 $tour_id = $this->gui->standardRequest()->getTourId();
63 $exp_gui = new ilExportGUI($this->gui->objectGUI($tour_id));
64 $exp_gui->addFormat("xml");
65 $ctrl->forwardCommand($exp_gui);
66 break;
67
68 case strtolower(ilGuidedTourPageGUI::class):
69 $mt = $this->gui->mainTemplate();
70 $lng = $this->domain->lng();
71 $this->setStepsHeader();
72 $mt->setOnScreenMessage("info", $lng->txt("gdtr_edit_page_info"));
73 $ctrl->setReturnByClass(self::class, "listSteps");
74 $ctrl->saveParameterByClass(self::class, "step_id");
75 $ret = $this->forwardToPageObject();
76 $mt->setContent($ret);
77 break;
78
79 case strtolower(ilRepoStandardUploadHandlerGUI::class):
80 $form = $this->getImportForm();
81 $gui = $form->getRepoStandardUploadHandlerGUI("import");
82 $ctrl->forwardCommand($gui);
83 break;
84
85 default:
86 if (in_array($cmd, [
87 "listTours",
88 "addTour",
89 "saveTour",
90 "deleteTour",
91 "listSteps",
92 "addStep",
93 "saveStep",
94 "tableCommand",
95 "editStep",
96 "editPage",
97 "editSettings",
98 "saveSettings",
99 "idSettings",
100 "saveIdSettings",
101 "saveOrder",
102 "confirmStepDeletion",
103 "deleteStep",
104 "resetTour",
105 "importTourForm",
106 "importTour"
107 ])) {
108 $this->$cmd();
109 }
110 }
111 }
mainTemplate()
Export User Interface Class.

References $lng, forwardToPageObject(), getImportForm(), setSettingsTabs(), and setStepsHeader().

+ Here is the call graph for this function:

◆ forwardToPageObject()

ilGuidedTourAdminGUI::forwardToPageObject ( )

Definition at line 143 of file class.ilGuidedTourAdminGUI.php.

143 : string
144 {
145 $tabs = $this->gui->tabs();
146 $lng = $this->domain->lng();
147 $ctrl = $this->gui->ctrl();
148 $step_id = $this->gui->standardRequest()->getStepId();
149 $tour_id = $this->gui->standardRequest()->getTourId();
150
151 $tabs->clearTargets();
152
153 $tabs->setBackTarget(
154 $lng->txt("back"),
155 $ctrl->getLinkTargetByClass(ilGuidedTourPageGUI::class, "edit")
156 );
157
159 "gdtr",
160 $step_id
161 )) {
162 $new_page_object = new ilGuidedTourPage();
163 $new_page_object->setParentId($tour_id);
164 $new_page_object->setId($step_id);
165 $new_page_object->createFromXML();
166 }
167
168 // get page object
169 $page_gui = new ilGuidedTourPageGUI($step_id);
170 /*$page_gui->setStyleId(
171 $style->getEffectiveStyleId()
172 );*/
173 $page_gui->setTemplateTargetVar("ADM_CONTENT");
174 $page_gui->setFileDownloadLink("");
175 $page_gui->setPresentationTitle("");
176 $page_gui->setTemplateOutput(false);
177
178 // style tab
179 //$page_gui->setTabHook($this, "addPageTabs");
180
181 return $ctrl->forwardCommand($page_gui);
182 }
@ilCtrl_Calls ilGuidedTourPageGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMDEditorGUI @ilCtrl_Calls i...
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.

References $lng, and ilPageObject\_exists().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCreateForm()

ilGuidedTourAdminGUI::getCreateForm ( )
protected

Definition at line 321 of file class.ilGuidedTourAdminGUI.php.

322 {
323 $lng = $this->domain->lng();
324 return $this->gui->form([self::class], "saveTour")
325 ->section("sec", $lng->txt("gdtr_add_tour"))
326 ->addStdTitleAndDescription(0, "gdtr");
327 }

References $lng.

Referenced by addTour(), and saveTour().

+ Here is the caller graph for this function:

◆ getDeleteTourModal()

ilGuidedTourAdminGUI::getDeleteTourModal ( int  $tour_id)
protected

Definition at line 287 of file class.ilGuidedTourAdminGUI.php.

288 {
289 $tour = $this->tm->getByObjId($tour_id);
290 $f = $this->gui->ui()->factory();
291 $r = $this->gui->ui()->renderer();
292 $lng = $this->domain->lng();
293 $ctrl = $this->gui->ctrl();
294 $del_items = [];
295 $del_items[] = $f->modal()->interruptiveItem()->keyValue(
296 (string) $tour_id,
297 $tour->getTitle(),
298 ""
299 );
300 $ctrl->setParameterByClass(self::class, "tour_id", $tour_id);
301 $action = $ctrl->getLinkTargetByClass(self::class, "deleteTour");
302
303 return $f->modal()->interruptive(
304 $lng->txt("gdtr_delete_tour"),
305 $lng->txt("gdtr_delete_tour_mess"),
306 $action
307 )->withAffectedItems($del_items);
308 }

References Vendor\Package\$f, and $lng.

Referenced by listTours().

+ Here is the caller graph for this function:

◆ getIdForm()

ilGuidedTourAdminGUI::getIdForm ( )
protected

Definition at line 626 of file class.ilGuidedTourAdminGUI.php.

627 {
628 $lng = $this->domain->lng();
629 $id_pres = $this->domain->idPresentation();
630 return $this
631 ->gui
632 ->form([self::class], "saveIdSettings")
633 ->section("sec", $lng->txt("gdtr_id_settings"))
634 ->text(
635 "users",
636 $lng->txt("gdtr_id_pres_users"),
637 $lng->txt("gdtr_id_pres_users_info"),
638 $id_pres->getIdPresentationUsers()
639 );
640 }

References $lng.

Referenced by idSettings(), and saveIdSettings().

+ Here is the caller graph for this function:

◆ getImportForm()

ilGuidedTourAdminGUI::getImportForm ( )
protected

Definition at line 713 of file class.ilGuidedTourAdminGUI.php.

714 {
715 $lng = $this->domain->lng();
716 return $this->gui->form([self::class], "importTour")
717 ->section("sec", $lng->txt("gdtr_import_tour"))
718 ->file(
719 "import",
720 $lng->txt("import_file"),
721 $this->handleImportUpload(...),
722 "id",
723 "",
724 1,
725 ["application/zip"]
726 );
727 }

References $lng.

Referenced by executeCommand(), and importTourForm().

+ Here is the caller graph for this function:

◆ getResetTourModal()

ilGuidedTourAdminGUI::getResetTourModal ( int  $tour_id)
protected

Definition at line 252 of file class.ilGuidedTourAdminGUI.php.

253 {
254 $tour = $this->tm->getByObjId($tour_id);
255 $f = $this->gui->ui()->factory();
256 $r = $this->gui->ui()->renderer();
257 $lng = $this->domain->lng();
258 $ctrl = $this->gui->ctrl();
259 $res_items = [];
260 $res_items[] = $f->modal()->interruptiveItem()->keyValue(
261 (string) $tour_id,
262 $tour->getTitle(),
263 ""
264 );
265 $ctrl->setParameterByClass(self::class, "tour_id", $tour_id);
266 $action = $ctrl->getLinkTargetByClass(self::class, "resetTour");
267
268 return $f->modal()->interruptive(
269 $lng->txt("gdtr_reset_tour"),
270 $lng->txt("gdtr_reset_tour_mess"),
271 $action
272 )->withAffectedItems($res_items)
273 ->withActionButtonLabel($lng->txt("gdtr_reset_tour"));
274 }

References Vendor\Package\$f, and $lng.

Referenced by listTours().

+ Here is the caller graph for this function:

◆ getSettingsForm()

ilGuidedTourAdminGUI::getSettingsForm ( )
protected

Definition at line 359 of file class.ilGuidedTourAdminGUI.php.

360 {
361 $tour_id = $this->gui->standardRequest()->getTourId();
362 $lng = $this->domain->lng();
363 $settings = $this->domain->tourSettings()->getByObjId($tour_id);
364 $perm_val = (string) $settings?->getPermission()->value;
365 if ($perm_val === "0") {
366 $perm_val = "";
367 }
368 $lang_val = (string) $settings?->getLanguage();
369 $lang_vals = $this->domain->tourSettings()->getLangOptions($lang_val);
370 if ($perm_val === "0") {
371 $perm_val = "";
372 }
373 return $this
374 ->gui
375 ->form([self::class], "saveSettings")
376 ->section("sec", $lng->txt("settings"))
377 ->addStdTitleAndDescription($tour_id, "gdtr")
378 ->checkbox(
379 "active",
380 $lng->txt("gdtr_active"),
381 "",
382 $settings?->isActive()
383 )
384 ->section("sec2", $lng->txt("gdtr_presentation_limitation"))
385 ->text(
386 "screen_ids",
387 $lng->txt("gdtr_screen_ids"),
388 $lng->txt("gdtr_screen_ids_info"),
389 $settings?->getScreenIds()
390 )
391 ->select(
392 "permission",
393 $lng->txt("gdtr_permission"),
394 [
395 (string) PermissionType::Read->value => $lng->txt("read"),
396 (string) PermissionType::Write->value => $lng->txt("write"),
397 (string) PermissionType::Create->value => $lng->txt("create"),
398 ],
399 $lng->txt("gdtr_permission_info"),
400 $perm_val
401 )
402 ->select(
403 "lang",
404 $lng->txt("gdtr_language"),
405 $lang_vals,
406 $lng->txt("gdtr_language_info"),
407 $lang_val
408 );
409
410 }
addStdTitleAndDescription(int $obj_id, string $type)
getLanguage()

References $lng, ILIAS\Repository\Form\addStdTitleAndDescription(), ILIAS\Help\GuidedTour\Settings\Create, and getLanguage().

Referenced by editSettings(), and saveSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStepForm()

ilGuidedTourAdminGUI::getStepForm ( ?Step  $step = null)
protected

Definition at line 515 of file class.ilGuidedTourAdminGUI.php.

516 {
517 $lng = $this->domain->lng();
518 $type_val = (string) $step?->getType()->value;
519 $mb_element_id = $step?->getType()->value === StepType::Mainbar->value
520 ? $step?->getElementId()
521 : null;
522 $mt_element_id = $step?->getType()->value === StepType::Metabar->value
523 ? $step?->getElementId()
524 : null;
525 $tab_element_id = $step?->getType()->value === StepType::Tab->value
526 ? $step?->getElementId()
527 : null;
528 return $this->gui->form([self::class], "saveStep")
529 ->section("sec", $lng->txt("gdtr_step"))
530 ->switch("type", $lng->txt("gdtr_step_type"), "", $type_val)
531 ->group((string) StepType::Mainbar->value, $lng->txt("gdtr_mainbar"), $lng->txt("gdtr_mainbar_info"))
532 ->text("mb_element_id", $lng->txt("gdtr_element_id"), "", $mb_element_id)
533 ->group((string) StepType::Metabar->value, $lng->txt("gdtr_metabar"), $lng->txt("gdtr_metabar_info"))
534 ->text("mt_element_id", $lng->txt("gdtr_element_id"), "", $mt_element_id)
535 ->group((string) StepType::Tab->value, $lng->txt("gdtr_tabs"), $lng->txt("gdtr_tabs_info"))
536 ->text("tab_element_id", $lng->txt("gdtr_element_id"), "", $tab_element_id)
537 ->group((string) StepType::Form->value, $lng->txt("gdtr_form"), $lng->txt("gdtr_form_info"))
538 ->group((string) StepType::Table->value, $lng->txt("gdtr_table"), $lng->txt("gdtr_table_info"))
539 ->group((string) StepType::Toolbar->value, $lng->txt("gdtr_toolbar"), $lng->txt("gdtr_toolbar_info"))
540 ->group((string) StepType::PrimaryButton->value, $lng->txt("gdtr_primary_button"), $lng->txt("gdtr_primary_button_info"))
541 ->end();
542 }

References $lng, and ILIAS\Help\GuidedTour\Step\PrimaryButton.

Referenced by addStep(), editStep(), and saveStep().

+ Here is the caller graph for this function:

◆ getStepTable()

ilGuidedTourAdminGUI::getStepTable ( )
protected

Definition at line 490 of file class.ilGuidedTourAdminGUI.php.

491 {
492 return $this->gui->stepTableGUI(
493 $this->gui->standardRequest()->getTourId(),
494 $this,
495 "listSteps"
496 );
497 }

Referenced by confirmStepDeletion(), listSteps(), and saveOrder().

+ Here is the caller graph for this function:

◆ handleImportUpload()

ilGuidedTourAdminGUI::handleImportUpload ( FileUpload  $upload,
UploadResult  $result 
)
protected

Definition at line 729 of file class.ilGuidedTourAdminGUI.php.

733 $new_id = $this->importTourFile($result->getName(), $result->getPath());
734 return new BasicHandlerResult(
735 '',
736 \ILIAS\FileUpload\Handler\HandlerResult::STATUS_OK,
737 (string) $new_id,
738 ''
739 );
740 }
importTourFile(string $filename, string $path)
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.

◆ idSettings()

ilGuidedTourAdminGUI::idSettings ( )
protected

Definition at line 619 of file class.ilGuidedTourAdminGUI.php.

619 : void
620 {
621 $this->setSubTabs("id_settings");
622 $mt = $this->gui->ui()->mainTemplate();
623 $mt->setContent($this->getIdForm()->render());
624 }

References getIdForm(), and setSubTabs().

+ Here is the call graph for this function:

◆ importTour()

ilGuidedTourAdminGUI::importTour ( )
protected

Definition at line 763 of file class.ilGuidedTourAdminGUI.php.

763 : void
764 {
765 $ctrl = $this->gui->ctrl();
766 $ctrl->redirectByClass(self::class, "listTours");
767 }

◆ importTourFile()

ilGuidedTourAdminGUI::importTourFile ( string  $filename,
string  $path 
)
protected

Definition at line 743 of file class.ilGuidedTourAdminGUI.php.

746 : int {
747 $new_id = 0;
748 $fname = explode("_", $filename);
749 if ($fname[4] == "gdtr") {
750 $imp = new ilImport();
751 $new_id = $imp->importObject(
752 null,
753 $path,
754 $filename,
755 "gdtr",
756 "",
757 true
758 );
759 }
760 return $new_id;
761 }
$filename
Definition: buildRTE.php:78
Import class.
$path
Definition: ltiservices.php:30

◆ importTourForm()

ilGuidedTourAdminGUI::importTourForm ( )
protected

Definition at line 707 of file class.ilGuidedTourAdminGUI.php.

707 : void
708 {
709 $mt = $this->gui->ui()->mainTemplate();
710 $mt->setContent($this->getImportForm()->render());
711 }

References getImportForm().

+ Here is the call graph for this function:

◆ listSteps()

ilGuidedTourAdminGUI::listSteps ( )
protected

Definition at line 466 of file class.ilGuidedTourAdminGUI.php.

466 : void
467 {
468 $mt = $this->gui->ui()->mainTemplate();
469 $f = $this->gui->ui()->factory();
470 $ctrl = $this->gui->ctrl();
471 $lng = $this->domain->lng();
472
473 $table = $this->getStepTable();
474 if ($table->handleCommand()) {
475 return;
476 }
477
478 $this->setStepsHeader();
479 $this->setSettingsTabs("steps");
480
481 $b = $f->button()->standard(
482 $lng->txt("gdtr_add_step"),
483 $ctrl->getLinkTarget($this, "addStep")
484 );
485 $this->gui->toolbar()->addComponent($b);
486
487 $mt->setContent($table->render());
488 }

References Vendor\Package\$b, Vendor\Package\$f, $lng, getStepTable(), setSettingsTabs(), and setStepsHeader().

+ Here is the call graph for this function:

◆ listTours()

ilGuidedTourAdminGUI::listTours ( )
protected

Definition at line 185 of file class.ilGuidedTourAdminGUI.php.

185 : void
186 {
187 $mt = $this->gui->ui()->mainTemplate();
188 $f = $this->gui->ui()->factory();
189 $r = $this->gui->ui()->renderer();
190 $this->setSubTabs("tours");
191 $ctrl = $this->gui->ctrl();
192 $lng = $this->domain->lng();
193
194 $mt->setOnScreenMessage("info", $lng->txt("gdtr_list_tours_mess"));
195
196 $b = $f->button()->standard(
197 $lng->txt("gdtr_add_tour"),
198 $ctrl->getLinkTarget($this, "addTour")
199 );
200 $this->gui->toolbar()->addComponent($b);
201 $b = $f->button()->standard(
202 $lng->txt("gdtr_import_tour"),
203 $ctrl->getLinkTarget($this, "importTourForm")
204 );
205 $this->gui->toolbar()->addComponent($b);
206
207 $items = [];
208 $ui_items = [];
209 foreach ($this->tm->getAll() as $tour) {
210 $ctrl->setParameterByClass(self::class, "tour_id", $tour->getId());
211 $actions = [];
212 $actions[] = $f->link()->standard(
213 $lng->txt("gdtr_edit_steps"),
214 $ctrl->getLinkTargetByClass(self::class, "listSteps")
215 );
216 $actions[] = $f->link()->standard(
217 $lng->txt("gdtr_tour_settings"),
218 $ctrl->getLinkTargetByClass(self::class, "editSettings")
219 );
220 $reset_modal = $this->getResetTourModal($tour->getId());
221 $actions[] = $f->button()->shy(
222 $lng->txt("gdtr_reset_tour"),
223 "#"
224 )->withOnClick($reset_modal->getShowSignal());
225 $ui_items[] = $reset_modal;
226 $delete_modal = $this->getDeleteTourModal($tour->getId());
227 $actions[] = $f->button()->shy(
228 $lng->txt("gdtr_delete_tour"),
229 "#"
230 )->withOnClick($delete_modal->getShowSignal());
231 $ui_items[] = $delete_modal;
232 $properties = [];
233 $settings = $this->domain->tourSettings()->getByObjId($tour->getId());
234 $properties[$lng->txt("active")] = $settings?->isActive()
235 ? $lng->txt("yes")
236 : $lng->txt("no");
237 $items[] = $f->item()->standard($tour->getTitle())
238 ->withActions($f->dropdown()->standard($actions))
239 ->withProperties($properties);
240 }
241 if (count($items) > 0) {
242 $grp = $f->item()->group("", $items);
243 $panel = $f->panel()->listing()->standard(
244 $lng->txt("gdtr_guided_tours"),
245 [$grp]
246 );
247 $ui_items[] = $panel;
248 $mt->setContent($r->render($ui_items));
249 }
250 }

References Vendor\Package\$b, Vendor\Package\$f, $lng, getDeleteTourModal(), getResetTourModal(), and setSubTabs().

+ Here is the call graph for this function:

◆ resetTour()

ilGuidedTourAdminGUI::resetTour ( )
protected

Definition at line 276 of file class.ilGuidedTourAdminGUI.php.

276 : void
277 {
278 $mt = $this->gui->ui()->mainTemplate();
279 $lng = $this->domain->lng();
280 $ctrl = $this->gui->ctrl();
281 $tour_id = $this->gui->standardRequest()->getTourId();
282 $this->finish_manager->resetTour($tour_id);
283 $mt->setOnScreenMessage("success", $lng->txt("gdtr_tour_has_been_reset"), true);
284 $ctrl->redirectByClass(self::class, "listTours");
285 }

References $lng.

◆ saveIdSettings()

ilGuidedTourAdminGUI::saveIdSettings ( )
protected

Definition at line 642 of file class.ilGuidedTourAdminGUI.php.

642 : void
643 {
644 $mt = $this->gui->ui()->mainTemplate();
645 $lng = $this->domain->lng();
646 $ctrl = $this->gui->ctrl();
647 $form = $this->getIdForm();
648 $id_pres = $this->domain->idPresentation();
649 $id_pres->saveIdPresentationUsers($form->getData("users"));
650 $mt->setOnScreenMessage("success", $lng->txt("msg_obj_modified"), true);
651 $ctrl->redirectByClass(self::class, "idSettings");
652 }

References $lng, and getIdForm().

+ Here is the call graph for this function:

◆ saveOrder()

ilGuidedTourAdminGUI::saveOrder ( )
protected

Definition at line 654 of file class.ilGuidedTourAdminGUI.php.

654 : void
655 {
656 $ctrl = $this->gui->ctrl();
657 $mt = $this->gui->ui()->mainTemplate();
658 $lng = $this->domain->lng();
659 $ctrl->saveParameterByClass(self::class, "tour_id");
660
661 $table = $this->getStepTable();
662 $data = $table->getData();
663 if (is_array($data)) {
664 $this->step_manager->saveOrder(
665 $this->gui->standardRequest()->getTourId(),
666 $data
667 );
668 $mt->setOnScreenMessage("success", $lng->txt("msg_obj_modified"), true);
669 }
670 $ctrl->redirectByClass(self::class, "listSteps");
671 }

References $data, $lng, and getStepTable().

+ Here is the call graph for this function:

◆ saveSettings()

ilGuidedTourAdminGUI::saveSettings ( )

Definition at line 412 of file class.ilGuidedTourAdminGUI.php.

412 : void
413 {
414 $mt = $this->gui->ui()->mainTemplate();
415 $form = $this->getSettingsForm();
416 $tour_id = $this->gui->standardRequest()->getTourId();
417 $lng = $this->domain->lng();
418 $ctrl = $this->gui->ctrl();
419
420 $tour_settings = $this->domain->tourSettings();
421 if ($form->isValid()) {
422 $form->saveStdTitleAndDescription($tour_id, "gdtr");
423 $tour_settings->save($this->data->settings(
424 $tour_id,
425 (bool) $form->getData("active"),
426 $form->getData("screen_ids"),
427 PermissionType::from((int) $form->getData("permission")),
428 $form->getData("lang")
429 ));
430 $mt->setOnScreenMessage("success", $lng->txt("msg_obj_modified"), true);
431 $ctrl->redirectByClass(self::class, "editSettings");
432 } else {
433 $mt->setContent($form->render());
434 }
435 }

References $lng, ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\from(), and getSettingsForm().

+ Here is the call graph for this function:

◆ saveStep()

ilGuidedTourAdminGUI::saveStep ( )

Definition at line 544 of file class.ilGuidedTourAdminGUI.php.

544 : void
545 {
546 $ctrl = $this->gui->ctrl();
547 $mt = $this->gui->ui()->mainTemplate();
548 $oder_nr = 0;
549 if (($step_id = $this->gui->standardRequest()->getStepId()) > 0) {
550 $step = $this->step_manager->getById($step_id);
551 $oder_nr = $step->getOrderNr();
552 }
553 $form = $this->getStepForm();
554 if ($form->isValid()) {
555 $element_id = match ((int) $form->getData("type")) {
556 StepType::Mainbar->value => $form->getData("mb_element_id"),
557 StepType::Metabar->value => $form->getData("mt_element_id"),
558 StepType::Tab->value => $form->getData("tab_element_id"),
559 default => ''
560 };
561 $step = $this->data->step(
562 $step_id,
563 $this->gui->standardRequest()->getTourId(),
564 $oder_nr,
565 StepType::from((int) $form->getData("type")),
566 $element_id
567 );
568 if ($step_id > 0) {
569 $this->step_manager->update($step);
570 $ctrl->redirectByClass(self::class, "listSteps");
571 } else {
572 $new_id = $this->step_manager->create($step);
573 $ctrl->setParameterByClass(self::class, "step_id", $new_id);
574 $ctrl->redirectByClass(ilGuidedTourPageGUI::class, "edit");
575 }
576 } else {
577 $mt->setContent($form->render());
578 }
579 }

References ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\from(), and getStepForm().

+ Here is the call graph for this function:

◆ saveTour()

ilGuidedTourAdminGUI::saveTour ( )

Definition at line 335 of file class.ilGuidedTourAdminGUI.php.

335 : void
336 {
337 $mt = $this->gui->ui()->mainTemplate();
338 $lng = $this->domain->lng();
339 $ctrl = $this->gui->ctrl();
340 $form = $this->getCreateForm();
341 if ($form->isValid()) {
342 $obj_id = $this->tm->createTour("dummy", "");
343 $form->saveStdTitleAndDescription($obj_id, "gdtr");
344 $mt->setOnScreenMessage("success", $lng->txt("msg_obj_modified"), true);
345 $ctrl->redirectByClass(self::class, "listTours");
346 } else {
347 $mt->setContent($form->render());
348 }
349 }

References $lng, and getCreateForm().

+ Here is the call graph for this function:

◆ setSettingsTabs()

ilGuidedTourAdminGUI::setSettingsTabs ( string  $active)
protected

Definition at line 113 of file class.ilGuidedTourAdminGUI.php.

113 : void
114 {
115 $tabs = $this->gui->tabs();
116 $lng = $this->domain->lng();
117 $ctrl = $this->gui->ctrl();
118 $tabs->clearTargets();
119 $this->gui->help()->setScreenIdComponent("hlps_gdtr");
120 $tabs->setBackTarget(
121 $lng->txt("gdtr_guided_tours"),
122 $ctrl->getLinkTargetByClass(self::class, "listTours")
123 );
124 $ctrl->saveParameterByClass(self::class, "tour_id");
125 $tabs->addTab(
126 "steps",
127 $lng->txt("gdtr_tour_steps"),
128 $ctrl->getLinkTargetByClass(self::class, "listSteps")
129 );
130 $tabs->addTab(
131 "settings",
132 $lng->txt("settings"),
133 $ctrl->getLinkTargetByClass(self::class, "editSettings")
134 );
135 $tabs->addTab(
136 "export",
137 $lng->txt("export"),
138 $ctrl->getLinkTargetByClass(ilexportGUI::class, "export", ""),
139 );
140 $tabs->activateTab($active);
141 }

References $lng.

Referenced by editSettings(), executeCommand(), and listSteps().

+ Here is the caller graph for this function:

◆ setSingleStepHeader()

ilGuidedTourAdminGUI::setSingleStepHeader ( )
protected

Definition at line 454 of file class.ilGuidedTourAdminGUI.php.

454 : void
455 {
456 $this->setStepsHeader();
457 $tabs = $this->gui->tabs();
458 $lng = $this->domain->lng();
459 $ctrl = $this->gui->ctrl();
460 $tabs->setBackTarget(
461 $lng->txt("back"),
462 $ctrl->getLinkTargetByClass(self::class, "listSteps")
463 );
464 }

References $lng, and setStepsHeader().

Referenced by addStep(), and editStep().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setStepsHeader()

ilGuidedTourAdminGUI::setStepsHeader ( )
protected

Definition at line 438 of file class.ilGuidedTourAdminGUI.php.

438 : void
439 {
440 $tabs = $this->gui->tabs();
441 $lng = $this->domain->lng();
442 $mt = $this->gui->ui()->mainTemplate();
443 $ctrl = $this->gui->ctrl();
444 $tour = $this->tm->getByObjId($this->gui->standardRequest()->getTourId());
445 $mt->setTitle($lng->txt("guided_tour") . ": " . $tour?->getTitle());
446 $mt->setDescription($tour?->getDescription());
447 $tabs->clearTargets();
448 $tabs->setBackTarget(
449 $lng->txt("back"),
450 $ctrl->getLinkTargetByClass(self::class, "listTours")
451 );
452 }

References $lng.

Referenced by editSettings(), executeCommand(), listSteps(), and setSingleStepHeader().

+ Here is the caller graph for this function:

◆ setSubTabs()

ilGuidedTourAdminGUI::setSubTabs ( string  $active)
protected

Definition at line 601 of file class.ilGuidedTourAdminGUI.php.

601 : void
602 {
603 $tabs = $this->gui->tabs();
604 $lng = $this->domain->lng();
605 $ctrl = $this->gui->ctrl();
606 $tabs->addSubTab(
607 "tours",
608 $lng->txt("gdtr_tours"),
609 $ctrl->getLinkTargetByClass(self::class, "listTours")
610 );
611 $tabs->addSubTab(
612 "id_settings",
613 $lng->txt("gdtr_id_settings"),
614 $ctrl->getLinkTargetByClass(self::class, "idSettings")
615 );
616 $tabs->activateSubTab($active);
617 }

References $lng.

Referenced by idSettings(), and listTours().

+ Here is the caller graph for this function:

Field Documentation

◆ $finish_manager

ILIAS Help GuidedTour UserFinished UserFinishedManager ilGuidedTourAdminGUI::$finish_manager
protected

Definition at line 35 of file class.ilGuidedTourAdminGUI.php.

◆ $step_manager

ILIAS Help GuidedTour Step StepManager ilGuidedTourAdminGUI::$step_manager
private

Definition at line 34 of file class.ilGuidedTourAdminGUI.php.

◆ $tm

ILIAS Help GuidedTour Tour TourManager ilGuidedTourAdminGUI::$tm
protected

Definition at line 36 of file class.ilGuidedTourAdminGUI.php.


The documentation for this class was generated from the following file: