diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-10-08 11:27:00 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-10-08 11:27:00 +0000 |
commit | 939ce5e44c049b0897899c8c7a79544068d2e3b3 (patch) | |
tree | 60bd2fab99b295623466d9093acc1449ffd873fb /engine | |
parent | 161d44727c9e786f538e9715a566eee76bc7187a (diff) | |
download | elgg-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 'engine')
-rw-r--r-- | engine/lib/entities.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php index bd42a9edb..3a6e3c035 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -1853,7 +1853,8 @@ case 'master': case 'large' : $size = 'large'; break; - case 'topbar' : + case 'topbar' : $size = 'topbar'; break; + case 'tiny' : $size = 'tiny'; break; case 'small' : $size = 'small'; break; @@ -1864,10 +1865,10 @@ $url = false; - $viewtype = elgg_get_viewtype(); + $viewtype = elgg_get_viewtype(); // Step one, see if anyone knows how to render this in the current view - $url = trigger_plugin_hook('entity:icon:url', $type, array('entity' => $entity, 'viewtype' => $viewtype, 'size' => $size), $url); + $url = trigger_plugin_hook('entity:icon:url', $entity->getType(), array('entity' => $entity, 'viewtype' => $viewtype, 'size' => $size), $url); if(!@getimagesize($url)) $url = false; // If not exist then don't use the url |