ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjBadgeAdministrationGUI Class Reference

Badge Administration Settings. More...

+ Inheritance diagram for ilObjBadgeAdministrationGUI:
+ Collaboration diagram for ilObjBadgeAdministrationGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 
 executeCommand ()
 
 getAdminTabs ()
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 

Protected Member Functions

 assertActive ()
 
 editSettings ($a_form=null)
 
 saveSettings ()
 
 initFormSettings ()
 
 listTypes ()
 
 activateTypes ()
 
 deactivateTypes ()
 
 listImageTemplates ()
 
 addImageTemplate (ilPropertyFormGUI $a_form=null)
 
 initImageTemplateForm ($a_mode)
 
 saveImageTemplate ()
 
 editImageTemplate (ilPropertyFormGUI $a_form=null)
 
 setImageTemplateFormValues (ilPropertyFormGUI $a_form, ilBadgeImageTemplate $a_tmpl)
 
 updateImageTemplate ()
 
 confirmDeleteImageTemplates ()
 
 deleteImageTemplates ()
 
 listObjectBadges ()
 
 applyObjectFilter ()
 
 resetObjectFilter ()
 
 listObjectBadgeUsers ()
 
 applyUserFilter ()
 
 resetUserFilter ()
 
 getObjectBadgesFromMultiAction ()
 
 toggleObjectBadges ($a_status)
 
 activateObjectBadges ()
 
 deactivateObjectBadges ()
 
 confirmDeleteObjectBadges ()
 
 deleteObjectBadges ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $rbacsystem
 
 $access
 
 $toolbar
 
 $tabs
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjBadgeAdministrationGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference = true,
  $a_prepare_output = true 
)

Definition at line 35 of file class.ilObjBadgeAdministrationGUI.php.

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

36  {
37  global $DIC;
38 
39  $this->rbacsystem = $DIC->rbac()->system();
40  $this->ctrl = $DIC->ctrl();
41  $this->access = $DIC->access();
42  $this->lng = $DIC->language();
43  $this->toolbar = $DIC->toolbar();
44  $this->tpl = $DIC["tpl"];
45  $this->tabs = $DIC->tabs();
46  $this->type = "bdga";
47  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
48 
49  $this->lng->loadLanguageModule("badge");
50  }
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ activateObjectBadges()

ilObjBadgeAdministrationGUI::activateObjectBadges ( )
protected

Definition at line 672 of file class.ilObjBadgeAdministrationGUI.php.

References toggleObjectBadges().

673  {
674  $this->toggleObjectBadges(true);
675  }
+ Here is the call graph for this function:

◆ activateTypes()

ilObjBadgeAdministrationGUI::activateTypes ( )
protected

Definition at line 254 of file class.ilObjBadgeAdministrationGUI.php.

References $_POST, ilObjectGUI\$lng, $type, assertActive(), ilObjectGUI\checkPermissionBool(), and ilBadgeHandler\getInstance().

255  {
256  $lng = $this->lng;
257 
258  $this->assertActive();
259 
260  $ids = $_POST["id"];
261  if ($this->checkPermissionBool("write") && is_array($ids) && count($ids) > 0) {
262  $handler = ilBadgeHandler::getInstance();
263  $inactive = array();
264  foreach ($handler->getInactiveTypes() as $type) {
265  if (!in_array($type, $ids)) {
266  $inactive[] = $type;
267  }
268  }
269  $handler->setInactiveTypes($inactive);
270 
271  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
272  }
273  $this->ctrl->redirect($this, "listTypes");
274  }
$type
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
$_POST["username"]
static getInstance()
Constructor.
+ Here is the call graph for this function:

◆ addImageTemplate()

ilObjBadgeAdministrationGUI::addImageTemplate ( ilPropertyFormGUI  $a_form = null)
protected

Definition at line 323 of file class.ilObjBadgeAdministrationGUI.php.

References ilObjectGUI\$tpl, assertActive(), ilObjectGUI\checkPermission(), and initImageTemplateForm().

Referenced by saveImageTemplate().

