ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilAchievementsGUI Class Reference

ilAchievementsGUI: ilLearningProgressGUI, ilPersonalSkillsGUI, ilBadgeProfileGUI, ilLearningHistoryGUI More...

+ Collaboration diagram for ilAchievementsGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 

Protected Member Functions

 show ()
 
 setTabs (string $activate)
 
 getLinks ()
 
 getGUIClasses ()
 

Protected Attributes

ilCtrl $ctrl
 
ilAchievements $achievements
 
ilLanguage $lng
 
ilTabsGUI $tabs
 

Private Attributes

ilGlobalTemplateInterface $main_tpl
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilAchievementsGUI::__construct ( )

Definition at line 32 of file class.ilAchievementsGUI.php.

References $DIC, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

33  {
34  global $DIC;
35  $this->ctrl = $DIC->ctrl();
36  $this->achievements = new ilAchievements();
37  $this->lng = $DIC->language();
38  $this->tabs = $DIC->tabs();
39  $this->main_tpl = $DIC->ui()->mainTemplate();
40  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilAchievementsGUI::executeCommand ( )

Definition at line 42 of file class.ilAchievementsGUI.php.

References $ctrl, $lng, $main_tpl, ilCtrl\forwardCommand(), ilCtrl\getCmd(), ilUtil\getImagePath(), ilCtrl\getNextClass(), ilLanguage\loadLanguageModule(), ilLearningProgressBaseGUI\LP_CONTEXT_PERSONAL_DESKTOP, ilGlobalTemplateInterface\setTitle(), ilGlobalTemplateInterface\setTitleIcon(), and ilLanguage\txt().

42  : void
43  {
46  $lng = $this->lng;
47 
48  $lng->loadLanguageModule('lhist');
49 
50  $next_class = $ctrl->getNextClass($this);
51  $cmd = $ctrl->getCmd('show');
52 
53 
54  switch ($next_class) {
55  case strtolower(ilLearningProgressGUI::class):
56  $main_tpl->setTitle($lng->txt('learning_progress'));
57  $main_tpl->setTitleIcon(ilUtil::getImagePath('standard/icon_trac.svg'));
59  $ctrl->forwardCommand($new_gui);
60  break;
61 
62  case strtolower(ilLearningHistoryGUI::class):
63  $main_tpl->setTitle($lng->txt('lhist_learning_history'));
64  $main_tpl->setTitleIcon(ilUtil::getImagePath('standard/icon_lhist.svg'));
65  $lhistgui = new ilLearningHistoryGUI();
66  $ctrl->forwardCommand($lhistgui);
67  $this->main_tpl->printToStdout();
68  break;
69 
70  case strtolower(ilPersonalSkillsGUI::class):
71  $main_tpl->setTitle($lng->txt('skills'));
72  $main_tpl->setTitleIcon(ilUtil::getImagePath('standard/icon_skmg.svg'));
73  $skgui = new ilPersonalSkillsGUI();
74  $ctrl->forwardCommand($skgui);
75  $this->main_tpl->printToStdout();
76  break;
77 
78  case strtolower(ilBadgeProfileGUI::class):
79  $main_tpl->setTitle($lng->txt('obj_bdga'));
80  $main_tpl->setTitleIcon(ilUtil::getImagePath('standard/icon_bdga.svg'));
81  $bgui = new ilBadgeProfileGUI();
82  $ctrl->forwardCommand($bgui);
83  $this->main_tpl->printToStdout();
84  break;
85 
86  case strtolower(ilUserCertificateGUI::class):
87  $main_tpl->setTitle($lng->txt('obj_cert'));
88  $main_tpl->setTitleIcon(ilUtil::getImagePath('standard/icon_cert.svg'));
89  $cgui = new ilUserCertificateGUI();
90  $ctrl->forwardCommand($cgui);
91  $this->main_tpl->printToStdout();
92  break;
93 
94  default:
95  if ($cmd == 'show') {
96  $this->$cmd();
97  }
98  $this->main_tpl->printToStdout();
99  break;
100  }
101  }
ilUserCertificateGUI: ilAchievementsGUI
getCmd(string $fallback_command=null)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
loadLanguageModule(string $a_module)
Load language module.
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
forwardCommand(object $a_gui_object)
Personal skills GUI class.
ilGlobalTemplateInterface $main_tpl
getNextClass($a_gui_class=null)
Class ilBadgeProfileGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ getGUIClasses()

ilAchievementsGUI::getGUIClasses ( )
protected
Returns
string[]

Definition at line 164 of file class.ilAchievementsGUI.php.

References ilAchievements\SERV_BADGES, ilAchievements\SERV_CERTIFICATES, ilAchievements\SERV_COMPETENCES, ilAchievements\SERV_LEARNING_HISTORY, and ilAchievements\SERV_LEARNING_PROGRESS.

Referenced by getLinks(), and show().

164  : array
165  {
166  return [
167  ilAchievements::SERV_LEARNING_HISTORY => strtolower(ilLearningHistoryGUI::class),
168  ilAchievements::SERV_COMPETENCES => strtolower(ilPersonalSkillsGUI::class),
169  ilAchievements::SERV_LEARNING_PROGRESS => strtolower(ilLearningProgressGUI::class),
170  ilAchievements::SERV_BADGES => strtolower(ilBadgeProfileGUI::class),
171  ilAchievements::SERV_CERTIFICATES => strtolower(ilUserCertificateGUI::class)
172  ];
173  }
+ Here is the caller graph for this function:

◆ getLinks()

ilAchievementsGUI::getLinks ( )
protected
Returns
array[]

Definition at line 128 of file class.ilAchievementsGUI.php.

References $ctrl, $lng, getGUIClasses(), ilCtrl\getLinkTargetByClass(), ilLanguage\loadLanguageModule(), ilAchievements\SERV_BADGES, ilAchievements\SERV_CERTIFICATES, ilAchievements\SERV_COMPETENCES, ilAchievements\SERV_LEARNING_HISTORY, ilAchievements\SERV_LEARNING_PROGRESS, and ilLanguage\txt().

Referenced by setTabs().

128  : array
129  {
130  $ctrl = $this->ctrl;
131  $lng = $this->lng;
132 
133  $lng->loadLanguageModule('lhist');
134  $gui_classes = $this->getGUIClasses();
135 
136  $links = [
138  'txt' => $lng->txt('lhist_learning_history')
139  ],
141  'txt' => $lng->txt('skills')
142  ],
144  'txt' => $lng->txt('learning_progress')
145  ],
147  'txt' => $lng->txt('obj_bdga')
148  ],
150  'txt' => $lng->txt('obj_cert')
151  ]
152  ];
153 
154  foreach ($links as $k => $v) {
155  $links[$k]['link'] = $ctrl->getLinkTargetByClass([ilDashboardGUI::class, ilAchievementsGUI::class, $gui_classes[$k]]);
156  }
157 
158  return $links;
159  }
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
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...
loadLanguageModule(string $a_module)
Load language module.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilAchievementsGUI::setTabs ( string  $activate)
protected

