ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjBadgeAdministrationGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 __construct ( $a_data, int $a_id, bool $a_call_by_reference=true, bool $a_prepare_output=true)
 
 executeCommand ()
 
 getAdminTabs ()
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 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...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Member Functions

 assertActive ()
 
 editSettings (ilPropertyFormGUI $a_form=null)
 
 saveSettings ()
 
 initFormSettings ()
 
 listTypes ()
 
 activateTypes ()
 
 deactivateTypes ()
 
 listImageTemplates ()
 
 addImageTemplate (ilPropertyFormGUI $a_form=null)
 
 initImageTemplateForm (string $a_mode)
 
 saveImageTemplate ()
 
 editImageTemplate (ilPropertyFormGUI $a_form=null)
 
 setImageTemplateFormValues (ilPropertyFormGUI $a_form, ilBadgeImageTemplate $a_tmpl)
 
 updateImageTemplate ()
 
 confirmDeleteImageTemplates ()
 
 deleteImageTemplates ()
 
 listObjectBadges ()
 
 applyObjectFilter ()
 
 resetObjectFilter ()
 
 listObjectBadgeUsers ()
 
 applylistObjectBadgeUsers ()
 
 resetlistObjectBadgeUsers ()
 
 getObjectBadgesFromMultiAction ()
 
 toggleObjectBadges (bool $a_status)
 
 activateObjectBadges ()
 
 deactivateObjectBadges ()
 
 confirmDeleteObjectBadges ()
 
 deleteObjectBadges ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 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 More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 addAdoptContentLinkToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $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 ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 

Protected Attributes

ilRbacSystem $rbacsystem
 
ilBadgeGUIRequest $badge_request
 
ilTabsGUI $tabs
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Badge Administration Settings.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om ilObjBadgeAdministrationGUI: ilPermissionGUI, ilBadgeManagementGUI ilObjBadgeAdministrationGUI: ilAdministrationGUI

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

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\tabs(), and ILIAS\Repository\toolbar().

37  {
38  global $DIC;
39 
40  $this->rbacsystem = $DIC->rbac()->system();
41  $this->ctrl = $DIC->ctrl();
42  $this->access = $DIC->access();
43  $this->lng = $DIC->language();
44  $this->toolbar = $DIC->toolbar();
45  $this->tpl = $DIC["tpl"];
46  $this->tabs = $DIC->tabs();
47  $this->type = "bdga";
48  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
49 
50  $this->badge_request = new ilBadgeGUIRequest(
51  $DIC->http(),
52  $DIC->refinery()
53  );
54 
55  $this->lng->loadLanguageModule("badge");
56  }
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ activateObjectBadges()

ilObjBadgeAdministrationGUI::activateObjectBadges ( )
protected

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

References toggleObjectBadges().

648  : void
649  {
650  $this->toggleObjectBadges(true);
651  }
+ Here is the call graph for this function:

◆ activateTypes()

ilObjBadgeAdministrationGUI::activateTypes ( )
protected

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

