ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 $group = $a_form->getItemByPostVar("profile");
32 foreach ($group->getSubItems() as $field) {
33 foreach ($a_config["profile"] as $id) {
34 if ($field->getPostVar() == $id) {
35 $field->setChecked(true);
36 break;
37 }
38 }
39 }
40 }
41 }
42
43 public function getConfigFromForm(ilPropertyFormGUI $a_form)
44 {
45 $fields = array();
46 foreach (array_keys($_POST) as $id) {
47 if (substr($id, 0, 4) == "chk_") {
48 $fields[] = $id;
49 }
50 }
51
52 return array("profile" => $fields);
53 }
54
55 public function validateForm(ilPropertyFormGUI $a_form)
56 {
57 return true;
58 }
59}
$_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.
if(!array_key_exists('StateId', $_REQUEST)) $id
Badge type gui interface.
global $lng
Definition: privfeed.php:17