- $this->elementStart('ul', 'form_data');
- $this->elementStart('li');
- // TRANS: Field label for Instant Messaging address input in Instant Messaging settings form.
- $this->input('jabber', _('IM address'),
- ($this->arg('jabber')) ? $this->arg('jabber') : null,
- // TRANS: IM address input field instructions in Instant Messaging settings form.
- // TRANS: %s is the Instant Messaging address set for the site.
- // TRANS: Do not translate "example.org". It is one of the domain names reserved for use in examples by
- // TRANS: http://www.rfc-editor.org/rfc/rfc2606.txt. Any other domain may be owned by a legitimate
- // TRANS: person or organization.
- sprintf(_('Jabber or Google Talk address, '.
- 'like "UserName@example.org". '.
- 'First, make sure to add %s to your '.
- 'buddy list in your IM client or on Google Talk.'),
- jabber_daemon_address()));
- $this->elementEnd('li');
- $this->elementEnd('ul');
- // TRANS: Button label for adding an Instant Messaging address in Instant Messaging settings form.
- $this->submit('add', _m('BUTTON','Add'));
+ try {
+ $confirm = $this->getConfirmation($transport);
+ $this->element('p', 'form_unconfirmed', $confirm->address);
+ // TRANS: Form note in IM settings form.
+ $this->element('p', 'form_note',
+ // TRANS: Form note in IM settings form.
+ // TRANS: %s is the IM service name, %2$s is the IM address set.
+ sprintf(_('Awaiting confirmation on this address. '.
+ 'Check your %1$s account for a '.
+ 'message with further instructions. '.
+ '(Did you add %2$s to your buddy list?)'),
+ $transport_info['display'],
+ $transport_info['daemonScreenname']));
+ $this->hidden('screenname', $confirm->address);
+ // TRANS: Button label to cancel an IM address confirmation procedure.
+ $this->submit('cancel', _m('BUTTON','Cancel'));
+ } catch (NoResultException $e) {
+ $this->elementStart('ul', 'form_data');
+ $this->elementStart('li');
+ // TRANS: Field label for IM address.
+ $this->input('screenname', _('IM address'),
+ ($this->arg('screenname')) ? $this->arg('screenname') : null,
+ // TRANS: Field title for IM address. %s is the IM service name.
+ sprintf(_('%s screenname.'),
+ $transport_info['display']));
+ $this->elementEnd('li');
+ $this->elementEnd('ul');
+ // TRANS: Button label for adding an IM address in IM settings form.
+ $this->submit('add', _m('BUTTON','Add'));
+ }
+ }
+ $this->elementEnd('fieldset');
+ $this->elementEnd('form');
+ }
+
+ if($user_im_prefs_by_transport)
+ {
+ $this->elementStart('form', array('method' => 'post',
+ 'id' => 'form_settings_im',
+ 'class' => 'form_settings',
+ 'action' =>
+ common_local_url('imsettings')));
+ $this->elementStart('fieldset', array('id' => 'settings_im_preferences'));
+ // TRANS: Header for IM preferences form.
+ $this->element('legend', null, _('IM Preferences'));
+ $this->hidden('token', common_session_token());
+ $this->elementStart('table');
+ $this->elementStart('tr');
+ foreach($user_im_prefs_by_transport as $transport=>$user_im_prefs)
+ {
+ $this->element('th', null, $transports[$transport]['display']);
+ }
+ $this->elementEnd('tr');
+ $preferences = array(
+ // TRANS: Checkbox label in IM preferences form.
+ array('name'=>'notify', 'description'=>_('Send me notices')),
+ // TRANS: Checkbox label in IM preferences form.
+ array('name'=>'updatefrompresence', 'description'=>_('Post a notice when my status changes.')),
+ // TRANS: Checkbox label in IM preferences form.
+ array('name'=>'replies', 'description'=>_('Send me replies '.
+ 'from people I\'m not subscribed to.')),
+ );
+ foreach($preferences as $preference)
+ {
+ $this->elementStart('tr');
+ foreach($user_im_prefs_by_transport as $transport=>$user_im_prefs)
+ {
+ $preference_name = $preference['name'];
+ $this->elementStart('td');
+ $this->checkbox($transport . '_' . $preference['name'],
+ $preference['description'],
+ $user_im_prefs->$preference_name);
+ $this->elementEnd('td');
+ }
+ $this->elementEnd('tr');