aboutsummaryrefslogtreecommitdiff
path: root/mod/cool_theme/views/default/forms/profile/edit.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/cool_theme/views/default/forms/profile/edit.php')
-rw-r--r--mod/cool_theme/views/default/forms/profile/edit.php67
1 files changed, 67 insertions, 0 deletions
diff --git a/mod/cool_theme/views/default/forms/profile/edit.php b/mod/cool_theme/views/default/forms/profile/edit.php
new file mode 100644
index 000000000..46b77a95b
--- /dev/null
+++ b/mod/cool_theme/views/default/forms/profile/edit.php
@@ -0,0 +1,67 @@
+<?php
+/**
+ * Edit profile form
+ *
+ * @uses vars['entity']
+ */
+
+?>
+
+<div class="elgg-module elgg-module-info"><div class="elgg-head">
+ <h3><?php echo elgg_echo('user:name:label'); ?></h3></div>
+ <?php echo elgg_view('input/text', array('name' => 'name', 'value' => $vars['entity']->name)); ?>
+</div>
+<?php
+
+$profile_fields = elgg_get_config('profile_fields');
+if (is_array($profile_fields) && count($profile_fields) > 0) {
+ foreach ($profile_fields as $shortname => $valtype) {
+ $metadata = elgg_get_metadata(array(
+ 'guid' => $vars['entity']->guid,
+ 'metadata_name' => $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;
+ }
+
+?>
+<div class="elgg-module elgg-module-info"><div class="elgg-head">
+ <h3><?php echo elgg_echo("profile:{$shortname}") ?></h3>
+ <?php
+ $params = array(
+ 'name' => $shortname,
+ 'value' => $value,
+ );
+ echo elgg_view("input/{$valtype}", $params);
+ $params = array(
+ 'name' => "accesslevel[$shortname]",
+ 'value' => $access_id,
+ );
+ echo elgg_view('input/access', $params);
+ ?>
+</div>
+<?php
+ }
+}
+?>
+<div class="elgg-foot">
+<?php
+ echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $vars['entity']->guid));
+ echo elgg_view('input/submit', array('value' => elgg_echo('save')));
+?>
+</div>