ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 $lng;
19
20 $fields = new ilCheckboxGroupInputGUI($lng->txt("profile"), "profile");
21 $a_form->addItem($fields);
22
23 include_once "Services/User/classes/class.ilPersonalProfileGUI.php";
24 $gui = new ilPersonalProfileGUI();
25 $gui->showPublicProfileFields($a_form, array(), $fields, true);
26 }
27
28 public function importConfigToForm(ilPropertyFormGUI $a_form, array $a_config)
29 {
30 if(is_array($a_config["profile"]))
31 {
32 $group = $a_form->getItemByPostVar("profile");
33 foreach($group->getSubItems() as $field)
34 {
35 foreach($a_config["profile"] as $id)
36 {
37 if($field->getPostVar() == $id)
38 {
39 $field->setChecked(true);
40 break;
41 }
42 }
43 }
44 }
45 }
46
47 public function getConfigFromForm(ilPropertyFormGUI $a_form)
48 {
49 $fields = array();
50 foreach(array_keys($_POST) as $id)
51 {
52 if(substr($id, 0, 4) == "chk_")
53 {
54 $fields[] = $id;
55 }
56 }
57
58 return array("profile" => $fields);
59 }
60
61 public function validateForm(ilPropertyFormGUI $a_form)
62 {
63 return true;
64 }
65}
$_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.
global $lng
Definition: privfeed.php:17