aboutsummaryrefslogtreecommitdiff
path: root/mod/profile/views
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-10-08 11:27:00 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-10-08 11:27:00 +0000
commit939ce5e44c049b0897899c8c7a79544068d2e3b3 (patch)
tree60bd2fab99b295623466d9093acc1449ffd873fb /mod/profile/views
parent161d44727c9e786f538e9715a566eee76bc7187a (diff)
downloadelgg-939ce5e44c049b0897899c8c7a79544068d2e3b3.tar.gz
elgg-939ce5e44c049b0897899c8c7a79544068d2e3b3.tar.bz2
Closes #301: Profile icons now use getIcon() API. Overrides now possible:
For themes to override, create a plugin hook listening to 'entity:icon:url' and object 'user'. In the hook return a different url. To replace default user icons in a plugin one might create a hook: function profile_usericon_hook($hook, $entity_type, $returnvalue, $params) { if ((!$returnvalue) && ($params['entity'] instanceof ElggUser)) { // return your default graphic here. } } And set it to priority 900 (lower priority than the code that displays a pretty icon for users but higher than the default object display code in entities.php) git-svn-id: https://code.elgg.org/elgg/trunk@2221 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/profile/views')
-rw-r--r--mod/profile/views/default/profile/editicon.php2
-rw-r--r--mod/profile/views/default/profile/icon.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/mod/profile/views/default/profile/editicon.php b/mod/profile/views/default/profile/editicon.php
index 0ab550eee..e3cf6517a 100644
--- a/mod/profile/views/default/profile/editicon.php
+++ b/mod/profile/views/default/profile/editicon.php
@@ -24,7 +24,7 @@
<label><?php echo elgg_echo('profile:currentavatar'); ?></label>
<?php
- $user_avatar = $vars['url'] . "pg/icon/" . $_SESSION['user']->username . "/medium/" . $_SESSION['user']->icontime . ".jpg";
+ $user_avatar = $_SESSION['user']->getIcon('medium');//$vars['url'] . "pg/icon/" . $_SESSION['user']->username . "/medium/" . $_SESSION['user']->icontime . ".jpg";
echo "<img src=\"{$user_avatar}\" alt=\"avatar\" />";
?>
diff --git a/mod/profile/views/default/profile/icon.php b/mod/profile/views/default/profile/icon.php
index 49d87a95f..ef5ab3769 100644
--- a/mod/profile/views/default/profile/icon.php
+++ b/mod/profile/views/default/profile/icon.php
@@ -76,7 +76,7 @@
}
- ?><img src="<?php echo $vars['url']; ?>pg/icon/<?php echo $username; ?>/<?php echo $vars['size']; ?>/<?php echo $icontime; ?>.jpg" border="0" <?php echo $align; ?> title="<?php echo htmlentities($vars['entity']->name, null, 'UTF-8'); ?>" <?php echo $vars['js']; ?> /><?php
+ ?><img src="<?php echo $vars['entity']->getIcon($vars['size']); ?>" border="0" <?php echo $align; ?> title="<?php echo htmlentities($vars['entity']->name, null, 'UTF-8'); ?>" <?php echo $vars['js']; ?> /><?php
if (!$override) {