forked from GNUsocial/gnu-social
Start and End EmailFormData events include current profile
This commit is contained in:
parent
a9bfa1979d
commit
c8873de08b
@ -290,11 +290,13 @@ StartProfileSaveForm: before starting to save a profile settings form
|
|||||||
EndProfileSaveForm: after saving a profile settings form (after commit, no profile or user object!)
|
EndProfileSaveForm: after saving a profile settings form (after commit, no profile or user object!)
|
||||||
- $action: action object being shown
|
- $action: action object being shown
|
||||||
|
|
||||||
StartEmailFormData: just before showing text entry fields on email settings page
|
StartEmailFormData: just before showing form input fields on email settings page
|
||||||
- $action: action object being shown
|
- $action: Action object being shown
|
||||||
|
- $scoped: Profile for whom settings are being configured
|
||||||
|
|
||||||
EndEmailFormData: just after showing text entry fields on email settings page
|
EndEmailFormData: just after showing form input fields on email settings page
|
||||||
- $action: action object being shown
|
- $action: action object being shown
|
||||||
|
- $scoped: Profile for whom settings are being configured
|
||||||
|
|
||||||
StartEmailSaveForm: before starting to save a email settings form
|
StartEmailSaveForm: before starting to save a email settings form
|
||||||
- $action: action object being shown
|
- $action: action object being shown
|
||||||
|
@ -206,7 +206,7 @@ class EmailsettingsAction extends SettingsAction
|
|||||||
|
|
||||||
$this->elementStart('ul', 'form_data');
|
$this->elementStart('ul', 'form_data');
|
||||||
|
|
||||||
if (Event::handle('StartEmailFormData', array($this))) {
|
if (Event::handle('StartEmailFormData', array($this, $this->scoped))) {
|
||||||
$this->elementStart('li');
|
$this->elementStart('li');
|
||||||
$this->checkbox('emailnotifysub',
|
$this->checkbox('emailnotifysub',
|
||||||
// TRANS: Checkbox label in e-mail preferences form.
|
// TRANS: Checkbox label in e-mail preferences form.
|
||||||
@ -244,7 +244,7 @@ class EmailsettingsAction extends SettingsAction
|
|||||||
_('Publish a MicroID for my email address.'),
|
_('Publish a MicroID for my email address.'),
|
||||||
$user->emailmicroid);
|
$user->emailmicroid);
|
||||||
$this->elementEnd('li');
|
$this->elementEnd('li');
|
||||||
Event::handle('EndEmailFormData', array($this));
|
Event::handle('EndEmailFormData', array($this, $this->scoped));
|
||||||
}
|
}
|
||||||
$this->elementEnd('ul');
|
$this->elementEnd('ul');
|
||||||
// TRANS: Button label to save e-mail preferences.
|
// TRANS: Button label to save e-mail preferences.
|
||||||
|
@ -96,18 +96,17 @@ class EmailSummaryPlugin extends Plugin
|
|||||||
* Add a checkbox to turn off email summaries
|
* Add a checkbox to turn off email summaries
|
||||||
*
|
*
|
||||||
* @param Action $action Action being executed (emailsettings)
|
* @param Action $action Action being executed (emailsettings)
|
||||||
|
* @param Profile $scoped Profile for whom settings are configured (current user)
|
||||||
*
|
*
|
||||||
* @return boolean hook value
|
* @return boolean hook value
|
||||||
*/
|
*/
|
||||||
function onEndEmailFormData($action)
|
public function onEndEmailFormData(Action $action, Profile $scoped)
|
||||||
{
|
{
|
||||||
$user = common_current_user();
|
|
||||||
|
|
||||||
$action->elementStart('li');
|
$action->elementStart('li');
|
||||||
$action->checkbox('emailsummary',
|
$action->checkbox('emailsummary',
|
||||||
// TRANS: Checkbox label in e-mail preferences form.
|
// TRANS: Checkbox label in e-mail preferences form.
|
||||||
_m('Send me a periodic summary of updates from my network'),
|
_m('Send me a periodic summary of updates from my network'),
|
||||||
Email_summary_status::getSendSummary($user->id));
|
Email_summary_status::getSendSummary($scoped->id));
|
||||||
$action->elementEnd('li');
|
$action->elementEnd('li');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user