aboutsummaryrefslogtreecommitdiff
path: root/mod/profile/views/default
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-28 10:36:35 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-28 10:36:35 +0000
commit8fbbdf8785a9640e20bd4b4c59a02fbb3cac8337 (patch)
tree0526f6550687817afc37d6372a122ab37e994abb /mod/profile/views/default
parent37d233139be3e345fc1d33f752c7c9c8cd4f6ff1 (diff)
downloadelgg-8fbbdf8785a9640e20bd4b4c59a02fbb3cac8337.tar.gz
elgg-8fbbdf8785a9640e20bd4b4c59a02fbb3cac8337.tar.bz2
The profile now has fields set in start.php. TODO: make those user editable, once we have the admin panel ...
git-svn-id: https://code.elgg.org/elgg/trunk@543 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/profile/views/default')
-rw-r--r--mod/profile/views/default/profile/edit.php53
-rw-r--r--mod/profile/views/default/user/user.php41
2 files changed, 35 insertions, 59 deletions
diff --git a/mod/profile/views/default/profile/edit.php b/mod/profile/views/default/profile/edit.php
index 0cd648bf6..685793bff 100644
--- a/mod/profile/views/default/profile/edit.php
+++ b/mod/profile/views/default/profile/edit.php
@@ -10,48 +10,37 @@
* @link http://elgg.com/
*
* @uses $vars['entity'] The user entity
+ * @uses $vars['profile'] Profile items from $CONFIG->profile, defined in profile/start.php for now
*/
?>
<form action="<?php echo $vars['url']; ?>action/profile/edit" method="post">
+<?php
+
+ //var_export($vars['profile']);
+ if (is_array($vars['profile']) && sizeof($vars['profile']) > 0)
+ foreach($vars['profile'] as $shortname => $valtype) {
+
+?>
+
<p>
<label>
- <?php echo elgg_echo("profile:aboutme"); ?><br />
- <?php echo elgg_view("input/longtext",array(
- 'internalname' => 'aboutme',
- 'value' => $vars['entity']->description,
- )); ?>
- </label>
- </p>
- <p>
- <label>
- <?php echo elgg_echo("profile:location"); ?><br />
- <?php echo elgg_view("input/tags",array(
- 'internalname' => 'location',
- 'value' => $vars['entity']->location,
- )); ?>
- </label>
- </p>
- <p>
- <label>
- <?php echo elgg_echo("profile:skills"); ?><br />
- <?php echo elgg_view("input/tags",array(
- 'internalname' => 'skills',
- 'value' => $vars['entity']->skills,
- )); ?>
- </label>
- </p>
- <p>
- <label>
- <?php echo elgg_echo("profile:interests"); ?><br />
- <?php echo elgg_view("input/tags",array(
- 'internalname' => 'interests',
- 'value' => $vars['entity']->interests,
- )); ?>
+ <?php echo elgg_echo("profile:{$shortname}") ?><br />
+ <?php echo elgg_view("input/{$valtype}",array(
+ 'internalname' => $shortname,
+ 'value' => $vars['entity']->$shortname,
+ )); ?>
</label>
</p>
+
+<?php
+
+ }
+
+?>
+
<p>
<input type="submit" value="<?php echo elgg_echo("save"); ?>" />
</p>
diff --git a/mod/profile/views/default/user/user.php b/mod/profile/views/default/user/user.php
index 2c64ac0df..d2411c3d9 100644
--- a/mod/profile/views/default/user/user.php
+++ b/mod/profile/views/default/user/user.php
@@ -28,46 +28,33 @@
<?php
}
-
+ if (is_array($vars['profile']) && sizeof($vars['profile']) > 0)
+ foreach($vars['profile'] as $shortname => $valtype) {
+ if ($shortname != "description") {
+ $value = $vars['entity']->$shortname;
+ if (!empty($value)) {
+
?>
- <p>
- <b><?php
-
- echo elgg_echo("profile:location");
-
- ?>: </b>
- <?php
- echo elgg_view('output/tags',array('tags' => $vars['entity']->location));
-
- ?>
- </p>
<p>
<b><?php
-
- echo elgg_echo("profile:skills");
-
- ?>: </b>
- <?php
- echo elgg_view('output/tags',array('tags' => $vars['entity']->skills));
-
- ?>
- </p>
- <p>
- <b><?php
-
- echo elgg_echo("profile:interests");
+ echo elgg_echo("profile:{$shortname}");
?>: </b>
<?php
- echo elgg_view('output/tags',array('tags' => $vars['entity']->interests));
+ echo elgg_view("output/{$valtype}",array('value' => $vars['entity']->$shortname));
?>
+
</p>
- <?php
+ <?php
+ }
+ }
+ }
+
if ($vars['entity']->canEdit()) {
?>