diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-18 22:20:25 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-18 22:20:25 +0000 |
commit | 09d08af9814a4edfb2050cdb47ad8ae20a944472 (patch) | |
tree | 43aad705fd98ab1531d7ca19aebdf19d864e60fd /views/default/forms/profile | |
parent | 9bc9a3e7590ba15039b019da22c60bdd9d9868e0 (diff) | |
download | elgg-09d08af9814a4edfb2050cdb47ad8ae20a944472.tar.gz elgg-09d08af9814a4edfb2050cdb47ad8ae20a944472.tar.bz2 |
moved profile edit form into core
git-svn-id: http://code.elgg.org/elgg/trunk@7672 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/forms/profile')
-rw-r--r-- | views/default/forms/profile/edit.php | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/views/default/forms/profile/edit.php b/views/default/forms/profile/edit.php new file mode 100644 index 000000000..c9117c8e7 --- /dev/null +++ b/views/default/forms/profile/edit.php @@ -0,0 +1,64 @@ +<?php +/** + * Edit profile form + * + * @uses vars['entity'] + */ + +?> + +<p> + <label><?php echo elgg_echo('user:name:label'); ?></label> + <?php echo elgg_view('input/text',array('internalname' => 'name', 'value' => $vars['entity']->name)); ?> +</p> +<?php + +$profile_fields = elgg_get_config('profile'); +if (is_array($profile_fields) && count($profile_fields) > 0) { + foreach ($profile_fields as $shortname => $valtype) { + $metadata = get_metadata_byname($vars['entity']->guid, $shortname); + if ($metadata) { + if (is_array($metadata)) { + $value = ''; + foreach ($metadata as $md) { + if (!empty($value)) { + $value .= ', '; + } + $value .= $md->value; + $access_id = $md->access_id; + } + } else { + $value = $metadata->value; + $access_id = $metadata->access_id; + } + } else { + $value = ''; + $access_id = ACCESS_DEFAULT; + } + +?> +<p> + <label><?php echo elgg_echo("profile:{$shortname}") ?></label> + <?php + $params = array( + 'internalname' => $shortname, + 'value' => $value, + ); + echo elgg_view("input/{$valtype}", $params); + $params = array( + 'internalname' => "accesslevel[$shortname]", + 'value' => $access_id, + ); + echo elgg_view('input/access', $params); + ?> +</p> +<?php + } +} +?> +<p> +<?php + echo elgg_view('input/hidden', array('internalname' => 'guid', 'value' => $vars['entity']->guid)); + echo elgg_view('input/submit', array('value' => elgg_echo('save'))); +?> +</p> |