324  {
325  $tpl = $this->tpl;
326 
327  $this->checkPermission("write");
328 
329  $this->assertActive();
330  $this->tabs_gui->setTabActive("imgtmpl");
331 
332  if (!$a_form) {
333  $a_form = $this->initImageTemplateForm("create");
334  }
335 
336  $tpl->setContent($a_form->getHTML());
337  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyObjectFilter()

ilObjBadgeAdministrationGUI::applyObjectFilter ( )
protected

Definition at line 567 of file class.ilObjBadgeAdministrationGUI.php.

References $access, and listObjectBadges().

568  {
569  $ilAccess = $this->access;
570 
571  $tbl = new ilObjectBadgeTableGUI(
572  $this,
573  "listObjectBadges",
574  $ilAccess->checkAccess("write", "", $this->object->getRefId())
575  );
576  $tbl->resetOffset();
577  $tbl->writeFilterToSession();
578  $this->listObjectBadges();
579  }
TableGUI class for badge listing.
+ Here is the call graph for this function:

◆ applyUserFilter()

ilObjBadgeAdministrationGUI::applyUserFilter ( )
protected

Definition at line 620 of file class.ilObjBadgeAdministrationGUI.php.

References listObjectBadgeUsers().

621  {
622  $tbl = new ilBadgeUserTableGUI($this, "listUsers", null, null, $parent_obj_id, (int) $_REQUEST["bid"]);
623  $tbl->resetOffset();
624  $tbl->writeFilterToSession();
625  $this->listObjectBadgeUsers();
626  }
TableGUI class for badge user listing.
+ Here is the call graph for this function:

◆ assertActive()

ilObjBadgeAdministrationGUI::assertActive ( )
protected

Definition at line 131 of file class.ilObjBadgeAdministrationGUI.php.

References ilBadgeHandler\getInstance().

Referenced by activateTypes(), addImageTemplate(), deactivateTypes(), editImageTemplate(), executeCommand(), listImageTemplates(), listObjectBadges(), listObjectBadgeUsers(), and listTypes().

132  {
133  if (!ilBadgeHandler::getInstance()->isActive()) {
134  $this->ctrl->redirect($this, "editSettings");
135  }
136  }
static getInstance()
Constructor.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmDeleteImageTemplates()

ilObjBadgeAdministrationGUI::confirmDeleteImageTemplates ( )
protected

Definition at line 492 of file class.ilObjBadgeAdministrationGUI.php.

References ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, $tabs, ilObjectGUI\$tpl, and ilObjectGUI\checkPermission().

493  {
495  $lng = $this->lng;
496  $tpl = $this->tpl;
497  $ilTabs = $this->tabs;
498 
499  $this->checkPermission("write");
500 
501  $tmpl_ids = $_REQUEST["id"];
502  if (!$tmpl_ids) {
503  $ilCtrl->redirect($this, "listImageTemplates");
504  }
505 
506  $ilTabs->clearTargets();
507  $ilTabs->setBackTarget(
508  $lng->txt("back"),
509  $ilCtrl->getLinkTarget($this, "listImageTemplates")
510  );
511 
512  $confirmation_gui = new ilConfirmationGUI();
513  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
514  $confirmation_gui->setHeaderText($lng->txt("badge_template_deletion_confirmation"));
515  $confirmation_gui->setCancel($lng->txt("cancel"), "listImageTemplates");
516  $confirmation_gui->setConfirm($lng->txt("delete"), "deleteImageTemplates");
517 
518  foreach ($tmpl_ids as $tmpl_id) {
519  $tmpl = new ilBadgeImageTemplate($tmpl_id);
520  $confirmation_gui->addItem("id[]", $tmpl_id, $tmpl->getTitle());
521  }
522 
523  $tpl->setContent($confirmation_gui->getHTML());
524  }
global $ilCtrl
Definition: ilias.php:18
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmDeleteObjectBadges()

ilObjBadgeAdministrationGUI::confirmDeleteObjectBadges ( )
protected

Definition at line 682 of file class.ilObjBadgeAdministrationGUI.php.

References $container, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, $tabs, ilObjectGUI\$tpl, ilBadgeAssignment\getInstancesByBadgeId(), and getObjectBadgesFromMultiAction().

683  {
685  $lng = $this->lng;
686  $tpl = $this->tpl;
687  $ilTabs = $this->tabs;
688 
689  $badge_ids = $this->getObjectBadgesFromMultiAction();
690 
691  $ilTabs->clearTargets();
692  $ilTabs->setBackTarget(
693  $lng->txt("back"),
694  $ilCtrl->getLinkTarget($this, "listObjectBadges")
695  );
696 
697  $confirmation_gui = new ilConfirmationGUI();
698  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
699  $confirmation_gui->setHeaderText($lng->txt("badge_deletion_confirmation"));
700  $confirmation_gui->setCancel($lng->txt("cancel"), "listObjectBadges");
701  $confirmation_gui->setConfirm($lng->txt("delete"), "deleteObjectBadges");
702 
703  foreach ($badge_ids as $badge_id) {
704  $badge = new ilBadge($badge_id);
705  $parent = $badge->getParentMeta();
706 
707  // :TODO: container presentation
708  $container = "(" . $parent["type"] . "/" .
709  $parent["id"] . ") " .
710  $parent["title"];
711  if ((bool) $parent["deleted"]) {
712  $container .= ' <span class="il_ItemAlertProperty">' . $lng->txt("deleted") . '</span>';
713  }
714 
715  $confirmation_gui->addItem(
716  "id[]",
717  $badge_id,
718  $container . " - " .
719  $badge->getTitle() .
720  " (" . sizeof(ilBadgeAssignment::getInstancesByBadgeId($badge_id)) . ")"
721  );
722  }
723 
724  $tpl->setContent($confirmation_gui->getHTML());
725  }
$container
Definition: wac.php:13
global $ilCtrl
Definition: ilias.php:18
Class ilBadge.
static getInstancesByBadgeId($a_badge_id)
Confirmation screen class.
+ Here is the call graph for this function:

◆ deactivateObjectBadges()

ilObjBadgeAdministrationGUI::deactivateObjectBadges ( )
protected

Definition at line 677 of file class.ilObjBadgeAdministrationGUI.php.

References toggleObjectBadges().

678  {
679  $this->toggleObjectBadges(false);
680  }
+ Here is the call graph for this function:

◆ deactivateTypes()

ilObjBadgeAdministrationGUI::deactivateTypes ( )
protected

Definition at line 276 of file class.ilObjBadgeAdministrationGUI.php.

References $_POST, ilObjectGUI\$lng, assertActive(), ilObjectGUI\checkPermissionBool(), and ilBadgeHandler\getInstance().

277  {
278  $lng = $this->lng;
279 
280  $this->assertActive();
281 
282  $ids = $_POST["id"];
283  if ($this->checkPermissionBool("write") && is_array($ids) && count($ids) > 0) {
284  $handler = ilBadgeHandler::getInstance();
285  $inactive = array_merge($handler->getInactiveTypes(), $ids);
286  $handler->setInactiveTypes($inactive);
287 
288  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
289  }
290  $this->ctrl->redirect($this, "listTypes");
291  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
$_POST["username"]
static getInstance()
Constructor.
+ Here is the call graph for this function:

◆ deleteImageTemplates()

ilObjBadgeAdministrationGUI::deleteImageTemplates ( )
protected

Definition at line 526 of file class.ilObjBadgeAdministrationGUI.php.

References ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, and ilObjectGUI\checkPermission().

527  {
529  $lng = $this->lng;
530 
531  $this->checkPermission("write");
532 
533  $tmpl_ids = $_REQUEST["id"];
534  if ($tmpl_ids) {
535  foreach ($tmpl_ids as $tmpl_id) {
536  $tmpl = new ilBadgeImageTemplate($tmpl_id);
537  $tmpl->delete();
538  }
539 
540  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
541  }
542 
543  $ilCtrl->redirect($this, "listImageTemplates");
544  }
global $ilCtrl
Definition: ilias.php:18
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

◆ deleteObjectBadges()

ilObjBadgeAdministrationGUI::deleteObjectBadges ( )
protected

Definition at line 727 of file class.ilObjBadgeAdministrationGUI.php.

References ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, and getObjectBadgesFromMultiAction().

728  {
730  $lng = $this->lng;
731 
732  $badge_ids = $this->getObjectBadgesFromMultiAction();
733 
734  foreach ($badge_ids as $badge_id) {
735  $badge = new ilBadge($badge_id);
736  $badge->delete();
737  }
738 
739  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
740  $ilCtrl->redirect($this, "listObjectBadges");
741  }
global $ilCtrl
Definition: ilias.php:18
Class ilBadge.
+ Here is the call graph for this function:

◆ editImageTemplate()

ilObjBadgeAdministrationGUI::editImageTemplate ( ilPropertyFormGUI  $a_form = null)
protected

Definition at line 412 of file class.ilObjBadgeAdministrationGUI.php.

References ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$tpl, assertActive(), ilObjectGUI\checkPermission(), initImageTemplateForm(), and setImageTemplateFormValues().

Referenced by updateImageTemplate().

413  {
415  $tpl = $this->tpl;
416 
417  $this->checkPermission("write");
418 
419  $this->assertActive();
420  $this->tabs_gui->setTabActive("imgtmpl");
421 
422  $tmpl_id = $_REQUEST["tid"];
423  if (!$tmpl_id) {
424  $ilCtrl->redirect($this, "listImageTemplates");
425  }
426 
427  $ilCtrl->setParameter($this, "tid", $tmpl_id);
428 
429  $tmpl = new ilBadgeImageTemplate($tmpl_id);
430 
431  if (!$a_form) {
432  $a_form = $this->initImageTemplateForm("edit");
433  $this->setImageTemplateFormValues($a_form, $tmpl);
434  }
435 
436  $tpl->setContent($a_form->getHTML());
437  }
setImageTemplateFormValues(ilPropertyFormGUI $a_form, ilBadgeImageTemplate $a_tmpl)
global $ilCtrl
Definition: ilias.php:18
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editSettings()

ilObjBadgeAdministrationGUI::editSettings (   $a_form = null)
protected

Definition at line 143 of file class.ilObjBadgeAdministrationGUI.php.

References initFormSettings().

Referenced by saveSettings().

144  {
145  $this->tabs_gui->setTabActive("settings");
146 
147  if (!$a_form) {
148  $a_form = $this->initFormSettings();
149  }
150 
151  $this->tpl->setContent($a_form->getHTML());
152  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjBadgeAdministrationGUI::executeCommand ( )

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

References assertActive(), and ilObjectGUI\prepareOutput().

53  {
54  $next_class = $this->ctrl->getNextClass($this);
55  $cmd = $this->ctrl->getCmd();
56 
57  $this->prepareOutput();
58 
59  switch ($next_class) {
60  case 'ilpermissiongui':
61  $this->tabs_gui->setTabActive('perm_settings');
62  $perm_gui = new ilPermissionGUI($this);
63  $this->ctrl->forwardCommand($perm_gui);
64  break;
65 
66  case 'ilbadgemanagementgui':
67  $this->assertActive();
68  $this->tabs_gui->setTabActive('activity');
69  $gui = new ilBadgeManagementGUI($this->ref_id, $this->obj_id, $this->type);
70  $this->ctrl->forwardCommand($gui);
71  break;
72 
73  default:
74  if (!$cmd || $cmd == 'view') {
75  $cmd = "editSettings";
76  }
77 
78  $this->$cmd();
79  break;
80  }
81  return true;
82  }
Class ilBadgeManagementGUI.
prepareOutput($a_show_subobjects=true)
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjBadgeAdministrationGUI::getAdminTabs ( )

Definition at line 84 of file class.ilObjBadgeAdministrationGUI.php.

References $rbacsystem, and ilBadgeHandler\getInstance().

85  {
87 
88  if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
89  $this->tabs_gui->addTab(
90  "settings",
91  $this->lng->txt("settings"),
92  $this->ctrl->getLinkTarget($this, "editSettings")
93  );
94 
95  if (ilBadgeHandler::getInstance()->isActive()) {
96  $this->tabs_gui->addTab(
97  "types",
98  $this->lng->txt("badge_types"),
99  $this->ctrl->getLinkTarget($this, "listTypes")
100  );
101 
102  $this->tabs_gui->addTab(
103  "imgtmpl",
104  $this->lng->txt("badge_image_templates"),
105  $this->ctrl->getLinkTarget($this, "listImageTemplates")
106  );
107 
108  $this->tabs_gui->addTab(
109  "activity",
110  $this->lng->txt("badge_activity_badges"),
111  $this->ctrl->getLinkTargetByClass("ilbadgemanagementgui", "")
112  );
113 
114  $this->tabs_gui->addTab(
115  "obj_badges",
116  $this->lng->txt("badge_object_badges"),
117  $this->ctrl->getLinkTarget($this, "listObjectBadges")
118  );
119  }
120  }
121 
122  if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
123  $this->tabs_gui->addTab(
124  "perm_settings",
125  $this->lng->txt("perm_settings"),
126  $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm")
127  );
128  }
129  }
static getInstance()
Constructor.
+ Here is the call graph for this function:

◆ getObjectBadgesFromMultiAction()

ilObjBadgeAdministrationGUI::getObjectBadgesFromMultiAction ( )
protected

Definition at line 641 of file class.ilObjBadgeAdministrationGUI.php.

References $access, ilObjectGUI\$ctrl, and $ilCtrl.

Referenced by confirmDeleteObjectBadges(), deleteObjectBadges(), and toggleObjectBadges().

642  {
643  $ilAccess = $this->access;
645 
646  $badge_ids = $_REQUEST["id"];
647  if (!$badge_ids ||
648  !$ilAccess->checkAccess("write", "", $this->object->getRefId())) {
649  $ilCtrl->redirect($this, "listObjectBadges");
650  }
651 
652  return $badge_ids;
653  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ initFormSettings()

ilObjBadgeAdministrationGUI::initFormSettings ( )
protected

Definition at line 183 of file class.ilObjBadgeAdministrationGUI.php.

References $access, ilBadgeHandler\getInstance(), and ilFormPropertyGUI\setInfo().

Referenced by editSettings(), and saveSettings().

184  {
185  $ilAccess = $this->access;
186 
187  $form = new ilPropertyFormGUI();
188  $form->setFormAction($this->ctrl->getFormAction($this));
189  $form->setTitle($this->lng->txt("badge_settings"));
190 
191  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
192  $form->addCommandButton("saveSettings", $this->lng->txt("save"));
193  $form->addCommandButton("editSettings", $this->lng->txt("cancel"));
194  }
195 
196  $act = new ilCheckboxInputGUI($this->lng->txt("badge_service_activate"), "act");
197  $act->setInfo($this->lng->txt("badge_service_activate_info"));
198  $form->addItem($act);
199 
200  /* see bug #0020124
201  $obi = new ilCheckboxInputGUI($this->lng->txt("badge_obi_activate"), "obi");
202  $obi->setInfo($this->lng->txt("badge_obi_activate_info"));
203  $form->addItem($obi);
204 
205  $obi_org = new ilTextInputGUI($this->lng->txt("badge_obi_organisation"), "obi_org");
206  $obi_org->setRequired(true);
207  $obi_org->setInfo($this->lng->txt("badge_obi_organisation_info"));
208  $obi->addSubItem($obi_org);
209 
210  $obi_contact = new ilEmailInputGUI($this->lng->txt("badge_obi_contact"), "obi_cont");
211  $obi_contact->setRequired(true);
212  $obi_contact->setInfo($this->lng->txt("badge_obi_contact_info"));
213  $obi->addSubItem($obi_contact);
214 
215  $obi_salt = new ilTextInputGUI($this->lng->txt("badge_obi_salt"), "obi_salt");
216  $obi_salt->setRequired(true);
217  $obi_salt->setInfo($this->lng->txt("badge_obi_salt_info"));
218  $obi->addSubItem($obi_salt);
219  */
220 
221  $handler = ilBadgeHandler::getInstance();
222  $act->setChecked($handler->isActive());
223 
224  /* see bug 0020124
225  $obi->setChecked($handler->isObiActive());
226  $obi_org->setValue($handler->getObiOrganistation());
227  $obi_contact->setValue($handler->getObiContact());
228  $obi_salt->setValue($handler->getObiSalt());
229  */
230 
231  return $form;
232  }
This class represents a property form user interface.
This class represents a checkbox property in a property form.
setInfo($a_info)
Set Information Text.
static getInstance()
Constructor.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initImageTemplateForm()

ilObjBadgeAdministrationGUI::initImageTemplateForm (   $a_mode)
protected

Definition at line 339 of file class.ilObjBadgeAdministrationGUI.php.

References ilObjectGUI\$ctrl, $ilCtrl, $img, ilObjectGUI\$lng, $type, ilBadgeHandler\getInstance(), and ilFormPropertyGUI\setRequired().

Referenced by addImageTemplate(), editImageTemplate(), saveImageTemplate(), and updateImageTemplate().

340  {
341  $lng = $this->lng;
343 
344  $form = new ilPropertyFormGUI();
345  $form->setFormAction($ilCtrl->getFormAction($this, "saveBadge"));
346  $form->setTitle($lng->txt("badge_image_template_form"));
347 
348  $title = new ilTextInputGUI($lng->txt("title"), "title");
349  $title->setRequired(true);
350  $form->addItem($title);
351 
352  $img = new ilImageFileInputGUI($lng->txt("image"), "img");
353  $img->setSuffixes(array("png", "svg"));
354  if ($a_mode == "create") {
355  $img->setRequired(true);
356  }
357  $img->setALlowDeletion(false);
358  $form->addItem($img);
359 
360  $types_mode = new ilRadioGroupInputGUI($lng->txt("badge_template_types"), "tmode");
361  $types_mode->setRequired(true);
362  $form->addItem($types_mode);
363 
364  $type_all = new ilRadioOption($lng->txt("badge_template_types_all"), "all");
365  $types_mode->addOption($type_all);
366 
367  $type_spec = new ilRadioOption($lng->txt("badge_template_types_specific"), "spec");
368  $types_mode->addOption($type_spec);
369 
370  $types = new ilCheckboxGroupInputGUI($lng->txt("badge_types"), "type");
371  $types->setRequired(true);
372  $type_spec->addSubItem($types);
373 
374  foreach (ilBadgeHandler::getInstance()->getAvailableTypes() as $id => $type) {
375  $types->addOption(new ilCheckboxOption($type->getCaption(), $id));
376  }
377 
378  if ($a_mode == "create") {
379  $form->addCommandButton("saveImageTemplate", $lng->txt("save"));
380  } else {
381  $form->addCommandButton("updateImageTemplate", $lng->txt("save"));
382  }
383  $form->addCommandButton("listImageTemplates", $lng->txt("cancel"));
384 
385  return $form;
386  }
This class represents an option in a radio group.
This class represents an option in a checkbox group.
This class represents a property form user interface.
$type
global $ilCtrl
Definition: ilias.php:18
This class represents a property in a property form.
This class represents a property in a property form.
This class represents an image file property in a property form.
setRequired($a_required)
Set Required.
static getInstance()
Constructor.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listImageTemplates()

ilObjBadgeAdministrationGUI::listImageTemplates ( )
protected

Definition at line 298 of file class.ilObjBadgeAdministrationGUI.php.

References $access, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, $toolbar, assertActive(), and ilObjectGUI\checkPermissionBool().

299  {
300  $ilAccess = $this->access;
301  $lng = $this->lng;
302  $ilToolbar = $this->toolbar;
304 
305  $this->assertActive();
306  $this->tabs_gui->setTabActive("imgtmpl");
307 
308  if ($this->checkPermissionBool("write")) {
309  $ilToolbar->addButton(
310  $lng->txt("badge_add_template"),
311  $ilCtrl->getLinkTarget($this, "addImageTemplate")
312  );
313  }
314 
315  $tbl = new ilBadgeImageTemplateTableGUI(
316  $this,
317  "listImageTemplates",
318  $ilAccess->checkAccess("write", "", $this->object->getRefId())
319  );
320  $this->tpl->setContent($tbl->getHTML());
321  }
global $ilCtrl
Definition: ilias.php:18
TableGUI class for badge template listing.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:

◆ listObjectBadges()

ilObjBadgeAdministrationGUI::listObjectBadges ( )
protected

Definition at line 551 of file class.ilObjBadgeAdministrationGUI.php.

References $access, ilObjectGUI\$tpl, and assertActive().

Referenced by applyObjectFilter(), and resetObjectFilter().

552  {
553  $ilAccess = $this->access;
554  $tpl = $this->tpl;
555 
556  $this->assertActive();
557  $this->tabs_gui->setTabActive("obj_badges");
558 
559  $tbl = new ilObjectBadgeTableGUI(
560  $this,
561  "listObjectBadges",
562  $ilAccess->checkAccess("write", "", $this->object->getRefId())
563  );
564  $tpl->setContent($tbl->getHTML());
565  }
TableGUI class for badge listing.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listObjectBadgeUsers()

ilObjBadgeAdministrationGUI::listObjectBadgeUsers ( )
protected

Definition at line 595 of file class.ilObjBadgeAdministrationGUI.php.

References ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, and assertActive().

Referenced by applyUserFilter(), and resetUserFilter().

596  {
598  $lng = $this->lng;
599  $tpl = $this->tpl;
600 
601  $parent_obj_id = $_REQUEST["pid"];
602  if (!$parent_obj_id) {
603  $ilCtrl->redirect($this, "listObjectBadges");
604  }
605 
606  $this->assertActive();
607 
608  $this->tabs_gui->clearTargets();
609  $this->tabs_gui->setBackTarget(
610  $lng->txt("back"),
611  $ilCtrl->getLinkTarget($this, "listObjectBadges")
612  );
613 
614  $ilCtrl->saveParameter($this, "pid");
615 
616  $tbl = new ilBadgeUserTableGUI($this, "listUsers", null, null, $parent_obj_id, (int) $_REQUEST["bid"]);
617  $tpl->setContent($tbl->getHTML());
618  }
global $ilCtrl
Definition: ilias.php:18
TableGUI class for badge user listing.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listTypes()

ilObjBadgeAdministrationGUI::listTypes ( )
protected

Definition at line 239 of file class.ilObjBadgeAdministrationGUI.php.

References $access, and assertActive().

240  {
241  $ilAccess = $this->access;
242 
243  $this->assertActive();
244  $this->tabs_gui->setTabActive("types");
245 
246  $tbl = new ilBadgeTypesTableGUI(
247  $this,
248  "listTypes",
249  $ilAccess->checkAccess("write", "", $this->object->getRefId())
250  );
251  $this->tpl->setContent($tbl->getHTML());
252  }
TableGUI class for badge type listing.
+ Here is the call graph for this function:

◆ resetObjectFilter()

ilObjBadgeAdministrationGUI::resetObjectFilter ( )
protected

Definition at line 581 of file class.ilObjBadgeAdministrationGUI.php.

References $access, and listObjectBadges().

582  {
583  $ilAccess = $this->access;
584 
585  $tbl = new ilObjectBadgeTableGUI(
586  $this,
587  "listObjectBadges",
588  $ilAccess->checkAccess("write", "", $this->object->getRefId())
589  );
590  $tbl->resetOffset();
591  $tbl->resetFilter();
592  $this->listObjectBadges();
593  }
TableGUI class for badge listing.
+ Here is the call graph for this function:

◆ resetUserFilter()

ilObjBadgeAdministrationGUI::resetUserFilter ( )
protected

Definition at line 628 of file class.ilObjBadgeAdministrationGUI.php.

References listObjectBadgeUsers().

629  {
630  $tbl = new ilBadgeUserTableGUI($this, "listUsers", null, null, $parent_obj_id, (int) $_REQUEST["bid"]);
631  $tbl->resetOffset();
632  $tbl->resetFilter();
633  $this->listObjectBadgeUsers();
634  }
TableGUI class for badge user listing.
+ Here is the call graph for this function:

◆ saveImageTemplate()

ilObjBadgeAdministrationGUI::saveImageTemplate ( )
protected

Definition at line 388 of file class.ilObjBadgeAdministrationGUI.php.

References ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, addImageTemplate(), ilObjectGUI\checkPermission(), and initImageTemplateForm().

389  {
391  $lng = $this->lng;
392 
393  $this->checkPermission("write");
394 
395  $form = $this->initImageTemplateForm("create");
396  if ($form->checkInput()) {
397  $tmpl = new ilBadgeImageTemplate();
398  $tmpl->setTitle($form->getInput("title"));
399  $tmpl->setTypes($form->getInput("type"));
400  $tmpl->create();
401 
402  $tmpl->uploadImage($_FILES["img"]);
403 
404  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
405  $ilCtrl->redirect($this, "listImageTemplates");
406  }
407 
408  $form->setValuesByPost();
409  $this->addImageTemplate($form);
410  }
global $ilCtrl
Definition: ilias.php:18
addImageTemplate(ilPropertyFormGUI $a_form=null)
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

◆ saveSettings()

ilObjBadgeAdministrationGUI::saveSettings ( )
protected

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

References ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\checkPermission(), editSettings(), ilBadgeHandler\getInstance(), and initFormSettings().

155  {
157 
158  $this->checkPermission("write");
159 
160  $form = $this->initFormSettings();
161  if ($form->checkInput()) {
162  $obi = (bool) $form->getInput("act")
163  ? (bool) $form->getInput("obi")
164  : null;
165 
166  $handler = ilBadgeHandler::getInstance();
167  $handler->setActive((bool) $form->getInput("act"));
168  $handler->setObiActive($obi);
169  $handler->setObiOrganisation(trim($form->getInput("obi_org")));
170  $handler->setObiContact(trim($form->getInput("obi_cont")));
171  $handler->setObiSalt(trim($form->getInput("obi_salt")));
172 
173  $handler->rebuildIssuerStaticUrl();
174 
175  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
176  $ilCtrl->redirect($this, "editSettings");
177  }
178 
179  $form->setValuesByPost();
180  $this->editSettings($form);
181  }
global $ilCtrl
Definition: ilias.php:18
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
static getInstance()
Constructor.
+ Here is the call graph for this function:

◆ setImageTemplateFormValues()

ilObjBadgeAdministrationGUI::setImageTemplateFormValues ( ilPropertyFormGUI  $a_form,
ilBadgeImageTemplate  $a_tmpl 
)
protected

Definition at line 439 of file class.ilObjBadgeAdministrationGUI.php.

References ilBadgeImageTemplate\getImage(), ilBadgeImageTemplate\getImagePath(), ilPropertyFormGUI\getItemByPostVar(), ilBadgeImageTemplate\getTitle(), and ilBadgeImageTemplate\getTypes().

Referenced by editImageTemplate(), and updateImageTemplate().

440  {
441  $a_form->getItemByPostVar("title")->setValue($a_tmpl->getTitle());
442  $a_form->getItemByPostVar("img")->setImage($a_tmpl->getImagePath());
443  $a_form->getItemByPostVar("img")->setValue($a_tmpl->getImage());
444 
445  if ($a_tmpl->getTypes()) {
446  $a_form->getItemByPostVar("tmode")->setValue("spec");
447  $a_form->getItemByPostVar("type")->setValue($a_tmpl->getTypes());
448  } else {
449  $a_form->getItemByPostVar("tmode")->setValue("all");
450  }
451  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toggleObjectBadges()

ilObjBadgeAdministrationGUI::toggleObjectBadges (   $a_status)
protected

Definition at line 655 of file class.ilObjBadgeAdministrationGUI.php.

References ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, and getObjectBadgesFromMultiAction().

Referenced by activateObjectBadges(), and deactivateObjectBadges().

656  {
658  $lng = $this->lng;
659 
660  $badge_ids = $this->getObjectBadgesFromMultiAction();
661 
662  foreach ($badge_ids as $badge_id) {
663  $badge = new ilBadge($badge_id);
664  $badge->setActive($a_status);
665  $badge->update();
666  }
667 
668  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
669  $ilCtrl->redirect($this, "listObjectBadges");
670  }
global $ilCtrl
Definition: ilias.php:18
Class ilBadge.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateImageTemplate()

ilObjBadgeAdministrationGUI::updateImageTemplate ( )
protected

Definition at line 453 of file class.ilObjBadgeAdministrationGUI.php.

References ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\checkPermission(), editImageTemplate(), initImageTemplateForm(), and setImageTemplateFormValues().

454  {
456  $lng = $this->lng;
457 
458  $this->checkPermission("write");
459 
460  $tmpl_id = $_REQUEST["tid"];
461  if (!$tmpl_id) {
462  $ilCtrl->redirect($this, "listImageTemplates");
463  }
464 
465  $ilCtrl->setParameter($this, "tid", $tmpl_id);
466 
467  $tmpl = new ilBadgeImageTemplate($tmpl_id);
468 
469  $form = $this->initImageTemplateForm("update");
470  if ($form->checkInput()) {
471  $tmpl->setTitle($form->getInput("title"));
472 
473  if ($form->getInput("tmode") != "all") {
474  $tmpl->setTypes($form->getInput("type"));
475  } else {
476  $tmpl->setTypes(null);
477  }
478 
479  $tmpl->update();
480 
481  $tmpl->uploadImage($_FILES["img"]);
482 
483  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
484  $ilCtrl->redirect($this, "listImageTemplates");
485  }
486 
487  $this->setImageTemplateFormValues($form, $tmpl);
488  $form->setValuesByPost();
489  $this->editImageTemplate($form);
490  }
setImageTemplateFormValues(ilPropertyFormGUI $a_form, ilBadgeImageTemplate $a_tmpl)
global $ilCtrl
Definition: ilias.php:18
editImageTemplate(ilPropertyFormGUI $a_form=null)
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

Field Documentation

◆ $access

◆ $rbacsystem

ilObjBadgeAdministrationGUI::$rbacsystem
protected

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

Referenced by getAdminTabs().

◆ $tabs

ilObjBadgeAdministrationGUI::$tabs
protected

◆ $toolbar

ilObjBadgeAdministrationGUI::$toolbar
protected

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

Referenced by listImageTemplates().


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