- # too much common patterns here... abstractable?
- common_input('jabber', _t('IM Address'),
- ($this->arg('jabber')) ? $this->arg('jabber') : $user->jabber,
- _t('Jabber or GTalk address, like "UserName@example.org"'));
+
+ common_element('h2', NULL, _('Address'));
+
+ if ($user->jabber) {
+ common_element_start('p');
+ common_element('span', 'address confirmed', $user->jabber);
+ common_element('span', 'input_instructions',
+ _('Current confirmed Jabber/GTalk address.'));
+ common_hidden('jabber', $user->jabber);
+ common_element_end('p');
+ common_submit('remove', _('Remove'));
+ } else {
+ $confirm = $this->get_confirmation();
+ if ($confirm) {
+ common_element_start('p');
+ common_element('span', 'address unconfirmed', $confirm->address);
+ common_element('span', 'input_instructions',
+ sprintf(_('Awaiting confirmation on this address. Check your Jabber/GTalk account for a message with further instructions. (Did you add %s to your buddy list?)'), jabber_daemon_address()));
+ common_hidden('jabber', $confirm->address);
+ common_element_end('p');
+ common_submit('cancel', _('Cancel'));
+ } else {
+ common_input('jabber', _('IM Address'),
+ ($this->arg('jabber')) ? $this->arg('jabber') : NULL,
+ sprintf(_('Jabber or GTalk address, like "UserName@example.org". First, make sure to add %s to your buddy list in your IM client or on GTalk.'), jabber_daemon_address()));
+ common_submit('add', _('Add'));
+ }
+ }
+
+ common_element('h2', NULL, _('Preferences'));
+