ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilAchievementsGUI Class Reference

ilAchievementsGUI: ilPersonalSkillsGUI, ilBadgeProfileGUI, ilLearningHistoryGUI, ilLPPersonalGUI 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: shib_login.php:26
+ 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(), ILIAS\UICore\GlobalTemplate\setDescription(), ILIAS\UICore\GlobalTemplate\setTitle(), ILIAS\UICore\GlobalTemplate\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(ilLearningHistoryGUI::class):
56  $main_tpl->setTitle($lng->txt('lhist_learning_history'));
57  $main_tpl->setTitleIcon(ilUtil::getImagePath('standard/icon_lhist.svg'));
58  $lhistgui = new ilLearningHistoryGUI();
59  $ctrl->forwardCommand($lhistgui);
60  $this->main_tpl->printToStdout();
61  break;
62 
63  case strtolower(ilLPPersonalGUI::class):
64  $lng->loadLanguageModule("trac");
65  $main_tpl->setTitle($lng->txt("personal_learning_progress_view_title"));
66  $main_tpl->setTitleIcon(ilUtil::getImagePath('standard/icon_trac.svg'));
67  $main_tpl->setDescription($lng->txt("personal_learning_progress_view_description"));
68  $plp_gui = new ilLPPersonalGUI();
69  $ctrl->forwardCommand($plp_gui);
70  $this->main_tpl->printToStdout();
71  break;
72 
73  case strtolower(ilPersonalSkillsGUI::class):
74  $main_tpl->setTitle($lng->txt('skills'));
75  $main_tpl->setTitleIcon(ilUtil::getImagePath('standard/icon_skmg.svg'));
76  $skgui = new ilPersonalSkillsGUI();
77  $ctrl->forwardCommand($skgui);
78  $this->main_tpl->printToStdout();
79  break;
80 
81  case strtolower(ilBadgeProfileGUI::class):
82  $main_tpl->setTitle($lng->txt('obj_bdga'));
83  $main_tpl->setTitleIcon(ilUtil::getImagePath('standard/icon_bdga.svg'));
84  $bgui = new ilBadgeProfileGUI();
85  $ctrl->forwardCommand($bgui);
86  $this->main_tpl->printToStdout();
87  break;
88 
89  case strtolower(ilUserCertificateGUI::class):
90  $main_tpl->setTitle($lng->txt('obj_cert'));
91  $main_tpl->setTitleIcon(ilUtil::getImagePath('standard/icon_cert.svg'));
92  $cgui = new ilUserCertificateGUI();
93  $ctrl->forwardCommand($cgui);
94  $this->main_tpl->printToStdout();
95  break;
96 
97  default:
98  if ($cmd == 'show') {
99  $this->$cmd();
100  }
101  $this->main_tpl->printToStdout();
102  break;
103  }
104  }
ilUserCertificateGUI: ilAchievementsGUI
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...
getCmd(?string $fallback_command=null)
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
loadLanguageModule(string $a_module)
Load language module.
forwardCommand(object $a_gui_object)
Personal skills GUI class.
ilGlobalTemplateInterface $main_tpl
getNextClass($a_gui_class=null)
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
setDescription(string $a_descr)
Sets description below title in standard template.
+ Here is the call graph for this function:

◆ getGUIClasses()

ilAchievementsGUI::getGUIClasses ( )
protected
Returns
string[]

Definition at line 167 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().

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

◆ getLinks()

ilAchievementsGUI::getLinks ( )
protected
Returns
array[]

Definition at line 131 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().

131  : array
132  {
133  $ctrl = $this->ctrl;
134  $lng = $this->lng;
135 
136  $lng->loadLanguageModule('lhist');
137  $gui_classes = $this->getGUIClasses();
138 
139  $links = [
141  'txt' => $lng->txt('lhist_learning_history')
142  ],
144  'txt' => $lng->txt('skills')
145  ],
147  'txt' => $lng->txt('learning_progress')
148  ],
150  'txt' => $lng->txt('obj_bdga')
151  ],
153  'txt' => $lng->txt('obj_cert')
154  ]
155  ];
156 
157  foreach ($links as $k => $v) {
158  $links[$k]['link'] = $ctrl->getLinkTargetByClass([ilDashboardGUI::class, ilAchievementsGUI::class, $gui_classes[$k]]);
159  }
160 
161  return $links;
162  }
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.
getLinkTargetByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
+ 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 117 of file class.ilAchievementsGUI.php.

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

117  : void
118  {
119  $tabs = $this->tabs;
120  $links = $this->getLinks();
121 
122  foreach ($this->achievements->getActiveServices() as $s) {
123  $tabs->addTab('achieve_' . $s, $links[$s]['txt'], $links[$s]['link']);
124  }
125  $tabs->activateTab('achieve_' . $activate);
126  }
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 106 of file class.ilAchievementsGUI.php.

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

106  : void
107  {
108  $ctrl = $this->ctrl;
109 
110  $gui_classes = $this->getGUIClasses();
111  $first_service = current($this->achievements->getActiveServices());
112  if ($first_service) {
113  $ctrl->redirectByClass([ilDashboardGUI::class, ilAchievementsGUI::class, $gui_classes[$first_service]]);
114  }
115  }
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: