Commit a0b4282c authored by Evan Prodromou's avatar Evan Prodromou

hook for getting profile avatars

parent b511b59f
......@@ -1366,3 +1366,12 @@ EndLocalURL: before resolving a local url for an action
- &$addSession: whether to add session variable
- &$url: resulting URL to local resource
StartProfileGetAvatar: When getting an avatar for a profile
- $profile: profile
- $size: size of the avatar
- &$avatar: avatar
EndProfileGetAvatar: After getting an avatar for a profile
- $profile: profile
- $size: size of the avatar
- &$avatar: avatar
......@@ -68,9 +68,17 @@ class Profile extends Memcached_DataObject
if (is_null($height)) {
$height = $width;
}
return Avatar::pkeyGet(array('profile_id' => $this->id,
'width' => $width,
'height' => $height));
$avatar = null;
if (Event::handle('StartProfileGetAvatar', array($this, $width, &$avatar))) {
$avatar = Avatar::pkeyGet(array('profile_id' => $this->id,
'width' => $width,
'height' => $height));
Event::handle('EndProfileGetAvatar', array($this, $width, &$avatar));
}
return $avatar;
}
function getOriginalAvatar()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment