forked from GNUsocial/gnu-social
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!)
|
EndRegistrationTry: after saving a new user (note: no profile or user object!)
|
||||||
- $action: action object being shown
|
- $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
|
StartNewQueueManager: before trying to start a new queue manager; good for plugins implementing new queue manager classes
|
||||||
- $qm: empty queue manager to set
|
- $qm: empty queue manager to set
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,7 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
$this->element('legend', null, _('Avatar settings'));
|
$this->element('legend', null, _('Avatar settings'));
|
||||||
$this->hidden('token', common_session_token());
|
$this->hidden('token', common_session_token());
|
||||||
|
|
||||||
|
if (Event::handle('StartAvatarFormData', array($this))) {
|
||||||
$this->elementStart('ul', 'form_data');
|
$this->elementStart('ul', 'form_data');
|
||||||
if ($original) {
|
if ($original) {
|
||||||
$this->elementStart('li', array('id' => 'avatar_original',
|
$this->elementStart('li', array('id' => 'avatar_original',
|
||||||
|
@ -165,6 +166,8 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
$this->submit('upload', _('Upload'));
|
$this->submit('upload', _('Upload'));
|
||||||
$this->elementEnd('li');
|
$this->elementEnd('li');
|
||||||
$this->elementEnd('ul');
|
$this->elementEnd('ul');
|
||||||
|
}
|
||||||
|
Event::handle('EndAvatarFormData', array($this));
|
||||||
|
|
||||||
$this->elementEnd('fieldset');
|
$this->elementEnd('fieldset');
|
||||||
$this->elementEnd('form');
|
$this->elementEnd('form');
|
||||||
|
@ -267,6 +270,7 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Event::handle('StartAvatarSaveForm', array($this))) {
|
||||||
if ($this->arg('upload')) {
|
if ($this->arg('upload')) {
|
||||||
$this->uploadAvatar();
|
$this->uploadAvatar();
|
||||||
} else if ($this->arg('crop')) {
|
} else if ($this->arg('crop')) {
|
||||||
|
@ -276,6 +280,8 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
} else {
|
} else {
|
||||||
$this->showForm(_('Unexpected form submission.'));
|
$this->showForm(_('Unexpected form submission.'));
|
||||||
}
|
}
|
||||||
|
Event::handle('EndAvatarSaveForm', array($this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue