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.

References $DIC.

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  }
global $DIC
Definition: saml.php:7
Maybe a separate service in the future.

Member Function Documentation

◆ executeCommand()

ilAchievementsGUI::executeCommand ( )

Execute command.

Exceptions
ilCtrlException

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

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

53  {
55  $main_tpl = $this->main_tpl;
56  $lng = $this->lng;
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  }
Learning history main GUI class.
Personal skills GUI class.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
setTabs($activate)
Set tabs.
Class ilObjUserTrackingGUI.
+ Here is the call graph for this function:

◆ getGUIClasses()

ilAchievementsGUI::getGUIClasses ( )
protected

Get GUI class.

Parameters

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

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  }
+ Here is the caller graph for this function:

◆ getLinks()

ilAchievementsGUI::getLinks ( )
protected

Get link.

Parameters

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

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

146  {
147  $ctrl = $this->ctrl;
148  $lng = $this->lng;
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  }
getGUIClasses()
Get GUI class.
$links
+ 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.

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

Referenced by executeCommand().

129  {
130  $tabs = $this->tabs;
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
$links
+ 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.

References $ctrl, and getGUIClasses().

115  {
116  $ctrl = $this->ctrl;
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  }
getGUIClasses()
Get GUI class.
+ 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: