Elgg
Version 1.9
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
views
default
forms
profile
edit.php
Go to the documentation of this file.
1
<?php
8
?>
9
10
<
div
>
11
<
label
><?php
echo
elgg_echo
(
'user:name:label'
); ?></
label
>
12
<?php
echo
elgg_view
(
'input/text'
, array(
'name'
=>
'name'
,
'value'
=>
$vars
[
'entity'
]->name)); ?>
13
</
div
>
14
<?php
15
16
$sticky_values
=
elgg_get_sticky_values
(
'profile:edit'
);
17
18
$profile_fields
=
elgg_get_config
(
'profile_fields'
);
19
if
(is_array(
$profile_fields
) && count(
$profile_fields
) > 0) {
20
foreach
(
$profile_fields
as $shortname => $valtype) {
21
$metadata
=
elgg_get_metadata
(array(
22
'guid'
=>
$vars
[
'entity'
]->guid,
23
'metadata_name'
=> $shortname,
24
'limit'
=>
false
25
));
26
if
(
$metadata
) {
27
if
(is_array(
$metadata
)) {
28
$value
=
''
;
29
foreach
(
$metadata
as $md) {
30
if
(!empty(
$value
)) {
31
$value
.=
', '
;
32
}
33
$value
.= $md->value;
34
$access_id = $md->access_id;
35
}
36
}
else
{
37
$value
=
$metadata
->value;
38
$access_id =
$metadata
->access_id;
39
}
40
}
else
{
41
$value
=
''
;
42
$access_id =
ACCESS_DEFAULT
;
43
}
44
45
// sticky form values take precedence over saved ones
46
if
(isset(
$sticky_values
[$shortname])) {
47
$value
=
$sticky_values
[$shortname];
48
}
49
if
(isset(
$sticky_values
[
'accesslevel'
][$shortname])) {
50
$access_id =
$sticky_values
[
'accesslevel'
][$shortname];
51
}
52
53
?>
54
<
div
>
55
<
label
><?php
echo
elgg_echo
(
"profile:{$shortname}"
) ?></
label
>
56
<?php
57
$params
= array(
58
'name'
=> $shortname,
59
'value'
=>
$value
,
60
);
61
echo
elgg_view
(
"input/{$valtype}"
, $params);
62
$params = array(
63
'name'
=>
"accesslevel[$shortname]"
,
64
'value'
=> $access_id,
65
);
66
echo
elgg_view
(
'input/access'
, $params);
67
?>
68
</
div
>
69
<?php
70
}
71
}
72
73
elgg_clear_sticky_form
(
'profile:edit'
);
74
75
?>
76
<
div
class
=
"elgg-foot"
>
77
<?php
78
echo
elgg_view
(
'input/hidden'
, array(
'name'
=>
'guid'
,
'value'
=>
$vars
[
'entity'
]->guid));
79
echo
elgg_view
(
'input/submit'
, array(
'value'
=>
elgg_echo
(
'save'
)));
80
?>
81
</
div
>
elgg_get_config
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
Definition:
configuration.php:86
elgg_clear_sticky_form
elgg_clear_sticky_form($form_name)
Clear the sticky form cache.
Definition:
input.php:171
$metadata
$metadata
Definition:
entity.php:19
$value
$value
Definition:
longtext.php:29
div
fieldset div
Definition:
admin.php:462
elgg_echo
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition:
languages.php:21
echo
elgg echo
Translates a string.
Definition:
languages.js:43
elgg_view
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition:
views.php:354
elgg_get_metadata
elgg_get_metadata(array $options=array())
Returns metadata.
Definition:
metadata.php:282
$profile_fields
$profile_fields
Definition:
edit.php:33
$params
if(isset($entity->icontime)) $params
Definition:
edit.php:27
label
label
Definition:
admin.php:452
ACCESS_DEFAULT
const ACCESS_DEFAULT
Definition:
elgglib.php:2120
$sticky_values
$sticky_values
Edit profile form.
Definition:
edit.php:16
elgg_get_sticky_values
elgg_get_sticky_values($form_name, $filter_result=true)
Get all the values in a sticky form in an array.
Definition:
input.php:228
$vars
if(file_exists($welcome)) $vars
Definition:
upgrade.php:93
Generated on Sat Dec 21 2024 00:00:34 for Elgg by
1.8.11