-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathding_user_profile.admin.inc
More file actions
executable file
·49 lines (44 loc) · 1.11 KB
/
ding_user_profile.admin.inc
File metadata and controls
executable file
·49 lines (44 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* @file
* Admin routine logic.
*/
/**
* Admin form structure.
*
* @param array $form
* The form, if any.
* @param $form_state
* Form input statue, if any.
*
* @return array
* The form itself.
*/
function ding_user_profile_admin_form($form, $form_state) {
$instances = field_info_instances('profile2', 'provider_alma');
$form['user_profile_note'] = array(
'#type' => 'item',
'#markup' => t('The following fields will contain the description supplied below, however they might be hidden.'),
);
// These fields are standard in drupal.
// The use edit form has fields which cannot be edited.
$standard_fields = array(
'pincode' => array(
'label' => 'pincode',
),
'mail' => array(
'label' => 'email',
),
);
// Provider fields.
foreach ($standard_fields + $instances as $key => $instance) {
$field = 'user_profile_' . $key;
$form[$field] = array(
'#type' => 'textarea',
'#rows' => 2,
'#title' => ucfirst($instance['label']),
'#default_value' => variable_get($field, ''),
);
}
return system_settings_form($form);
}