ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilUserProfileBadgeGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once "./Services/Badge/interfaces/interface.ilBadgeTypeGUI.php";
5
15{
16 public function initConfigForm(ilPropertyFormGUI $a_form, $a_parent_ref_id)
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 }
28
29 public function importConfigToForm(ilPropertyFormGUI $a_form, array $a_config)
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 }
43
44 public function getConfigFromForm(ilPropertyFormGUI $a_form)
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 }
55
56 public function validateForm(ilPropertyFormGUI $a_form)
57 {
58 return true;
59 }
60}
$_POST["username"]
An exception for terminatinating execution or to throw for unit testing.
This class represents a property in a property form.
GUI class for personal profile.
This class represents a property form user interface.
addItem($a_item)
Add Item (Property, SectionHeader).
getItemByPostVar($a_post_var)
Get Item by POST variable.
validateForm(ilPropertyFormGUI $a_form)
Custom form validation.
initConfigForm(ilPropertyFormGUI $a_form, $a_parent_ref_id)
Add custom fields to form.
importConfigToForm(ilPropertyFormGUI $a_form, array $a_config)
Set form values.
getConfigFromForm(ilPropertyFormGUI $a_form)
Export values to DB.
Badge type gui interface.
$lng
$DIC
Definition: xapitoken.php:46