ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilObjBadgeAdministrationGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Object/classes/class.ilObjectGUI.php");
5 include_once("./Services/Badge/classes/class.ilBadgeHandler.php");
6 
19 {
23  protected $rbacsystem;
24 
28  protected $access;
29 
33  protected $toolbar;
34 
38  protected $tabs;
39 
40  public function __construct($a_data, $a_id, $a_call_by_reference = true, $a_prepare_output = true)
41  {
42  global $DIC;
43 
44  $this->rbacsystem = $DIC->rbac()->system();
45  $this->ctrl = $DIC->ctrl();
46  $this->access = $DIC->access();
47  $this->lng = $DIC->language();
48  $this->toolbar = $DIC->toolbar();
49  $this->tpl = $DIC["tpl"];
50  $this->tabs = $DIC->tabs();
51  $this->type = "bdga";
52  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
53 
54  $this->lng->loadLanguageModule("badge");
55  }
56 
57  public function executeCommand()
58  {
59  $next_class = $this->ctrl->getNextClass($this);
60  $cmd = $this->ctrl->getCmd();
61 
62  $this->prepareOutput();
63 
64  switch ($next_class) {
65  case 'ilpermissiongui':
66  $this->tabs_gui->setTabActive('perm_settings');
67  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
68  $perm_gui = new ilPermissionGUI($this);
69  $this->ctrl->forwardCommand($perm_gui);
70  break;
71 
72  case 'ilbadgemanagementgui':
73  $this->assertActive();
74  $this->tabs_gui->setTabActive('activity');
75  include_once "Services/Badge/classes/class.ilBadgeManagementGUI.php";
76  $gui = new ilBadgeManagementGUI($this->ref_id, $this->obj_id, $this->type);
77  $this->ctrl->forwardCommand($gui);
78  break;
79 
80  default:
81  if (!$cmd || $cmd == 'view') {
82  $cmd = "editSettings";
83  }
84 
85  $this->$cmd();
86  break;
87  }
88  return true;
89  }
90 
91  public function getAdminTabs()
92  {
94 
95  if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
96  $this->tabs_gui->addTab(
97  "settings",
98  $this->lng->txt("settings"),
99  $this->ctrl->getLinkTarget($this, "editSettings")
100  );
101 
102  if (ilBadgeHandler::getInstance()->isActive()) {
103  $this->tabs_gui->addTab(
104  "types",
105  $this->lng->txt("badge_types"),
106  $this->ctrl->getLinkTarget($this, "listTypes")
107  );
108 
109  $this->tabs_gui->addTab(
110  "imgtmpl",
111  $this->lng->txt("badge_image_templates"),
112  $this->ctrl->getLinkTarget($this, "listImageTemplates")
113  );
114 
115  $this->tabs_gui->addTab(
116  "activity",
117  $this->lng->txt("badge_activity_badges"),
118  $this->ctrl->getLinkTargetByClass("ilbadgemanagementgui", "")
119  );
120 
121  $this->tabs_gui->addTab(
122  "obj_badges",
123  $this->lng->txt("badge_object_badges"),
124  $this->ctrl->getLinkTarget($this, "listObjectBadges")
125  );
126  }
127  }
128 
129  if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
130  $this->tabs_gui->addTab(
131  "perm_settings",
132  $this->lng->txt("perm_settings"),
133  $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm")
134  );
135  }
136  }
137 
138  protected function assertActive()
139  {
140  if (!ilBadgeHandler::getInstance()->isActive()) {
141  $this->ctrl->redirect($this, "editSettings");
142  }
143  }
144 
145 
146  //
147  // settings
148  //
149 
150  protected function editSettings($a_form = null)
151  {
152  $this->tabs_gui->setTabActive("settings");
153 
154  if (!$a_form) {
155  $a_form = $this->initFormSettings();
156  }
157 
158  $this->tpl->setContent($a_form->getHTML());
159  }
160 
161  protected function saveSettings()
162  {
164 
165  $this->checkPermission("write");
166 
167  $form = $this->initFormSettings();
168  if ($form->checkInput()) {
169  $obi = (bool) $form->getInput("act")
170  ? (bool) $form->getInput("obi")
171  : null;
172 
174  $handler->setActive((bool) $form->getInput("act"));
175  $handler->setObiActive($obi);
176  $handler->setObiOrganisation(trim($form->getInput("obi_org")));
177  $handler->setObiContact(trim($form->getInput("obi_cont")));
178  $handler->setObiSalt(trim($form->getInput("obi_salt")));
179 
180  $handler->rebuildIssuerStaticUrl();
181 
182  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
183  $ilCtrl->redirect($this, "editSettings");
184  }
185 
186  $form->setValuesByPost();
187  $this->editSettings($form);
188  }
189 
190  protected function initFormSettings()
191  {
192  $ilAccess = $this->access;
193 
194  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
195  $form = new ilPropertyFormGUI();
196  $form->setFormAction($this->ctrl->getFormAction($this));
197  $form->setTitle($this->lng->txt("badge_settings"));
198 
199  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
200  $form->addCommandButton("saveSettings", $this->lng->txt("save"));
201  $form->addCommandButton("editSettings", $this->lng->txt("cancel"));
202  }
203 
204  $act = new ilCheckboxInputGUI($this->lng->txt("badge_service_activate"), "act");
205  $act->setInfo($this->lng->txt("badge_service_activate_info"));
206  $form->addItem($act);
207 
208  /* see bug #0020124
209  $obi = new ilCheckboxInputGUI($this->lng->txt("badge_obi_activate"), "obi");
210  $obi->setInfo($this->lng->txt("badge_obi_activate_info"));
211  $form->addItem($obi);
212 
213  $obi_org = new ilTextInputGUI($this->lng->txt("badge_obi_organisation"), "obi_org");
214  $obi_org->setRequired(true);
215  $obi_org->setInfo($this->lng->txt("badge_obi_organisation_info"));
216  $obi->addSubItem($obi_org);
217 
218  $obi_contact = new ilEmailInputGUI($this->lng->txt("badge_obi_contact"), "obi_cont");
219  $obi_contact->setRequired(true);
220  $obi_contact->setInfo($this->lng->txt("badge_obi_contact_info"));
221  $obi->addSubItem($obi_contact);
222 
223  $obi_salt = new ilTextInputGUI($this->lng->txt("badge_obi_salt"), "obi_salt");
224  $obi_salt->setRequired(true);
225  $obi_salt->setInfo($this->lng->txt("badge_obi_salt_info"));
226  $obi->addSubItem($obi_salt);
227  */
228 
230  $act->setChecked($handler->isActive());
231 
232  /* see bug 0020124
233  $obi->setChecked($handler->isObiActive());
234  $obi_org->setValue($handler->getObiOrganistation());
235  $obi_contact->setValue($handler->getObiContact());
236  $obi_salt->setValue($handler->getObiSalt());
237  */
238 
239  return $form;
240  }
241 
242 
243  //
244  // types
245  //
246 
247  protected function listTypes()
248  {
249  $ilAccess = $this->access;
250 
251  $this->assertActive();
252  $this->tabs_gui->setTabActive("types");
253 
254  include_once "Services/Badge/classes/class.ilBadgeTypesTableGUI.php";
256  $this,
257  "listTypes",
258  $ilAccess->checkAccess("write", "", $this->object->getRefId())
259  );
260  $this->tpl->setContent($tbl->getHTML());
261  }
262 
263  protected function activateTypes()
264  {
265  $lng = $this->lng;
266 
267  $this->assertActive();
268 
269  $ids = $_POST["id"];
270  if ($this->checkPermissionBool("write") && is_array($ids) && count($ids) > 0) {
272  $inactive = array();
273  foreach ($handler->getInactiveTypes() as $type) {
274  if (!in_array($type, $ids)) {
275  $inactive[] = $type;
276  }
277  }
278  $handler->setInactiveTypes($inactive);
279 
280  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
281  }
282  $this->ctrl->redirect($this, "listTypes");
283  }
284 
285  protected function deactivateTypes()
286  {
287  $lng = $this->lng;
288 
289  $this->assertActive();
290 
291  $ids = $_POST["id"];
292  if ($this->checkPermissionBool("write") && is_array($ids) && count($ids) > 0) {
294  $inactive = array_merge($handler->getInactiveTypes(), $ids);
295  $handler->setInactiveTypes($inactive);
296 
297  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
298  }
299  $this->ctrl->redirect($this, "listTypes");
300  }
301 
302 
303  //
304  // images templates
305  //
306 
307  protected function listImageTemplates()
308  {
309  $ilAccess = $this->access;
310  $lng = $this->lng;
311  $ilToolbar = $this->toolbar;
313 
314  $this->assertActive();
315  $this->tabs_gui->setTabActive("imgtmpl");
316 
317  if ($this->checkPermissionBool("write")) {
318  $ilToolbar->addButton(
319  $lng->txt("badge_add_template"),
320  $ilCtrl->getLinkTarget($this, "addImageTemplate")
321  );
322  }
323 
324  include_once "Services/Badge/classes/class.ilBadgeImageTemplateTableGUI.php";
326  $this,
327  "listImageTemplates",
328  $ilAccess->checkAccess("write", "", $this->object->getRefId())
329  );
330  $this->tpl->setContent($tbl->getHTML());
331  }
332 
333  protected function addImageTemplate(ilPropertyFormGUI $a_form = null)
334  {
335  $tpl = $this->tpl;
336 
337  $this->checkPermission("write");
338 
339  $this->assertActive();
340  $this->tabs_gui->setTabActive("imgtmpl");
341 
342  if (!$a_form) {
343  $a_form = $this->initImageTemplateForm("create");
344  }
345 
346  $tpl->setContent($a_form->getHTML());
347  }
348 
349  protected function initImageTemplateForm($a_mode)
350  {
351  $lng = $this->lng;
353 
354  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
355  $form = new ilPropertyFormGUI();
356  $form->setFormAction($ilCtrl->getFormAction($this, "saveBadge"));
357  $form->setTitle($lng->txt("badge_image_template_form"));
358 
359  $title = new ilTextInputGUI($lng->txt("title"), "title");
360  $title->setRequired(true);
361  $form->addItem($title);
362 
363  $img = new ilImageFileInputGUI($lng->txt("image"), "img");
364  $img->setSuffixes(array("png", "svg"));
365  if ($a_mode == "create") {
366  $img->setRequired(true);
367  }
368  $img->setALlowDeletion(false);
369  $form->addItem($img);
370 
371  $types_mode = new ilRadioGroupInputGUI($lng->txt("badge_template_types"), "tmode");
372  $types_mode->setRequired(true);
373  $form->addItem($types_mode);
374 
375  $type_all = new ilRadioOption($lng->txt("badge_template_types_all"), "all");
376  $types_mode->addOption($type_all);
377 
378  $type_spec = new ilRadioOption($lng->txt("badge_template_types_specific"), "spec");
379  $types_mode->addOption($type_spec);
380 
381  $types = new ilCheckboxGroupInputGUI($lng->txt("badge_types"), "type");
382  $types->setRequired(true);
383  $type_spec->addSubItem($types);
384 
385  foreach (ilBadgeHandler::getInstance()->getAvailableTypes() as $id => $type) {
386  $types->addOption(new ilCheckboxOption($type->getCaption(), $id));
387  }
388 
389  if ($a_mode == "create") {
390  $form->addCommandButton("saveImageTemplate", $lng->txt("save"));
391  } else {
392  $form->addCommandButton("updateImageTemplate", $lng->txt("save"));
393  }
394  $form->addCommandButton("listImageTemplates", $lng->txt("cancel"));
395 
396  return $form;
397  }
398 
399  protected function saveImageTemplate()
400  {
402  $lng = $this->lng;
403 
404  $this->checkPermission("write");
405 
406  $form = $this->initImageTemplateForm("create");
407  if ($form->checkInput()) {
408  include_once "Services/Badge/classes/class.ilBadgeImageTemplate.php";
409  $tmpl = new ilBadgeImageTemplate();
410  $tmpl->setTitle($form->getInput("title"));
411  $tmpl->setTypes($form->getInput("type"));
412  $tmpl->create();
413 
414  $tmpl->uploadImage($_FILES["img"]);
415 
416  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
417  $ilCtrl->redirect($this, "listImageTemplates");
418  }
419 
420  $form->setValuesByPost();
421  $this->addImageTemplate($form);
422  }
423 
424  protected function editImageTemplate(ilPropertyFormGUI $a_form = null)
425  {
427  $tpl = $this->tpl;
428 
429  $this->checkPermission("write");
430 
431  $this->assertActive();
432  $this->tabs_gui->setTabActive("imgtmpl");
433 
434  $tmpl_id = $_REQUEST["tid"];
435  if (!$tmpl_id) {
436  $ilCtrl->redirect($this, "listImageTemplates");
437  }
438 
439  $ilCtrl->setParameter($this, "tid", $tmpl_id);
440 
441  include_once "Services/Badge/classes/class.ilBadgeImageTemplate.php";
442  $tmpl = new ilBadgeImageTemplate($tmpl_id);
443 
444  if (!$a_form) {
445  $a_form = $this->initImageTemplateForm("edit");
446  $this->setImageTemplateFormValues($a_form, $tmpl);
447  }
448 
449  $tpl->setContent($a_form->getHTML());
450  }
451 
453  {
454  $a_form->getItemByPostVar("title")->setValue($a_tmpl->getTitle());
455  $a_form->getItemByPostVar("img")->setImage($a_tmpl->getImagePath());
456  $a_form->getItemByPostVar("img")->setValue($a_tmpl->getImage());
457 
458  if ($a_tmpl->getTypes()) {
459  $a_form->getItemByPostVar("tmode")->setValue("spec");
460  $a_form->getItemByPostVar("type")->setValue($a_tmpl->getTypes());
461  } else {
462  $a_form->getItemByPostVar("tmode")->setValue("all");
463  }
464  }
465 
466  protected function updateImageTemplate()
467  {
469  $lng = $this->lng;
470 
471  $this->checkPermission("write");
472 
473  $tmpl_id = $_REQUEST["tid"];
474  if (!$tmpl_id) {
475  $ilCtrl->redirect($this, "listImageTemplates");
476  }
477 
478  $ilCtrl->setParameter($this, "tid", $tmpl_id);
479 
480  include_once "Services/Badge/classes/class.ilBadgeImageTemplate.php";
481  $tmpl = new ilBadgeImageTemplate($tmpl_id);
482 
483  $form = $this->initImageTemplateForm("update");
484  if ($form->checkInput()) {
485  $tmpl->setTitle($form->getInput("title"));
486 
487  if ($form->getInput("tmode") != "all") {
488  $tmpl->setTypes($form->getInput("type"));
489  } else {
490  $tmpl->setTypes(null);
491  }
492 
493  $tmpl->update();
494 
495  $tmpl->uploadImage($_FILES["img"]);
496 
497  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
498  $ilCtrl->redirect($this, "listImageTemplates");
499  }
500 
501  $this->setImageTemplateFormValues($form, $tmpl);
502  $form->setValuesByPost();
503  $this->editImageTemplate($form);
504  }
505 
506  protected function confirmDeleteImageTemplates()
507  {
509  $lng = $this->lng;
510  $tpl = $this->tpl;
511  $ilTabs = $this->tabs;
512 
513  $this->checkPermission("write");
514 
515  $tmpl_ids = $_REQUEST["id"];
516  if (!$tmpl_ids) {
517  $ilCtrl->redirect($this, "listImageTemplates");
518  }
519 
520  $ilTabs->clearTargets();
521  $ilTabs->setBackTarget(
522  $lng->txt("back"),
523  $ilCtrl->getLinkTarget($this, "listImageTemplates")
524  );
525 
526  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
527  $confirmation_gui = new ilConfirmationGUI();
528  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
529  $confirmation_gui->setHeaderText($lng->txt("badge_template_deletion_confirmation"));
530  $confirmation_gui->setCancel($lng->txt("cancel"), "listImageTemplates");
531  $confirmation_gui->setConfirm($lng->txt("delete"), "deleteImageTemplates");
532 
533  include_once("./Services/Badge/classes/class.ilBadgeImageTemplate.php");
534  foreach ($tmpl_ids as $tmpl_id) {
535  $tmpl = new ilBadgeImageTemplate($tmpl_id);
536  $confirmation_gui->addItem("id[]", $tmpl_id, $tmpl->getTitle());
537  }
538 
539  $tpl->setContent($confirmation_gui->getHTML());
540  }
541 
542  protected function deleteImageTemplates()
543  {
545  $lng = $this->lng;
546 
547  $this->checkPermission("write");
548 
549  $tmpl_ids = $_REQUEST["id"];
550  if ($tmpl_ids) {
551  include_once("./Services/Badge/classes/class.ilBadgeImageTemplate.php");
552  foreach ($tmpl_ids as $tmpl_id) {
553  $tmpl = new ilBadgeImageTemplate($tmpl_id);
554  $tmpl->delete();
555  }
556 
557  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
558  }
559 
560  $ilCtrl->redirect($this, "listImageTemplates");
561  }
562 
563 
564  //
565  // object badges
566  //
567 
568  protected function listObjectBadges()
569  {
570  $ilAccess = $this->access;
571  $tpl = $this->tpl;
572 
573  $this->assertActive();
574  $this->tabs_gui->setTabActive("obj_badges");
575 
576  include_once("./Services/Badge/classes/class.ilObjectBadgeTableGUI.php");
578  $this,
579  "listObjectBadges",
580  $ilAccess->checkAccess("write", "", $this->object->getRefId())
581  );
582  $tpl->setContent($tbl->getHTML());
583  }
584 
585  protected function applyObjectFilter()
586  {
587  $ilAccess = $this->access;
588 
589  include_once "Services/Badge/classes/class.ilObjectBadgeTableGUI.php";
591  $this,
592  "listObjectBadges",
593  $ilAccess->checkAccess("write", "", $this->object->getRefId())
594  );
595  $tbl->resetOffset();
596  $tbl->writeFilterToSession();
597  $this->listObjectBadges();
598  }
599 
600  protected function resetObjectFilter()
601  {
602  $ilAccess = $this->access;
603 
604  include_once "Services/Badge/classes/class.ilObjectBadgeTableGUI.php";
606  $this,
607  "listObjectBadges",
608  $ilAccess->checkAccess("write", "", $this->object->getRefId())
609  );
610  $tbl->resetOffset();
611  $tbl->resetFilter();
612  $this->listObjectBadges();
613  }
614 
615  protected function listObjectBadgeUsers()
616  {
618  $lng = $this->lng;
619  $tpl = $this->tpl;
620 
621  $parent_obj_id = $_REQUEST["pid"];
622  if (!$parent_obj_id) {
623  $ilCtrl->redirect($this, "listObjectBadges");
624  }
625 
626  $this->assertActive();
627 
628  $this->tabs_gui->clearTargets();
629  $this->tabs_gui->setBackTarget(
630  $lng->txt("back"),
631  $ilCtrl->getLinkTarget($this, "listObjectBadges")
632  );
633 
634  $ilCtrl->saveParameter($this, "pid");
635 
636  include_once "Services/Badge/classes/class.ilBadgeUserTableGUI.php";
637  $tbl = new ilBadgeUserTableGUI($this, "listUsers", null, null, $parent_obj_id, (int) $_REQUEST["bid"]);
638  $tpl->setContent($tbl->getHTML());
639  }
640 
641  protected function applyUserFilter()
642  {
643  include_once "Services/Badge/classes/class.ilBadgeUserTableGUI.php";
644  $tbl = new ilBadgeUserTableGUI($this, "listUsers", null, null, $parent_obj_id, (int) $_REQUEST["bid"]);
645  $tbl->resetOffset();
646  $tbl->writeFilterToSession();
647  $this->listObjectBadgeUsers();
648  }
649 
650  protected function resetUserFilter()
651  {
652  include_once "Services/Badge/classes/class.ilBadgeUserTableGUI.php";
653  $tbl = new ilBadgeUserTableGUI($this, "listUsers", null, null, $parent_obj_id, (int) $_REQUEST["bid"]);
654  $tbl->resetOffset();
655  $tbl->resetFilter();
656  $this->listObjectBadgeUsers();
657  }
658 
659 
660  //
661  // see ilBadgeManagementGUI
662  //
663 
664  protected function getObjectBadgesFromMultiAction()
665  {
666  $ilAccess = $this->access;
668 
669  $badge_ids = $_REQUEST["id"];
670  if (!$badge_ids ||
671  !$ilAccess->checkAccess("write", "", $this->object->getRefId())) {
672  $ilCtrl->redirect($this, "listObjectBadges");
673  }
674 
675  return $badge_ids;
676  }
677 
678  protected function toggleObjectBadges($a_status)
679  {
681  $lng = $this->lng;
682 
683  $badge_ids = $this->getObjectBadgesFromMultiAction();
684 
685  include_once "Services/Badge/classes/class.ilBadge.php";
686  foreach ($badge_ids as $badge_id) {
687  $badge = new ilBadge($badge_id);
688  $badge->setActive($a_status);
689  $badge->update();
690  }
691 
692  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
693  $ilCtrl->redirect($this, "listObjectBadges");
694  }
695 
696  protected function activateObjectBadges()
697  {
698  $this->toggleObjectBadges(true);
699  }
700 
701  protected function deactivateObjectBadges()
702  {
703  $this->toggleObjectBadges(false);
704  }
705 
706  protected function confirmDeleteObjectBadges()
707  {
709  $lng = $this->lng;
710  $tpl = $this->tpl;
711  $ilTabs = $this->tabs;
712 
713  $badge_ids = $this->getObjectBadgesFromMultiAction();
714 
715  $ilTabs->clearTargets();
716  $ilTabs->setBackTarget(
717  $lng->txt("back"),
718  $ilCtrl->getLinkTarget($this, "listObjectBadges")
719  );
720 
721  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
722  $confirmation_gui = new ilConfirmationGUI();
723  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
724  $confirmation_gui->setHeaderText($lng->txt("badge_deletion_confirmation"));
725  $confirmation_gui->setCancel($lng->txt("cancel"), "listObjectBadges");
726  $confirmation_gui->setConfirm($lng->txt("delete"), "deleteObjectBadges");
727 
728  include_once "Services/Badge/classes/class.ilBadge.php";
729  include_once "Services/Badge/classes/class.ilBadgeAssignment.php";
730  foreach ($badge_ids as $badge_id) {
731  $badge = new ilBadge($badge_id);
732  $parent = $badge->getParentMeta();
733 
734  // :TODO: container presentation
735  $container = "(" . $parent["type"] . "/" .
736  $parent["id"] . ") " .
737  $parent["title"];
738  if ((bool) $parent["deleted"]) {
739  $container .= ' <span class="il_ItemAlertProperty">' . $lng->txt("deleted") . '</span>';
740  }
741 
742  $confirmation_gui->addItem(
743  "id[]",
744  $badge_id,
745  $container . " - " .
746  $badge->getTitle() .
747  " (" . sizeof(ilBadgeAssignment::getInstancesByBadgeId($badge_id)) . ")"
748  );
749  }
750 
751  $tpl->setContent($confirmation_gui->getHTML());
752  }
753 
754  protected function deleteObjectBadges()
755  {
757  $lng = $this->lng;
758 
759  $badge_ids = $this->getObjectBadgesFromMultiAction();
760 
761  include_once "Services/Badge/classes/class.ilBadge.php";
762  foreach ($badge_ids as $badge_id) {
763  $badge = new ilBadge($badge_id);
764  $badge->delete();
765  }
766 
767  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
768  $ilCtrl->redirect($this, "listObjectBadges");
769  }
770 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
This class represents an option in a radio group.
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
getItemByPostVar($a_post_var)
Get Item by POST variable.
This class represents an option in a checkbox group.
This class represents a property form user interface.
$type
global $DIC
Definition: saml.php:7
$tbl
Definition: example_048.php:81
if(!array_key_exists('StateId', $_REQUEST)) $id
This class represents a checkbox property in a property form.
setImageTemplateFormValues(ilPropertyFormGUI $a_form, ilBadgeImageTemplate $a_tmpl)
$container
Definition: wac.php:13
TableGUI class for badge type listing.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
prepareOutput($a_show_subobjects=true)
prepare output
This class represents a property in a property form.
if(isset($_POST['submit'])) $form
editImageTemplate(ilPropertyFormGUI $a_form=null)
addImageTemplate(ilPropertyFormGUI $a_form=null)
Class ilObjectGUI Basic methods of all Output classes.
This class represents a text property in a property form.
This class represents a property in a property form.
TableGUI class for badge listing.
Create styles array
The data for the language used.
This class represents an image file property in a property form.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
TableGUI class for badge template listing.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$handler
static getInstancesByBadgeId($a_badge_id)
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
$_POST["username"]
TableGUI class for badge user listing.
setRequired($a_required)
Set Required.
Confirmation screen class.
static getInstance()
Constructor.