Elgg  Version 1.9
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 
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) {
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($name, $site_guid=0)
Get an Elgg configuration value.
elgg_clear_sticky_form($form_name)
Clear the sticky form cache.
Definition: input.php:171
$metadata
Definition: entity.php:19
$value
Definition: longtext.php:29
fieldset div
Definition: admin.php:462
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg echo
Translates a string.
Definition: languages.js:43
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition: views.php:354
elgg_get_metadata(array $options=array())
Returns metadata.
Definition: metadata.php:282
$profile_fields
Definition: edit.php:33
if(isset($entity->icontime)) $params
Definition: edit.php:27
label
Definition: admin.php:452
const ACCESS_DEFAULT
Definition: elgglib.php:2120
$sticky_values
Edit profile form.
Definition: edit.php:16
elgg_get_sticky_values($form_name, $filter_result=true)
Get all the values in a sticky form in an array.
Definition: input.php:228
if(file_exists($welcome)) $vars
Definition: upgrade.php:93