ILIAS  release_8 Revision v8.23
ilAchievementsGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilAchievementsGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 

Protected Member Functions

 show ()
 Show (redirects to first active service) More...
 
 setTabs (string $activate)
 
 getLinks ()
 
 getGUIClasses ()
 Get GUI class. More...
 

Protected Attributes

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

Private Attributes

ilGlobalTemplateInterface $main_tpl
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning ilAchievementsGUI: ilLearningProgressGUI, ilPersonalSkillsGUI, ilBadgeProfileGUI, ilLearningHistoryGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilAchievementsGUI::__construct ( )

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

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

31  {
32  global $DIC;
33  $this->ctrl = $DIC->ctrl();
34  $this->achievements = new ilAchievements();
35  $this->lng = $DIC->language();
36  $this->tabs = $DIC->tabs();
37  $this->main_tpl = $DIC->ui()->mainTemplate();
38  }
global $DIC
Definition: feed.php:28
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:

Member Function Documentation

◆ executeCommand()

ilAchievementsGUI::executeCommand ( )
Exceptions
ilCtrlException

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

43  : void
44  {
47  $lng = $this->lng;
48 
49  $lng->loadLanguageModule("lhist");
50 
51  $next_class = $ctrl->getNextClass($this);
52  $cmd = $ctrl->getCmd("show");
53 
54 
55  switch ($next_class) {
56  case "illearningprogressgui":
57  $main_tpl->setTitle($lng->txt("learning_progress"));
58  $main_tpl->setTitleIcon(ilUtil::getImagePath("icon_trac.svg"));
60  $ctrl->forwardCommand($new_gui);
61  break;
62 
63  case 'illearninghistorygui':
64  $main_tpl->setTitle($lng->txt("lhist_learning_history"));
65  $main_tpl->setTitleIcon(ilUtil::getImagePath("icon_lhist.svg"));
66  $lhistgui = new ilLearningHistoryGUI();
67  $ctrl->forwardCommand($lhistgui);
68  $this->main_tpl->printToStdout();
69  break;
70 
71  case 'ilpersonalskillsgui':
72  $main_tpl->setTitle($lng->txt("skills"));
73  $main_tpl->setTitleIcon(ilUtil::getImagePath("icon_skmg.svg"));
74  $skgui = new ilPersonalSkillsGUI();
75  $ctrl->forwardCommand($skgui);
76  $this->main_tpl->printToStdout();
77  break;
78 
79  case 'ilbadgeprofilegui':
80  $main_tpl->setTitle($lng->txt("obj_bdga"));
81  $main_tpl->setTitleIcon(ilUtil::getImagePath("icon_bdga.svg"));
82  $bgui = new ilBadgeProfileGUI();
83  $ctrl->forwardCommand($bgui);
84  $this->main_tpl->printToStdout();
85  break;
86 
87  case 'ilusercertificategui':
88  $main_tpl->setTitle($lng->txt("obj_cert"));
89  $main_tpl->setTitleIcon(ilUtil::getImagePath("icon_cert.svg"));
90  $cgui = new ilUserCertificateGUI();
91  $ctrl->forwardCommand($cgui);
92  $this->main_tpl->printToStdout();
93  break;
94 
95  default:
96  if (in_array($cmd, array("show"))) {
97  $this->$cmd();
98  }
99  $this->main_tpl->printToStdout();
100  break;
101  }
102  }
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)
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)
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
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

Get GUI class.

Returns
string[]

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

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

◆ getLinks()

ilAchievementsGUI::getLinks ( )
protected
Returns
array[]

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

132  : array
133  {
134  $ctrl = $this->ctrl;
135  $lng = $this->lng;
136 
137  $lng->loadLanguageModule("lhist");
138  $gui_classes = $this->getGUIClasses();
139 
140  $links = [
142  "txt" => $lng->txt("lhist_learning_history")
143  ],
145  "txt" => $lng->txt("skills")
146  ],
148  "txt" => $lng->txt("learning_progress")
149  ],
151  "txt" => $lng->txt('obj_bdga')
152  ],
154  "txt" => $lng->txt("obj_cert")
155  ]
156  ];
157 
158  foreach ($links as $k => $v) {
159  $links[$k]["link"] = $ctrl->getLinkTargetByClass(["ildashboardgui", "ilachievementsgui", $gui_classes[$k]]);
160  }
161 
162  return $links;
163  }
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...
getGUIClasses()
Get GUI class.
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 118 of file class.ilAchievementsGUI.php.

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

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

Show (redirects to first active service)

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

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

107  : void
108  {
109  $ctrl = $this->ctrl;
110 
111  $gui_classes = $this->getGUIClasses();
112  $first_service = current($this->achievements->getActiveServices());
113  if ($first_service) {
114  $ctrl->redirectByClass(["ildashboardgui", "ilachievementsgui", $gui_classes[$first_service]]);
115  }
116  }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
getGUIClasses()
Get GUI class.
+ Here is the call graph for this function:

Field Documentation

◆ $achievements

ilAchievements ilAchievementsGUI::$achievements
protected

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

◆ $ctrl

ilCtrl ilAchievementsGUI::$ctrl
protected

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

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

◆ $lng

ilLanguage ilAchievementsGUI::$lng
protected

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

Referenced by executeCommand(), and getLinks().

◆ $main_tpl

ilGlobalTemplateInterface ilAchievementsGUI::$main_tpl
private

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

Referenced by executeCommand().

◆ $tabs

ilTabsGUI ilAchievementsGUI::$tabs
protected

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

Referenced by setTabs().


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