ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
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 505 of file class.ilGuidedTourAdminGUI.php.

505 : void
506 {
507 $this->setSingleStepHeader();
508 $mt = $this->gui->ui()->mainTemplate();
509 $lng = $this->domain->lng();
510 $mt->setOnScreenMessage("info", $lng->txt("gdtr_edit_step_info"));
511 $mt->setContent($this->getStepForm()->render());
512 }
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 672 of file class.ilGuidedTourAdminGUI.php.

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

References $lng, and getStepTable().

+ Here is the call graph for this function:

◆ deleteStep()

ilGuidedTourAdminGUI::deleteStep ( )

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

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

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 593 of file class.ilGuidedTourAdminGUI.php.

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

◆ 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 580 of file class.ilGuidedTourAdminGUI.php.

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

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 625 of file class.ilGuidedTourAdminGUI.php.

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

References $lng.

Referenced by idSettings(), and saveIdSettings().

+ Here is the caller graph for this function:

◆ getImportForm()

ilGuidedTourAdminGUI::getImportForm ( )
protected

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

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

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 ->text(
385 "screen_ids",
386 $lng->txt("gdtr_screen_ids"),
387 $lng->txt("gdtr_screen_ids_info"),
388 $settings?->getScreenIds()
389 )
390 ->select(
391 "permission",
392 $lng->txt("gdtr_permission"),
393 [
394 (string) PermissionType::Read->value => $lng->txt("read"),
395 (string) PermissionType::Write->value => $lng->txt("write"),
396 (string) PermissionType::Create->value => $lng->txt("create"),
397 ],
398 $lng->txt("gdtr_permission_info"),
399 $perm_val
400 )
401 ->select(
402 "lang",
403 $lng->txt("gdtr_language"),
404 $lang_vals,
405 $lng->txt("gdtr_language_info"),
406 $lang_val
407 );
408
409 }
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 514 of file class.ilGuidedTourAdminGUI.php.

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

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 489 of file class.ilGuidedTourAdminGUI.php.

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

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 728 of file class.ilGuidedTourAdminGUI.php.

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

◆ idSettings()

ilGuidedTourAdminGUI::idSettings ( )
protected

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

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

References getIdForm(), and setSubTabs().

+ Here is the call graph for this function:

◆ importTour()

ilGuidedTourAdminGUI::importTour ( )
protected

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

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

◆ importTourFile()

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

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

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

◆ importTourForm()

ilGuidedTourAdminGUI::importTourForm ( )
protected

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

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

References getImportForm().

+ Here is the call graph for this function:

◆ listSteps()

ilGuidedTourAdminGUI::listSteps ( )
protected

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

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

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("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("delete"),
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 641 of file class.ilGuidedTourAdminGUI.php.

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

References $lng, and getIdForm().

+ Here is the call graph for this function:

◆ saveOrder()

ilGuidedTourAdminGUI::saveOrder ( )
protected

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

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

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

+ Here is the call graph for this function:

◆ saveSettings()

ilGuidedTourAdminGUI::saveSettings ( )

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

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

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

+ Here is the call graph for this function:

◆ saveStep()

ilGuidedTourAdminGUI::saveStep ( )

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

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

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 453 of file class.ilGuidedTourAdminGUI.php.

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

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 437 of file class.ilGuidedTourAdminGUI.php.

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

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 600 of file class.ilGuidedTourAdminGUI.php.

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

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: