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

User profile badge gui. More...

+ Inheritance diagram for ilUserProfileBadgeGUI:
+ Collaboration diagram for ilUserProfileBadgeGUI:

Public Member Functions

 initConfigForm (ilPropertyFormGUI $a_form, $a_parent_ref_id)
 Add custom fields to form. More...
 
 importConfigToForm (ilPropertyFormGUI $a_form, array $a_config)
 Set form values. More...
 
 getConfigFromForm (ilPropertyFormGUI $a_form)
 Export values to DB. More...
 
 validateForm (ilPropertyFormGUI $a_form)
 Custom form validation. More...
 

Detailed Description

User profile badge gui.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id:$

Definition at line 14 of file class.ilUserProfileBadgeGUI.php.

Member Function Documentation

◆ getConfigFromForm()

ilUserProfileBadgeGUI::getConfigFromForm ( ilPropertyFormGUI  $a_form)

Export values to DB.

Parameters
ilPropertyFormGUI$a_form
Returns
array

Implements ilBadgeTypeGUI.

Definition at line 44 of file class.ilUserProfileBadgeGUI.php.

References $_POST.

45  {
46  $fields = array();
47  foreach (array_keys($_POST) as $id) {
48  if (substr($id, 0, 4) == "chk_") {
49  $fields[] = $id;
50  }
51  }
52 
53  return array("profile" => $fields);
54  }
$_POST["username"]

◆ importConfigToForm()

ilUserProfileBadgeGUI::importConfigToForm ( ilPropertyFormGUI  $a_form,
array  $a_config 
)

Set form values.

Parameters
ilPropertyFormGUI$a_form
array$a_config

Implements ilBadgeTypeGUI.

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

References ilPropertyFormGUI\getItemByPostVar().

30  {
31  if (is_array($a_config["profile"])) {
32  $group = $a_form->getItemByPostVar("profile");
33  foreach ($group->getSubItems() as $field) {
34  foreach ($a_config["profile"] as $id) {
35  if ($field->getPostVar() == $id) {
36  $field->setChecked(true);
37  break;
38  }
39  }
40  }
41  }
42  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
+ Here is the call graph for this function:

◆ initConfigForm()

ilUserProfileBadgeGUI::initConfigForm ( ilPropertyFormGUI  $a_form,
  $a_parent_ref_id 
)

Add custom fields to form.

Parameters
ilPropertyFormGUI$a_form
int$a_parent_ref_id

Implements ilBadgeTypeGUI.

Definition at line 16 of file class.ilUserProfileBadgeGUI.php.

References $DIC, $lng, and ilPropertyFormGUI\addItem().

17  {
18  global $DIC;
19 
20  $lng = $DIC['lng'];
21 
22  $fields = new ilCheckboxGroupInputGUI($lng->txt("profile"), "profile");
23  $a_form->addItem($fields);
24 
25  $gui = new ilPersonalProfileGUI();
26  $gui->showPublicProfileFields($a_form, array(), $fields, true);
27  }
addItem($a_item)
Add Item (Property, SectionHeader).
$lng
This class represents a property in a property form.
$DIC
Definition: xapitoken.php:46
GUI class for personal profile.
+ Here is the call graph for this function:

◆ validateForm()

ilUserProfileBadgeGUI::validateForm ( ilPropertyFormGUI  $a_form)

Custom form validation.

Parameters
ilPropertyFormGUI$a_form
Returns
bool

Implements ilBadgeTypeGUI.

Definition at line 56 of file class.ilUserProfileBadgeGUI.php.

57  {
58  return true;
59  }

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