function showScripts()
{
parent::showScripts();
+ $this->script('emailsettings.js');
$this->autofocus('email');
}
$this->elementStart('fieldset', array('id' => 'settings_email_incoming'));
// TRANS: Form legend for incoming e-mail settings form.
$this->element('legend', null, _('Incoming email'));
+
+ $this->elementStart('ul', 'form_data');
+ $this->elementStart('li');
+ $this->checkbox('emailpost',
+ // TRANS: Checkbox label in e-mail preferences form.
+ _('I want to post notices by email.'),
+ $user->emailpost);
+ $this->elementEnd('li');
+ $this->elementEnd('ul');
+
+ // Our stylesheets make the form_data list items all floats, which
+ // creates lots of problems with trying to wrap divs around things.
+ // This should force a break before the next section, which needs
+ // to be separate so we can disable the things in it when the
+ // checkbox is off.
+ $this->elementStart('div', array('style' => 'clear: both'));
+ $this->elementEnd('div');
+
+ $this->elementStart('div', array('id' => 'emailincoming'));
+
if ($user->incomingemail) {
$this->elementStart('p');
$this->element('span', 'address', $user->incomingemail);
}
$this->elementStart('p');
- $this->element('span', 'input_instructions',
- // TRANS: Instructions for incoming e-mail address input form.
- _('Make a new email address for posting to; '.
- 'cancels the old one.'));
+ if ($user->incomingemail) {
+ // TRANS: Instructions for incoming e-mail address input form, when an address has already been assigned.
+ $msg = _('Make a new email address for posting to; '.
+ 'cancels the old one.');
+ } else {
+ // TRANS: Instructions for incoming e-mail address input form.
+ $msg = _('To send notices via email, we need to create a unique email address for you on this server:');
+ }
+ $this->element('span', 'input_instructions', $msg);
$this->elementEnd('p');
+
// TRANS: Button label for adding an e-mail address to send notices from.
$this->submit('newincoming', _m('BUTTON','New'));
+
+ $this->elementEnd('div'); // div#emailincoming
+
$this->elementEnd('fieldset');
}
_('Allow friends to nudge me and send me an email.'),
$user->emailnotifynudge);
$this->elementEnd('li');
- if (common_config('emailpost', 'enabled')) {
- $this->elementStart('li');
- $this->checkbox('emailpost',
- // TRANS: Checkbox label in e-mail preferences form.
- _('I want to post notices by email.'),
- $user->emailpost);
- $this->elementEnd('li');
- }
$this->elementStart('li');
$this->checkbox('emailmicroid',
// TRANS: Checkbox label in e-mail preferences form.
$orig = clone($user);
$user->incomingemail = null;
+ $user->emailpost = 0;
if (!$user->updateKeys($orig)) {
common_log_db_error($user, 'UPDATE', __FILE__);
$orig = clone($user);
$user->incomingemail = mail_new_incoming_address();
+ $user->emailpost = 1;
if (!$user->updateKeys($orig)) {
common_log_db_error($user, 'UPDATE', __FILE__);