Definition at line 114 of file class.ilAchievementsGUI.php.

References $tabs, ilTabsGUI\activateTab(), ilTabsGUI\addTab(), and getLinks().

114  : void
115  {
116  $tabs = $this->tabs;
117  $links = $this->getLinks();
118 
119  foreach ($this->achievements->getActiveServices() as $s) {
120  $tabs->addTab('achieve_' . $s, $links[$s]['txt'], $links[$s]['link']);
121  }
122  $tabs->activateTab('achieve_' . $activate);
123  }
activateTab(string $a_id)
addTab(string $a_id, string $a_text, string $a_link, string $a_frame="")
Add a Tab.
+ Here is the call graph for this function:

◆ show()

ilAchievementsGUI::show ( )
protected

Definition at line 103 of file class.ilAchievementsGUI.php.

References $ctrl, getGUIClasses(), and ilCtrl\redirectByClass().

103  : void
104  {
105  $ctrl = $this->ctrl;
106 
107  $gui_classes = $this->getGUIClasses();
108  $first_service = current($this->achievements->getActiveServices());
109  if ($first_service) {
110  $ctrl->redirectByClass([ilDashboardGUI::class, ilAchievementsGUI::class, $gui_classes[$first_service]]);
111  }
112  }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:

Field Documentation

◆ $achievements

ilAchievements ilAchievementsGUI::$achievements
protected

Definition at line 27 of file class.ilAchievementsGUI.php.

◆ $ctrl

ilCtrl ilAchievementsGUI::$ctrl
protected

Definition at line 26 of file class.ilAchievementsGUI.php.

Referenced by executeCommand(), getLinks(), and show().

◆ $lng

ilLanguage ilAchievementsGUI::$lng
protected

Definition at line 28 of file class.ilAchievementsGUI.php.

Referenced by executeCommand(), and getLinks().

◆ $main_tpl

ilGlobalTemplateInterface ilAchievementsGUI::$main_tpl
private

Definition at line 30 of file class.ilAchievementsGUI.php.

Referenced by executeCommand().

◆ $tabs

ilTabsGUI ilAchievementsGUI::$tabs
protected

Definition at line 29 of file class.ilAchievementsGUI.php.

Referenced by setTabs().


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