ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilAchievementsGUI::__construct ( )

Constructor.

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

39 {
40 global $DIC;
41 $this->ctrl = $DIC->ctrl();
42 $this->achievements = new ilAchievements();
43 $this->lng = $DIC->language();
44 $this->tabs = $DIC->tabs();
45 $this->main_tpl = $DIC->ui()->mainTemplate();
46 }
Maybe a separate service in the future.
global $DIC
Definition: saml.php:7

References $DIC.

Member Function Documentation

◆ executeCommand()

ilAchievementsGUI::executeCommand ( )

Execute command.

Exceptions
ilCtrlException

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

53 {
55 $main_tpl = $this->main_tpl;
57
58 $next_class = $ctrl->getNextClass($this);
59 $cmd = $ctrl->getCmd("show");
60
61 $main_tpl->setTitle($lng->txt("pd_achievements"));
62 $main_tpl->setTitleIcon(ilUtil::getImagePath("icon_lhist.svg")); // needs a final decision
63
64 switch ($next_class) {
65 case "illearningprogressgui":
67 include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
69 $ctrl->forwardCommand($new_gui);
70 break;
71
72 case 'illearninghistorygui':
74 $lhistgui = new ilLearningHistoryGUI();
75 $ctrl->forwardCommand($lhistgui);
76 $this->main_tpl->show();
77 break;
78
79 case 'ilpersonalskillsgui':
81 include_once './Services/Skill/classes/class.ilPersonalSkillsGUI.php';
82 $skgui = new ilPersonalSkillsGUI();
83 $ctrl->forwardCommand($skgui);
84 $this->main_tpl->show();
85 break;
86
87 case 'ilbadgeprofilegui':
89 include_once './Services/Badge/classes/class.ilBadgeProfileGUI.php';
90 $bgui = new ilBadgeProfileGUI();
91 $ctrl->forwardCommand($bgui);
92 $this->main_tpl->show();
93 break;
94
95 case 'ilusercertificategui':
97 $cgui = new ilUserCertificateGUI();
98 $ctrl->forwardCommand($cgui);
99 $this->main_tpl->show();
100 break;
101
102 default:
103 if (in_array($cmd, array("show"))) {
104 $this->$cmd();
105 }
106 $this->main_tpl->show();
107 break;
108 }
109 }
setTabs($activate)
Set tabs.
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, ilUtil\getImagePath(), ilLearningProgressBaseGUI\LP_CONTEXT_PERSONAL_DESKTOP, ilAchievements\SERV_BADGES, ilAchievements\SERV_CERTIFICATES, ilAchievements\SERV_COMPETENCES, ilAchievements\SERV_LEARNING_HISTORY, ilAchievements\SERV_LEARNING_PROGRESS, and setTabs().

+ Here is the call graph for this function:

◆ getGUIClasses()

ilAchievementsGUI::getGUIClasses ( )
protected

Get GUI class.

Parameters

return

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

185 {
186 $gui_classes = [
187 ilAchievements::SERV_LEARNING_HISTORY => "ilLearningHistoryGUI",
188 ilAchievements::SERV_COMPETENCES => "ilpersonalskillsgui",
189 ilAchievements::SERV_LEARNING_PROGRESS => "illearningprogressgui",
190 ilAchievements::SERV_BADGES => "ilbadgeprofilegui",
191 ilAchievements::SERV_CERTIFICATES => "ilusercertificategui"
192 ];
193
194 return $gui_classes;
195 }

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 145 of file class.ilAchievementsGUI.php.

146 {
149
150 $lng->loadLanguageModule("lhist");
151 $gui_classes = $this->getGUIClasses();
152
153 $links = [
155 "txt" => $lng->txt("lhist_learning_history")
156 ],
158 "txt" => $lng->txt("skills")
159 ],
161 "txt" => $lng->txt("learning_progress")
162 ],
164 "txt" => $lng->txt('obj_bdga')
165 ],
167 "txt" => $lng->txt("obj_cert")
168 ]
169 ];
170
171 foreach ($links as $k => $v) {
172 $links[$k]["link"] = $ctrl->getLinkTargetByClass(["ilpersonaldesktopgui", "ilachievementsgui", $gui_classes[$k]]);
173 }
174
175 return $links;
176 }
$links

References $ctrl, $links, $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 128 of file class.ilAchievementsGUI.php.

129 {
131 $links = $this->getLinks();
132
133 foreach ($this->achievements->getActiveServices() as $s) {
134 $tabs->addTab("achieve_" . $s, $links[$s]["txt"], $links[$s]["link"]);
135 }
136 $tabs->activateTab("achieve_" . $activate);
137 }
$s
Definition: pwgen.php:45

References $links, $s, $tabs, and getLinks().

Referenced by executeCommand().

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

◆ show()

ilAchievementsGUI::show ( )
protected

Show (redirects to first active service)

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

115 {
117
118 $gui_classes = $this->getGUIClasses();
119 $first_service = current($this->achievements->getActiveServices());
120 if ($first_service) {
121 $ctrl->redirectByClass(["ilpersonaldesktopgui", "ilachievementsgui", $gui_classes[$first_service]]);
122 }
123 }

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().

◆ $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: