hook for getting profile avatars
This commit is contained in:
parent
b511b59f15
commit
a0b4282cbf
@ -1366,3 +1366,12 @@ EndLocalURL: before resolving a local url for an action
|
|||||||
- &$addSession: whether to add session variable
|
- &$addSession: whether to add session variable
|
||||||
- &$url: resulting URL to local resource
|
- &$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)) {
|
if (is_null($height)) {
|
||||||
$height = $width;
|
$height = $width;
|
||||||
}
|
}
|
||||||
return Avatar::pkeyGet(array('profile_id' => $this->id,
|
|
||||||
'width' => $width,
|
$avatar = null;
|
||||||
'height' => $height));
|
|
||||||
|
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()
|
function getOriginalAvatar()
|
||||||
|
Loading…
Reference in New Issue
Block a user