ILIAS  release_7 Revision v7.30-3-g800a261c036
ilAchievementsGUI Class Reference

Achivements GUI. More...

+ Collaboration diagram for ilAchievementsGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 

Protected Member Functions

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

Protected Attributes

 $ctrl
 
 $achievements
 
 $lng
 
 $tabs
 

Private Attributes

 $main_tpl
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilAchievementsGUI::__construct ( )

Constructor.

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

44 {
45 global $DIC;
46 $this->ctrl = $DIC->ctrl();
47 $this->achievements = new ilAchievements();
48 $this->lng = $DIC->language();
49 $this->tabs = $DIC->tabs();
50 $this->main_tpl = $DIC->ui()->mainTemplate();
51 }
Maybe a separate service in the future.
global $DIC
Definition: goto.php:24

References $DIC.

Member Function Documentation

◆ executeCommand()

ilAchievementsGUI::executeCommand ( )

Execute command.

Exceptions
ilCtrlException

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

58 {
62
63 $lng->loadLanguageModule("lhist");
64
65 $next_class = $ctrl->getNextClass($this);
66 $cmd = $ctrl->getCmd("show");
67
68
69 switch ($next_class) {
70 case "illearningprogressgui":
71 $main_tpl->setTitle($lng->txt("learning_progress"));
72 $main_tpl->setTitleIcon(ilUtil::getImagePath("icon_trac.svg"));
73 include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
75 $ctrl->forwardCommand($new_gui);
76 break;
77
78 case 'illearninghistorygui':
79 $main_tpl->setTitle($lng->txt("lhist_learning_history"));
80 $main_tpl->setTitleIcon(ilUtil::getImagePath("icon_lhist.svg"));
81 $lhistgui = new ilLearningHistoryGUI();
82 $ctrl->forwardCommand($lhistgui);
83 $this->main_tpl->printToStdout();
84 break;
85
86 case 'ilpersonalskillsgui':
87 $main_tpl->setTitle($lng->txt("skills"));
88 $main_tpl->setTitleIcon(ilUtil::getImagePath("icon_skmg.svg"));
89 $skgui = new ilPersonalSkillsGUI();
90 $ctrl->forwardCommand($skgui);
91 $this->main_tpl->printToStdout();
92 break;
93
94 case 'ilbadgeprofilegui':
95 $main_tpl->setTitle($lng->txt("obj_bdga"));
96 $main_tpl->setTitleIcon(ilUtil::getImagePath("icon_bdga.svg"));
97 include_once './Services/Badge/classes/class.ilBadgeProfileGUI.php';
98 $bgui = new ilBadgeProfileGUI();
99 $ctrl->forwardCommand($bgui);
100 $this->main_tpl->printToStdout();
101 break;
102
103 case 'ilusercertificategui':
104 $main_tpl->setTitle($lng->txt("obj_cert"));
105 $main_tpl->setTitleIcon(ilUtil::getImagePath("icon_cert.svg"));
106 $cgui = new ilUserCertificateGUI();
107 $ctrl->forwardCommand($cgui);
108 $this->main_tpl->printToStdout();
109 break;
110
111 default:
112 if (in_array($cmd, array("show"))) {
113 $this->$cmd();
114 }
115 $this->main_tpl->printToStdout();
116 break;
117 }
118 }
Class ilBadgeProfileGUI.
Learning history main GUI class.
Class ilObjUserTrackingGUI.
Personal skills GUI class.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References $ctrl, $lng, $main_tpl, ilUtil\getImagePath(), and ilLearningProgressBaseGUI\LP_CONTEXT_PERSONAL_DESKTOP.

+ Here is the call graph for this function:

◆ getGUIClasses()

ilAchievementsGUI::getGUIClasses ( )
protected

Get GUI class.

Parameters

return

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

194 {
195 $gui_classes = [
196 ilAchievements::SERV_LEARNING_HISTORY => "ilLearningHistoryGUI",
197 ilAchievements::SERV_COMPETENCES => "ilpersonalskillsgui",
198 ilAchievements::SERV_LEARNING_PROGRESS => "illearningprogressgui",
199 ilAchievements::SERV_BADGES => "ilbadgeprofilegui",
200 ilAchievements::SERV_CERTIFICATES => "ilusercertificategui"
201 ];
202
203 return $gui_classes;
204 }

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

Referenced by getLinks(), and show().

+ Here is the caller graph for this function:

◆ getLinks()

ilAchievementsGUI::getLinks ( )
protected

Get link.

Parameters

return

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

155 {
158
159 $lng->loadLanguageModule("lhist");
160 $gui_classes = $this->getGUIClasses();
161
162 $links = [
164 "txt" => $lng->txt("lhist_learning_history")
165 ],
167 "txt" => $lng->txt("skills")
168 ],
170 "txt" => $lng->txt("learning_progress")
171 ],
173 "txt" => $lng->txt('obj_bdga')
174 ],
176 "txt" => $lng->txt("obj_cert")
177 ]
178 ];
179
180 foreach ($links as $k => $v) {
181 $links[$k]["link"] = $ctrl->getLinkTargetByClass(["ildashboardgui", "ilachievementsgui", $gui_classes[$k]]);
182 }
183
184 return $links;
185 }

References $ctrl, $lng, getGUIClasses(), ilAchievements\SERV_BADGES, ilAchievements\SERV_CERTIFICATES, ilAchievements\SERV_COMPETENCES, ilAchievements\SERV_LEARNING_HISTORY, and ilAchievements\SERV_LEARNING_PROGRESS.

Referenced by setTabs().

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

◆ setTabs()

ilAchievementsGUI::setTabs (   $activate)
protected

Set tabs.

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

138 {
140 $links = $this->getLinks();
141
142 foreach ($this->achievements->getActiveServices() as $s) {
143 $tabs->addTab("achieve_" . $s, $links[$s]["txt"], $links[$s]["link"]);
144 }
145 $tabs->activateTab("achieve_" . $activate);
146 }

References $tabs, and getLinks().

+ Here is the call graph for this function:

◆ show()

ilAchievementsGUI::show ( )
protected

Show (redirects to first active service)

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

124 {
126
127 $gui_classes = $this->getGUIClasses();
128 $first_service = current($this->achievements->getActiveServices());
129 if ($first_service) {
130 $ctrl->redirectByClass(["ildashboardgui", "ilachievementsgui", $gui_classes[$first_service]]);
131 }
132 }

References $ctrl, and getGUIClasses().

+ Here is the call graph for this function:

Field Documentation

◆ $achievements

ilAchievementsGUI::$achievements
protected

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

◆ $ctrl

ilAchievementsGUI::$ctrl
protected

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

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

◆ $lng

ilAchievementsGUI::$lng
protected

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

Referenced by executeCommand(), and getLinks().

◆ $main_tpl

ilAchievementsGUI::$main_tpl
private

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

Referenced by executeCommand().

◆ $tabs

ilAchievementsGUI::$tabs
protected

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

Referenced by setTabs().


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