aboutsummaryrefslogtreecommitdiff
path: root/mod/profile/views
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-16 12:32:40 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-16 12:32:40 +0000
commit554e8f7fedab096467b2d08e8a6f67910267c69d (patch)
tree2194a6a71217a717530dae3be9a574ca222567d2 /mod/profile/views
parent1e0a90d6488275b50dce0696c7761b0979a8bc69 (diff)
downloadelgg-554e8f7fedab096467b2d08e8a6f67910267c69d.tar.gz
elgg-554e8f7fedab096467b2d08e8a6f67910267c69d.tar.bz2
Individual profile items can now have access restrictions; also made the profile JS more cache friendly
git-svn-id: https://code.elgg.org/elgg/trunk@1968 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/profile/views')
-rw-r--r--mod/profile/views/default/profile/edit.php23
-rw-r--r--mod/profile/views/default/profile/javascript.php2
-rw-r--r--mod/profile/views/default/profile/metatags.php2
3 files changed, 23 insertions, 4 deletions
diff --git a/mod/profile/views/default/profile/edit.php b/mod/profile/views/default/profile/edit.php
index ea0a307fc..5d409140d 100644
--- a/mod/profile/views/default/profile/edit.php
+++ b/mod/profile/views/default/profile/edit.php
@@ -22,7 +22,23 @@
//var_export($vars['profile']);
if (is_array($vars['config']->profile) && sizeof($vars['config']->profile) > 0)
foreach($vars['config']->profile as $shortname => $valtype) {
-
+ if ($metadata = get_metadata_byname($vars['entity']->guid, $shortname)) {
+ 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 = 1;
+ }
+
?>
<p>
@@ -30,13 +46,14 @@
<?php echo elgg_echo("profile:{$shortname}") ?><br />
<?php echo elgg_view("input/{$valtype}",array(
'internalname' => $shortname,
- 'value' => $vars['entity']->$shortname,
+ 'value' => $value,
)); ?>
</label>
+ <?php echo elgg_view('input/access',array('internalname' => 'accesslevel['.$shortname.']', 'value' => $access_id)); ?>
</p>
<?php
-
+
}
?>
diff --git a/mod/profile/views/default/profile/javascript.php b/mod/profile/views/default/profile/javascript.php
index e0f87522c..2620956b3 100644
--- a/mod/profile/views/default/profile/javascript.php
+++ b/mod/profile/views/default/profile/javascript.php
@@ -13,6 +13,8 @@
*/
header("Content-type: text/javascript");
+ header("Pragma: public");
+ header("Cache-Control: public");
?>
diff --git a/mod/profile/views/default/profile/metatags.php b/mod/profile/views/default/profile/metatags.php
index 84682f6f6..3a58651ca 100644
--- a/mod/profile/views/default/profile/metatags.php
+++ b/mod/profile/views/default/profile/metatags.php
@@ -13,4 +13,4 @@
?>
- <script type="text/javascript" src="<?php echo $vars['url']; ?>mod/profile/javascript.php" ></script>
+ <script type="text/javascript" src="<?php echo $vars['url']; ?>pg/iconjs/profile.js" ></script>