New Events for avatar settings
This commit is contained in:
parent
83830c26e7
commit
4db184e5b4
12
EVENTS.txt
12
EVENTS.txt
|
@ -290,6 +290,18 @@ StartRegistrationTry: before validating and saving a new user
|
|||
EndRegistrationTry: after saving a new user (note: no profile or user object!)
|
||||
- $action: action object being shown
|
||||
|
||||
StartAvatarFormData: before displaying avatar form
|
||||
- $action: action object being shown
|
||||
|
||||
EndAvatarFormData: after displaying avatar form
|
||||
- $action: action object being shown
|
||||
|
||||
StartAvatarSaveForm: before saving the avatar
|
||||
- $action: action object being shown
|
||||
|
||||
EndAvatarSaveForm: after saving the avatar
|
||||
- $action: action object being shown
|
||||
|
||||
StartNewQueueManager: before trying to start a new queue manager; good for plugins implementing new queue manager classes
|
||||
- $qm: empty queue manager to set
|
||||
|
||||
|
|
|
@ -119,6 +119,7 @@ class AvatarsettingsAction extends AccountSettingsAction
|
|||
$this->element('legend', null, _('Avatar settings'));
|
||||
$this->hidden('token', common_session_token());
|
||||
|
||||
if (Event::handle('StartAvatarFormData', array($this))) {
|
||||
$this->elementStart('ul', 'form_data');
|
||||
if ($original) {
|
||||
$this->elementStart('li', array('id' => 'avatar_original',
|
||||
|
@ -165,6 +166,8 @@ class AvatarsettingsAction extends AccountSettingsAction
|
|||
$this->submit('upload', _('Upload'));
|
||||
$this->elementEnd('li');
|
||||
$this->elementEnd('ul');
|
||||
}
|
||||
Event::handle('EndAvatarFormData', array($this));
|
||||
|
||||
$this->elementEnd('fieldset');
|
||||
$this->elementEnd('form');
|
||||
|
@ -267,6 +270,7 @@ class AvatarsettingsAction extends AccountSettingsAction
|
|||
return;
|
||||
}
|
||||
|
||||
if (Event::handle('StartAvatarSaveForm', array($this))) {
|
||||
if ($this->arg('upload')) {
|
||||
$this->uploadAvatar();
|
||||
} else if ($this->arg('crop')) {
|
||||
|
@ -276,6 +280,8 @@ class AvatarsettingsAction extends AccountSettingsAction
|
|||
} else {
|
||||
$this->showForm(_('Unexpected form submission.'));
|
||||
}
|
||||
Event::handle('EndAvatarSaveForm', array($this));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user