References $handler, ilObjectGUI\$lng, ilObjectGUI\$type, assertActive(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilBadgeHandler\getInstance(), and ilLanguage\txt().

222  : void
223  {
224  $lng = $this->lng;
225 
226  $this->assertActive();
227 
228  $ids = $this->badge_request->getIds();
229  if ($this->checkPermissionBool("write") && count($ids) > 0) {
231  $inactive = [];
232  foreach ($handler->getInactiveTypes() as $type) {
233  if (!in_array($type, $ids)) {
234  $inactive[] = $type;
235  }
236  }
237  $handler->setInactiveTypes($inactive);
238 
239  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
240  }
241  $this->ctrl->redirect($this, "listTypes");
242  }
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...
ilLanguage $lng
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
$handler
Definition: index.php:18
+ Here is the call graph for this function:

◆ addImageTemplate()

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

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

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

Referenced by saveImageTemplate().

293  : void {
294  $tpl = $this->tpl;
295 
296  $this->checkPermission("write");
297 
298  $this->assertActive();
299  $this->tabs_gui->setTabActive("imgtmpl");
300 
301  if (!$a_form) {
302  $a_form = $this->initImageTemplateForm("create");
303  }
304 
305  $tpl->setContent($a_form->getHTML());
306  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applylistObjectBadgeUsers()

ilObjBadgeAdministrationGUI::applylistObjectBadgeUsers ( )
protected

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

References listObjectBadgeUsers(), and ilTable2GUI\resetOffset().

596  : void
597  {
598  $tbl = new ilBadgeUserTableGUI($this, "listObjectBadgeUsers", 0, null, 0, $this->badge_request->getBadgeId());
599  $tbl->resetOffset();
600  $tbl->writeFilterToSession();
601  $this->listObjectBadgeUsers();
602  }
resetOffset(bool $a_in_determination=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ applyObjectFilter()

ilObjBadgeAdministrationGUI::applyObjectFilter ( )
protected

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

References ilObjectGUI\$access, and listObjectBadges().

543  : void
544  {
545  $ilAccess = $this->access;
546 
547  $tbl = new ilObjectBadgeTableGUI(
548  $this,
549  "listObjectBadges",
550  $ilAccess->checkAccess("write", "", $this->object->getRefId())
551  );
552  $tbl->resetOffset();
553  $tbl->writeFilterToSession();
554  $this->listObjectBadges();
555  }
TableGUI class for badge listing.
ilAccessHandler $access
+ Here is the call graph for this function:

◆ assertActive()

ilObjBadgeAdministrationGUI::assertActive ( )
protected

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

References ILIAS\Repository\ctrl(), and ilBadgeHandler\getInstance().

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

136  : void
137  {
138  if (!ilBadgeHandler::getInstance()->isActive()) {
139  $this->ctrl->redirect($this, "editSettings");
140  }
141  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmDeleteImageTemplates()

ilObjBadgeAdministrationGUI::confirmDeleteImageTemplates ( )
protected

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

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, $tabs, ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

468  : void
469  {
470  $ilCtrl = $this->ctrl;
471  $lng = $this->lng;
472  $tpl = $this->tpl;
473  $ilTabs = $this->tabs;
474 
475  $this->checkPermission("write");
476 
477  $tmpl_ids = $this->badge_request->getIds();
478  if (!$tmpl_ids) {
479  $ilCtrl->redirect($this, "listImageTemplates");
480  }
481 
482  $ilTabs->clearTargets();
483  $ilTabs->setBackTarget(
484  $lng->txt("back"),
485  $ilCtrl->getLinkTarget($this, "listImageTemplates")
486  );
487 
488  $confirmation_gui = new ilConfirmationGUI();
489  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
490  $confirmation_gui->setHeaderText($lng->txt("badge_template_deletion_confirmation"));
491  $confirmation_gui->setCancel($lng->txt("cancel"), "listImageTemplates");
492  $confirmation_gui->setConfirm($lng->txt("delete"), "deleteImageTemplates");
493 
494  foreach ($tmpl_ids as $tmpl_id) {
495  $tmpl = new ilBadgeImageTemplate($tmpl_id);
496  $confirmation_gui->addItem("id[]", $tmpl_id, $tmpl->getTitle());
497  }
498 
499  $tpl->setContent($confirmation_gui->getHTML());
500  }
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...
ilLanguage $lng
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ confirmDeleteObjectBadges()

ilObjBadgeAdministrationGUI::confirmDeleteObjectBadges ( )
protected

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

References $container, ilObjectGUI\$ctrl, ilObjectGUI\$lng, $tabs, ilObjectGUI\$tpl, ilBadgeAssignment\getInstancesByBadgeId(), getObjectBadgesFromMultiAction(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

658  : void
659  {
660  $ilCtrl = $this->ctrl;
661  $lng = $this->lng;
662  $tpl = $this->tpl;
663  $ilTabs = $this->tabs;
664 
665  $badge_ids = $this->getObjectBadgesFromMultiAction();
666 
667  $ilTabs->clearTargets();
668  $ilTabs->setBackTarget(
669  $lng->txt("back"),
670  $ilCtrl->getLinkTarget($this, "listObjectBadges")
671  );
672 
673  $confirmation_gui = new ilConfirmationGUI();
674  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
675  $confirmation_gui->setHeaderText($lng->txt("badge_deletion_confirmation"));
676  $confirmation_gui->setCancel($lng->txt("cancel"), "listObjectBadges");
677  $confirmation_gui->setConfirm($lng->txt("delete"), "deleteObjectBadges");
678 
679  foreach ($badge_ids as $badge_id) {
680  $badge = new ilBadge($badge_id);
681  $parent = $badge->getParentMeta();
682 
683  // :TODO: container presentation
684  $container = "(" . $parent["type"] . "/" .
685  $parent["id"] . ") " .
686  $parent["title"];
687  if ($parent["deleted"]) {
688  $container .= ' <span class="il_ItemAlertProperty">' . $lng->txt("deleted") . '</span>';
689  }
690 
691  $confirmation_gui->addItem(
692  "id[]",
693  $badge_id,
694  $container . " - " .
695  $badge->getTitle() .
696  " (" . count(ilBadgeAssignment::getInstancesByBadgeId($badge_id)) . ")"
697  );
698  }
699 
700  $tpl->setContent($confirmation_gui->getHTML());
701  }
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...
$container
Definition: wac.php:14
ilLanguage $lng
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
static getInstancesByBadgeId(int $a_badge_id)
+ Here is the call graph for this function:

◆ deactivateObjectBadges()

ilObjBadgeAdministrationGUI::deactivateObjectBadges ( )
protected

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

References toggleObjectBadges().

653  : void
654  {
655  $this->toggleObjectBadges(false);
656  }
+ Here is the call graph for this function:

◆ deactivateTypes()

ilObjBadgeAdministrationGUI::deactivateTypes ( )
protected

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

References $handler, ilObjectGUI\$lng, assertActive(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilBadgeHandler\getInstance(), and ilLanguage\txt().

244  : void
245  {
246  $lng = $this->lng;
247 
248  $this->assertActive();
249 
250  $ids = $this->badge_request->getIds();
251  if ($this->checkPermissionBool("write") && count($ids) > 0) {
253  $inactive = array_merge($handler->getInactiveTypes(), $ids);
254  $handler->setInactiveTypes($inactive);
255 
256  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
257  }
258  $this->ctrl->redirect($this, "listTypes");
259  }
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...
ilLanguage $lng
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
$handler
Definition: index.php:18
+ Here is the call graph for this function:

◆ deleteImageTemplates()

ilObjBadgeAdministrationGUI::deleteImageTemplates ( )
protected

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

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

502  : void
503  {
504  $ilCtrl = $this->ctrl;
505  $lng = $this->lng;
506 
507  $this->checkPermission("write");
508 
509  $tmpl_ids = $this->badge_request->getIds();
510  if ($tmpl_ids) {
511  foreach ($tmpl_ids as $tmpl_id) {
512  $tmpl = new ilBadgeImageTemplate($tmpl_id);
513  $tmpl->delete();
514  }
515 
516  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
517  }
518 
519  $ilCtrl->redirect($this, "listImageTemplates");
520  }
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...
ilLanguage $lng
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ deleteObjectBadges()

ilObjBadgeAdministrationGUI::deleteObjectBadges ( )
protected

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

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

703  : void
704  {
705  $ilCtrl = $this->ctrl;
706  $lng = $this->lng;
707 
708  $badge_ids = $this->getObjectBadgesFromMultiAction();
709 
710  foreach ($badge_ids as $badge_id) {
711  $badge = new ilBadge($badge_id);
712  $badge->delete();
713  }
714 
715  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
716  $ilCtrl->redirect($this, "listObjectBadges");
717  }
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...
ilLanguage $lng
+ Here is the call graph for this function:

◆ editImageTemplate()

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

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

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

Referenced by updateImageTemplate().

387  : void {
388  $ilCtrl = $this->ctrl;
389  $tpl = $this->tpl;
390 
391  $this->checkPermission("write");
392 
393  $this->assertActive();
394  $this->tabs_gui->setTabActive("imgtmpl");
395 
396  $tmpl_id = $this->badge_request->getTemplateId();
397  if (!$tmpl_id) {
398  $ilCtrl->redirect($this, "listImageTemplates");
399  }
400 
401  $ilCtrl->setParameter($this, "tid", $tmpl_id);
402 
403  $tmpl = new ilBadgeImageTemplate($tmpl_id);
404 
405  if (!$a_form) {
406  $a_form = $this->initImageTemplateForm("edit");
407  $this->setImageTemplateFormValues($a_form, $tmpl);
408  }
409 
410  $tpl->setContent($a_form->getHTML());
411  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setImageTemplateFormValues(ilPropertyFormGUI $a_form, ilBadgeImageTemplate $a_tmpl)
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editSettings()

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

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

References initFormSettings().

Referenced by saveSettings().

148  : void
149  {
150  $this->tabs_gui->setTabActive("settings");
151 
152  if (!$a_form) {
153  $a_form = $this->initFormSettings();
154  }
155 
156  $this->tpl->setContent($a_form->getHTML());
157  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjBadgeAdministrationGUI::executeCommand ( )

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

References assertActive(), ILIAS\Repository\ctrl(), and ilObjectGUI\prepareOutput().

58  : void
59  {
60  $next_class = $this->ctrl->getNextClass($this);
61  $cmd = $this->ctrl->getCmd();
62 
63  $this->prepareOutput();
64 
65  switch ($next_class) {
66  case 'ilpermissiongui':
67  $this->tabs_gui->setTabActive('perm_settings');
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  $gui = new ilBadgeManagementGUI($this->ref_id, $this->obj_id, $this->type);
76  $this->ctrl->forwardCommand($gui);
77  break;
78 
79  default:
80  if (!$cmd || $cmd === 'view') {
81  $cmd = "editSettings";
82  }
83 
84  $this->$cmd();
85  break;
86  }
87  }
Class ilBadgeManagementGUI.
prepareOutput(bool $show_sub_objects=true)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjBadgeAdministrationGUI::getAdminTabs ( )

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

References $rbacsystem, ilRbacSystem\checkAccess(), ILIAS\Repository\ctrl(), ilBadgeHandler\getInstance(), and ILIAS\Repository\lng().

89  : void
90  {
92 
93  if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
94  $this->tabs_gui->addTab(
95  "settings",
96  $this->lng->txt("settings"),
97  $this->ctrl->getLinkTarget($this, "editSettings")
98  );
99 
100  if (ilBadgeHandler::getInstance()->isActive()) {
101  $this->tabs_gui->addTab(
102  "types",
103  $this->lng->txt("badge_types"),
104  $this->ctrl->getLinkTarget($this, "listTypes")
105  );
106 
107  $this->tabs_gui->addTab(
108  "imgtmpl",
109  $this->lng->txt("badge_image_templates"),
110  $this->ctrl->getLinkTarget($this, "listImageTemplates")
111  );
112 
113  $this->tabs_gui->addTab(
114  "activity",
115  $this->lng->txt("badge_activity_badges"),
116  $this->ctrl->getLinkTargetByClass("ilbadgemanagementgui", "")
117  );
118 
119  $this->tabs_gui->addTab(
120  "obj_badges",
121  $this->lng->txt("badge_object_badges"),
122  $this->ctrl->getLinkTarget($this, "listObjectBadges")
123  );
124  }
125  }
126 
127  if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
128  $this->tabs_gui->addTab(
129  "perm_settings",
130  $this->lng->txt("perm_settings"),
131  $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm")
132  );
133  }
134  }
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...
+ Here is the call graph for this function:

◆ getObjectBadgesFromMultiAction()

ilObjBadgeAdministrationGUI::getObjectBadgesFromMultiAction ( )
protected

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

References ilObjectGUI\$access, ilObjectGUI\$ctrl, and ilCtrl\redirect().

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

617  : array
618  {
619  $ilAccess = $this->access;
620  $ilCtrl = $this->ctrl;
621 
622  $badge_ids = $this->badge_request->getIds();
623  if (!$badge_ids ||
624  !$ilAccess->checkAccess("write", "", $this->object->getRefId())) {
625  $ilCtrl->redirect($this, "listObjectBadges");
626  }
627 
628  return $badge_ids;
629  }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
ilAccessHandler $access
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormSettings()

ilObjBadgeAdministrationGUI::initFormSettings ( )
protected

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

References ilObjectGUI\$access, $handler, ILIAS\Repository\ctrl(), ilBadgeHandler\getInstance(), and ILIAS\Repository\lng().

Referenced by editSettings(), and saveSettings().

179  {
180  $ilAccess = $this->access;
181 
182  $form = new ilPropertyFormGUI();
183  $form->setFormAction($this->ctrl->getFormAction($this));
184  $form->setTitle($this->lng->txt("badge_settings"));
185 
186  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
187  $form->addCommandButton("saveSettings", $this->lng->txt("save"));
188  $form->addCommandButton("editSettings", $this->lng->txt("cancel"));
189  }
190 
191  $act = new ilCheckboxInputGUI($this->lng->txt("badge_service_activate"), "act");
192  $act->setInfo($this->lng->txt("badge_service_activate_info"));
193  $form->addItem($act);
194 
195 
197  $act->setChecked($handler->isActive());
198 
199  return $form;
200  }
ilAccessHandler $access
$handler
Definition: index.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initImageTemplateForm()

ilObjBadgeAdministrationGUI::initImageTemplateForm ( string  $a_mode)
protected

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

References ilObjectGUI\$ctrl, ilObjectGUI\$id, ilObjectGUI\$lng, ilObjectGUI\$type, ilBadgeHandler\getInstance(), ilFormPropertyGUI\setRequired(), ilFileInputGUI\setSuffixes(), and ilLanguage\txt().

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

311  $lng = $this->lng;
312  $ilCtrl = $this->ctrl;
313 
314  $form = new ilPropertyFormGUI();
315  $form->setFormAction($ilCtrl->getFormAction($this, "saveBadge"));
316  $form->setTitle($lng->txt("badge_image_template_form"));
317 
318  $title = new ilTextInputGUI($lng->txt("title"), "title");
319  $title->setMaxLength(255);
320  $title->setRequired(true);
321  $form->addItem($title);
322 
323  $img = new ilImageFileInputGUI($lng->txt("image"), "img");
324  $img->setSuffixes(array("png", "svg"));
325  if ($a_mode === "create") {
326  $img->setRequired(true);
327  }
328  $img->setUseCache(false);
329  $img->setAllowDeletion(false);
330  $form->addItem($img);
331 
332  $types_mode = new ilRadioGroupInputGUI($lng->txt("badge_template_types"), "tmode");
333  $types_mode->setRequired(true);
334  $types_mode->setValue("all");
335  $form->addItem($types_mode);
336 
337  $type_all = new ilRadioOption($lng->txt("badge_template_types_all"), "all");
338  $types_mode->addOption($type_all);
339 
340  $type_spec = new ilRadioOption($lng->txt("badge_template_types_specific"), "spec");
341  $types_mode->addOption($type_spec);
342 
343  $types = new ilCheckboxGroupInputGUI($lng->txt("badge_types"), "type");
344  $types->setRequired(true);
345  $type_spec->addSubItem($types);
346 
347  foreach (ilBadgeHandler::getInstance()->getAvailableTypes(false) as $id => $type) {
348  $types->addOption(new ilCheckboxOption($type->getCaption(), $id));
349  }
350 
351  if ($a_mode === "create") {
352  $form->addCommandButton("saveImageTemplate", $lng->txt("save"));
353  } else {
354  $form->addCommandButton("updateImageTemplate", $lng->txt("save"));
355  }
356  $form->addCommandButton("listImageTemplates", $lng->txt("cancel"));
357 
358  return $form;
359  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
setSuffixes(array $a_suffixes)
ilLanguage $lng
This class represents a property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setRequired(bool $a_required)
This class represents an image file property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listImageTemplates()

ilObjBadgeAdministrationGUI::listImageTemplates ( )
protected

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

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

266  : void
267  {
268  $ilAccess = $this->access;
269  $lng = $this->lng;
270  $ilToolbar = $this->toolbar;
271  $ilCtrl = $this->ctrl;
272 
273  $this->assertActive();
274  $this->tabs_gui->setTabActive("imgtmpl");
275 
276  if ($this->checkPermissionBool("write")) {
277  $ilToolbar->addButton(
278  $lng->txt("badge_add_template"),
279  $ilCtrl->getLinkTarget($this, "addImageTemplate")
280  );
281  }
282 
283  $tbl = new ilBadgeImageTemplateTableGUI(
284  $this,
285  "listImageTemplates",
286  $ilAccess->checkAccess("write", "", $this->object->getRefId())
287  );
288  $this->tpl->setContent($tbl->getHTML());
289  }
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...
ilLanguage $lng
ilToolbarGUI $toolbar
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
ilAccessHandler $access
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ listObjectBadges()

ilObjBadgeAdministrationGUI::listObjectBadges ( )
protected

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

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

Referenced by applyObjectFilter(), and resetObjectFilter().

527  : void
528  {
529  $ilAccess = $this->access;
530  $tpl = $this->tpl;
531 
532  $this->assertActive();
533  $this->tabs_gui->setTabActive("obj_badges");
534 
535  $tbl = new ilObjectBadgeTableGUI(
536  $this,
537  "listObjectBadges",
538  $ilAccess->checkAccess("write", "", $this->object->getRefId())
539  );
540  $tpl->setContent($tbl->getHTML());
541  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
TableGUI class for badge listing.
ilAccessHandler $access
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listObjectBadgeUsers()

ilObjBadgeAdministrationGUI::listObjectBadgeUsers ( )
protected

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

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, assertActive(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

Referenced by applylistObjectBadgeUsers(), and resetlistObjectBadgeUsers().

571  : void
572  {
573  $ilCtrl = $this->ctrl;
574  $lng = $this->lng;
575  $tpl = $this->tpl;
576 
577  $parent_obj_id = $this->badge_request->getParentId();
578  if (!$parent_obj_id) {
579  $ilCtrl->redirect($this, "listObjectBadges");
580  }
581 
582  $this->assertActive();
583 
584  $this->tabs_gui->clearTargets();
585  $this->tabs_gui->setBackTarget(
586  $lng->txt("back"),
587  $ilCtrl->getLinkTarget($this, "listObjectBadges")
588  );
589 
590  $ilCtrl->saveParameter($this, "pid");
591 
592  $tbl = new ilBadgeUserTableGUI($this, "listObjectBadgeUsers", 0, null, $parent_obj_id, $this->badge_request->getBadgeId());
593  $tpl->setContent($tbl->getHTML());
594  }
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...
ilLanguage $lng
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listTypes()

ilObjBadgeAdministrationGUI::listTypes ( )
protected

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

References ilObjectGUI\$access, and assertActive().

207  : void
208  {
209  $ilAccess = $this->access;
210 
211  $this->assertActive();
212  $this->tabs_gui->setTabActive("types");
213 
214  $tbl = new ilBadgeTypesTableGUI(
215  $this,
216  "listTypes",
217  $ilAccess->checkAccess("write", "", $this->object->getRefId())
218  );
219  $this->tpl->setContent($tbl->getHTML());
220  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilAccessHandler $access
+ Here is the call graph for this function:

◆ resetlistObjectBadgeUsers()

ilObjBadgeAdministrationGUI::resetlistObjectBadgeUsers ( )
protected

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

References listObjectBadgeUsers(), and ilTable2GUI\resetOffset().

604  : void
605  {
606  $tbl = new ilBadgeUserTableGUI($this, "listObjectBadgeUsers", 0, null, 0, $this->badge_request->getBadgeId());
607  $tbl->resetOffset();
608  $tbl->resetFilter();
609  $this->listObjectBadgeUsers();
610  }
resetOffset(bool $a_in_determination=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ resetObjectFilter()

ilObjBadgeAdministrationGUI::resetObjectFilter ( )
protected

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

References ilObjectGUI\$access, and listObjectBadges().

557  : void
558  {
559  $ilAccess = $this->access;
560 
561  $tbl = new ilObjectBadgeTableGUI(
562  $this,
563  "listObjectBadges",
564  $ilAccess->checkAccess("write", "", $this->object->getRefId())
565  );
566  $tbl->resetOffset();
567  $tbl->resetFilter();
568  $this->listObjectBadges();
569  }
TableGUI class for badge listing.
ilAccessHandler $access
+ Here is the call graph for this function:

◆ saveImageTemplate()

ilObjBadgeAdministrationGUI::saveImageTemplate ( )
protected

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

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

361  : void
362  {
363  $ilCtrl = $this->ctrl;
364  $lng = $this->lng;
365 
366  $this->checkPermission("write");
367 
368  $form = $this->initImageTemplateForm("create");
369  if ($form->checkInput()) {
370  $tmpl = new ilBadgeImageTemplate();
371  $tmpl->setTitle($form->getInput("title"));
372  $tmpl->setTypes($form->getInput("type"));
373  $tmpl->create();
374 
375  $tmpl->uploadImage($_FILES["img"]);
376 
377  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
378  $ilCtrl->redirect($this, "listImageTemplates");
379  }
380 
381  $form->setValuesByPost();
382  $this->addImageTemplate($form);
383  }
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...
ilLanguage $lng
addImageTemplate(ilPropertyFormGUI $a_form=null)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ saveSettings()

ilObjBadgeAdministrationGUI::saveSettings ( )
protected

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

References ilObjectGUI\$ctrl, $handler, ilObjectGUI\checkPermission(), editSettings(), ilBadgeHandler\getInstance(), initFormSettings(), and ILIAS\Repository\lng().

159  : void
160  {
161  $ilCtrl = $this->ctrl;
162 
163  $this->checkPermission("write");
164 
165  $form = $this->initFormSettings();
166  if ($form->checkInput()) {
168  $handler->setActive((bool) $form->getInput("act"));
169 
170  $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
171  $ilCtrl->redirect($this, "editSettings");
172  }
173 
174  $form->setValuesByPost();
175  $this->editSettings($form);
176  }
editSettings(ilPropertyFormGUI $a_form=null)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
$handler
Definition: index.php:18
+ Here is the call graph for this function:

◆ setImageTemplateFormValues()

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

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

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

Referenced by editImageTemplate(), and updateImageTemplate().

416  : void {
417  $a_form->getItemByPostVar("title")->setValue($a_tmpl->getTitle());
418  $a_form->getItemByPostVar("img")->setImage($a_tmpl->getImagePath());
419  $a_form->getItemByPostVar("img")->setValue($a_tmpl->getImage());
420 
421  if ($a_tmpl->getTypes()) {
422  $a_form->getItemByPostVar("tmode")->setValue("spec");
423  $a_form->getItemByPostVar("type")->setValue($a_tmpl->getTypes());
424  } else {
425  $a_form->getItemByPostVar("tmode")->setValue("all");
426  }
427  }
getItemByPostVar(string $a_post_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toggleObjectBadges()

ilObjBadgeAdministrationGUI::toggleObjectBadges ( bool  $a_status)
protected

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

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

Referenced by activateObjectBadges(), and deactivateObjectBadges().

631  : void
632  {
633  $ilCtrl = $this->ctrl;
634  $lng = $this->lng;
635 
636  $badge_ids = $this->getObjectBadgesFromMultiAction();
637 
638  foreach ($badge_ids as $badge_id) {
639  $badge = new ilBadge($badge_id);
640  $badge->setActive($a_status);
641  $badge->update();
642  }
643 
644  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
645  $ilCtrl->redirect($this, "listObjectBadges");
646  }
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...
ilLanguage $lng
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateImageTemplate()

ilObjBadgeAdministrationGUI::updateImageTemplate ( )
protected

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

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

429  : void
430  {
431  $ilCtrl = $this->ctrl;
432  $lng = $this->lng;
433 
434  $this->checkPermission("write");
435 
436  $tmpl_id = $this->badge_request->getTemplateId();
437  if (!$tmpl_id) {
438  $ilCtrl->redirect($this, "listImageTemplates");
439  }
440 
441  $ilCtrl->setParameter($this, "tid", $tmpl_id);
442 
443  $tmpl = new ilBadgeImageTemplate($tmpl_id);
444 
445  $form = $this->initImageTemplateForm("update");
446  if ($form->checkInput()) {
447  $tmpl->setTitle($form->getInput("title"));
448 
449  if ($form->getInput("tmode") !== "all") {
450  $tmpl->setTypes($form->getInput("type"));
451  } else {
452  $tmpl->setTypes(null);
453  }
454 
455  $tmpl->update();
456 
457  $tmpl->uploadImage($_FILES["img"]);
458 
459  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
460  $ilCtrl->redirect($this, "listImageTemplates");
461  }
462 
463  $this->setImageTemplateFormValues($form, $tmpl);
464  $form->setValuesByPost();
465  $this->editImageTemplate($form);
466  }
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...
setImageTemplateFormValues(ilPropertyFormGUI $a_form, ilBadgeImageTemplate $a_tmpl)
ilLanguage $lng
editImageTemplate(ilPropertyFormGUI $a_form=null)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

Field Documentation

◆ $badge_request

ilBadgeGUIRequest ilObjBadgeAdministrationGUI::$badge_request
protected

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

◆ $rbacsystem

ilRbacSystem ilObjBadgeAdministrationGUI::$rbacsystem
protected

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

Referenced by getAdminTabs().

◆ $tabs

ilTabsGUI ilObjBadgeAdministrationGUI::$tabs
protected

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