49 $this->
ctrl = $DIC->ctrl();
50 $this->
lng = $DIC->language();
51 $this->tpl = $DIC[
"tpl"];
52 $this->
tabs = $DIC->tabs();
53 $this->
user = $DIC->user();
54 $this->
access = $DIC->access();
55 $this->factory = $DIC->ui()->factory();
56 $this->renderer = $DIC->ui()->renderer();
79 switch ($ilCtrl->getNextClass()) {
82 $cmd = $ilCtrl->getCmd(
"listBadges");
103 $lng->
txt(
"badge_profile_view"),
104 $ilCtrl->getLinkTarget($this,
"listBadges")
108 $lng->
txt(
"badge_profile_manage"),
109 $ilCtrl->getLinkTarget($this,
"manageBadges")
111 $ilTabs->activateTab($a_active);
116 $this->tpl->setContent($this->
renderDeck($this->tile_view->show()));
117 $this->noti_repo->updateLastCheckedTimestamp();
122 $template =
new ilTemplate(
'tpl.badge_backpack.html',
true,
true,
'Services/Badge');
123 $template->setVariable(
'DECK', $deck);
124 return $template->get();
133 $this->tpl->setContent($table->getHTML());
142 $ids = $this->request->getBadgeIds();
143 if (count($ids) > 0) {
145 foreach ($ids as
$id) {
147 if ($ass->getTimestamp()) {
155 $this->tpl->setOnScreenMessage(
'failure', $lng->
txt(
"select_one"),
true);
156 $ilCtrl->redirect($this,
"manageBadges");
167 if (!$ass->getPosition()) {
168 $ass->setPosition(999);
173 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"position_updated"),
true);
174 $ilCtrl->
redirect($this,
"manageBadges");
184 if ($ass->getPosition()) {
185 $ass->setPosition(null);
190 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"position_updated"),
true);
191 $ilCtrl->
redirect($this,
"manageBadges");
201 if (!$ass->getPosition()) {
202 $ass->setPosition(999);
207 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"position_updated"),
true);
208 $ilCtrl->
redirect($this,
"listBadges");
218 if ($ass->getPosition()) {
219 $ass->setPosition(null);
224 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"position_updated"),
true);
225 $ilCtrl->
redirect($this,
"listBadges");
236 $lng->
txt(
"obj_bdga"),
237 $ilCtrl->getLinkTarget($this,
"listBackpackGroups")
242 $lng->
txt(
"settings"),
243 $ilCtrl->getLinkTarget($this,
"editSettings")
246 $ilTabs->activateTab(
"backpack_badges");
257 $ilTabs->activateSubTab(
"backpack_badges");
259 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"badge_backpack_gallery_info"));
262 $bp_groups = $bp->getGroups();
264 if (!count($bp_groups)) {
265 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"badge_backpack_no_groups"));
269 $tmpl =
new ilTemplate(
"tpl.badge_backpack.html",
true,
true,
"Services/Badge");
271 $tmpl->setVariable(
"BACKPACK_TITLE", $lng->
txt(
"badge_backpack_list"));
275 foreach ($bp_groups as $group_id => $group) {
276 $bp_badges = $bp->getBadges($group_id);
277 if (count($bp_badges)) {
278 foreach ($bp_badges as $idx => $badge) {
279 $tmpl->setCurrentBlock(
"badge_bl");
280 $tmpl->setVariable(
"BADGE_TITLE", $badge[
"title"]);
281 $tmpl->setVariable(
"BADGE_DESC", $badge[
"description"]);
282 $tmpl->setVariable(
"BADGE_IMAGE", $badge[
"image_url"]);
283 $tmpl->setVariable(
"BADGE_CRITERIA", $badge[
"criteria_url"]);
284 $tmpl->setVariable(
"BADGE_ISSUER", $badge[
"issuer_name"]);
285 $tmpl->setVariable(
"BADGE_ISSUER_URL", $badge[
"issuer_url"]);
287 $tmpl->parseCurrentBlock();
291 $tmpl->setCurrentBlock(
"group_bl");
292 $tmpl->setVariable(
"GROUP_TITLE", $group[
"title"]);
293 $tmpl->parseCurrentBlock();
307 $mail = $ilUser->
getPref(self::BACKPACK_EMAIL);
309 $mail = $ilUser->getEmail();
320 $form->setFormAction($ilCtrl->getFormAction($this,
"saveSettings"));
321 $form->setTitle($lng->
txt(
"settings"));
325 $email->
setInfo($lng->
txt(
"badge_backpack_email_info"));
327 $form->addItem($email);
329 $form->addCommandButton(
"saveSettings", $lng->
txt(
"save"));
340 $ilCtrl->redirect($this,
"listBadges");
350 if ($form->checkInput()) {
351 $new_email = $form->getInput(
"email");
357 if ($new_email != $old_email) {
361 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"settings_saved"),
true);
362 $ilCtrl->redirect($this,
"editSettings");
365 $form->setValuesByPost();
ILIAS UI Renderer $renderer
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
BadgeNotificationPrefRepository $noti_repo
getSubTabs(string $a_active)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
loadLanguageModule(string $a_module)
Load language module.
Badge notification repository (using user preferences.
editSettings(ilPropertyFormGUI $a_form=null)
setContent(string $a_html)
Sets content for standard template.
final const BACKPACK_EMAIL
getPref(string $a_keyword)
ilGlobalTemplateInterface $tpl
ILIAS UI Factory $factory
TableGUI class for user badge listing.
static clearBadgeCache(int $a_user_id)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static _writePref(int $a_usr_id, string $a_keyword, string $a_value)
ilBadgeGUIRequest $request
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
readonly TileView $tile_view
static setUseRelativeDates(bool $a_status)
set use relative dates