From b9f8e6e8cc25eea4340f558ee67585688a355a39 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 19 May 2011 15:30:38 -0400 Subject: [PATCH 01/26] fail quickly if we can't find a for DomainStatusNetwork --- plugins/DomainStatusNetwork/DomainStatusNetworkPlugin.php | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/DomainStatusNetwork/DomainStatusNetworkPlugin.php b/plugins/DomainStatusNetwork/DomainStatusNetworkPlugin.php index e79a445f20..9390a6e083 100644 --- a/plugins/DomainStatusNetwork/DomainStatusNetworkPlugin.php +++ b/plugins/DomainStatusNetwork/DomainStatusNetworkPlugin.php @@ -77,6 +77,7 @@ class DomainStatusNetworkPlugin extends Plugin $sn = Status_network::staticGet('nickname', $nickname); } catch (Exception $e) { $this->log(LOG_ERR, $e->getMessage()); + return; } $tags = $sn->getTags(); From 1d1a929718b222308505f16ed4425a89e9679b60 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Fri, 20 May 2011 16:03:29 +0200 Subject: [PATCH 02/26] Update translator documentation and L10n. --- .../lib/extendedprofilewidget.php | 20 +++++++++---------- plugins/OStatus/OStatusPlugin.php | 6 ++++-- plugins/OStatus/actions/ostatusgroup.php | 3 ++- plugins/OStatus/actions/ostatussub.php | 9 ++++++--- plugins/OStatus/actions/ostatustag.php | 2 +- 5 files changed, 23 insertions(+), 17 deletions(-) diff --git a/plugins/ExtendedProfile/lib/extendedprofilewidget.php b/plugins/ExtendedProfile/lib/extendedprofilewidget.php index 03be420bea..f04dccd0ae 100644 --- a/plugins/ExtendedProfile/lib/extendedprofilewidget.php +++ b/plugins/ExtendedProfile/lib/extendedprofilewidget.php @@ -328,7 +328,7 @@ class ExtendedProfileWidget extends Form if (!empty($field['company'])) { $this->out->element('div', 'field', $field['company']); - // TRANS: Field label in experience area of extended profile (when did one start a position). + // TRANS: Field label in extended profile (when did one start a position or education). $this->out->element('div', 'label', _m('Start')); $this->out->element( 'div', @@ -336,7 +336,7 @@ class ExtendedProfileWidget extends Form date('j M Y', strtotime($field['start']) ) ); - // TRANS: Field label in experience area of extended profile (when did one end a position). + // TRANS: Field label in extended profile (when did one end a position or education). $this->out->element('div', 'label', _m('End')); $this->out->element( 'div', @@ -376,7 +376,7 @@ class ExtendedProfileWidget extends Form isset($field['company']) ? $field['company'] : null ); - // TRANS: Field label in experience edit area of extended profile (when did one start at a company). + // TRANS: Field label in extended profile (when did one start a position or education). $this->out->element('div', 'label', _m('Start')); $this->out->input( $id . '-start', @@ -384,7 +384,7 @@ class ExtendedProfileWidget extends Form isset($field['start']) ? date('j M Y', strtotime($field['start'])) : null ); - // TRANS: Field label in experience edit area of extended profile (when did one terminate at a company). + // TRANS: Field label in extended profile (when did one end a position or education). $this->out->element('div', 'label', _m('End')); $this->out->input( @@ -416,13 +416,13 @@ class ExtendedProfileWidget extends Form $this->out->element('div', 'label', _m('Institution')); if (!empty($field['school'])) { $this->out->element('div', 'field', $field['school']); - // TRANS: Field label in education area of extended profile. + // TRANS: Field label in extended profile for specifying an academic degree. $this->out->element('div', 'label', _m('Degree')); $this->out->element('div', 'field', $field['degree']); // TRANS: Field label in education area of extended profile. $this->out->element('div', 'label', _m('Description')); $this->out->element('div', 'field', $field['description']); - // TRANS: Field label in education area of extended profile (when did one start an education). + // TRANS: Field label in extended profile (when did one start a position or education). $this->out->element('div', 'label', _m('Start')); $this->out->element( 'div', @@ -430,7 +430,7 @@ class ExtendedProfileWidget extends Form date('j M Y', strtotime($field['start']) ) ); - // TRANS: Field label in education area of extended profile (when did one end a education). + // TRANS: Field label in extended profile (when did one end a position or education). $this->out->element('div', 'label', _m('End')); $this->out->element( 'div', @@ -460,7 +460,7 @@ class ExtendedProfileWidget extends Form isset($field['school']) ? $field['school'] : null ); - // TRANS: Field label in education edit area of extended profile. + // TRANS: Field label in extended profile for specifying an academic degree. $this->out->element('div', 'label', _m('Degree')); $this->out->input( $id . '-degree', @@ -477,7 +477,7 @@ class ExtendedProfileWidget extends Form isset($field['description']) ? $field['description'] : null ); - // TRANS: Field label in education edit area of extended profile (when did one start an education). + // TRANS: Field label in extended profile (when did one start a position or education). $this->out->element('div', 'label', _m('Start')); $this->out->input( $id . '-start', @@ -486,7 +486,7 @@ class ExtendedProfileWidget extends Form isset($field['start']) ? date('j M Y', strtotime($field['start'])) : null ); - // TRANS: Field label in education edit area of extended profile (when did one end an education). + // TRANS: Field label in extended profile (when did one end a position or education). $this->out->element('div', 'label', _m('End')); $this->out->input( $id . '-end', diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index af343362fb..1a02cdc8d3 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -327,7 +327,8 @@ class OStatusPlugin extends Plugin return false; } catch (Exception $e) { - // TRANS: Error message in OStatus plugin. + // TRANS: Error message in OStatus plugin. Do not translate the domain names example.com + // TRANS: and example.net, as these are official standard domain names for use in examples. $err = _m("Sorry, we could not reach that address. Please make sure that the OStatus address is like nickname@example.com or http://example.net/nickname."); } @@ -360,7 +361,8 @@ class OStatusPlugin extends Plugin return $this->filter(array($oprofile->localProfile())); } catch (Exception $e) { - // TRANS: Error message in OStatus plugin. + // TRANS: Error message in OStatus plugin. Do not translate the domain names example.com + // TRANS: and example.net, as these are official standard domain names for use in examples. $this->msg = _m("Sorry, we could not reach that address. Please make sure that the OStatus address is like nickname@example.com or http://example.net/nickname."); return array(); } diff --git a/plugins/OStatus/actions/ostatusgroup.php b/plugins/OStatus/actions/ostatusgroup.php index f2170c0346..e2c4121c3f 100644 --- a/plugins/OStatus/actions/ostatusgroup.php +++ b/plugins/OStatus/actions/ostatusgroup.php @@ -77,7 +77,8 @@ class OStatusGroupAction extends OStatusSubAction // TRANS: Field label. _m('Join group'), $this->profile_uri, - // TRANS: Tooltip for field label "Join group". + // TRANS: Tooltip for field label "Join group". Do not translate the "example.net" + // TRANS: domain name in the URL, as it is an official standard domain name for examples. _m("OStatus group's address, like http://example.net/group/nickname.")); $this->elementEnd('li'); $this->elementEnd('ul'); diff --git a/plugins/OStatus/actions/ostatussub.php b/plugins/OStatus/actions/ostatussub.php index c592e8b380..00f9c81faa 100644 --- a/plugins/OStatus/actions/ostatussub.php +++ b/plugins/OStatus/actions/ostatussub.php @@ -228,14 +228,16 @@ class OStatusSubAction extends Action } else if (Validate::uri($this->profile_uri)) { $this->oprofile = Ostatus_profile::ensureProfileURL($this->profile_uri); } else { - // TRANS: Error text. + // TRANS: Error message in OStatus plugin. Do not translate the domain names example.com + // TRANS: and example.net, as these are official standard domain names for use in examples. $this->error = _m("Sorry, we could not reach that address. Please make sure that the OStatus address is like nickname@example.com or http://example.net/nickname."); common_debug('Invalid address format.', __FILE__); return false; } return true; } catch (FeedSubBadURLException $e) { - // TRANS: Error text. + // TRANS: Error message in OStatus plugin. Do not translate the domain names example.com + // TRANS: and example.net, as these are official standard domain names for use in examples. $this->error = _m("Sorry, we could not reach that address. Please make sure that the OStatus address is like nickname@example.com or http://example.net/nickname."); common_debug('Invalid URL or could not reach server.', __FILE__); } catch (FeedSubBadResponseException $e) { @@ -260,7 +262,8 @@ class OStatusSubAction extends Action common_debug('Not a recognized feed type.', __FILE__); } catch (Exception $e) { // Any new ones we forgot about - // TRANS: Error text. + // TRANS: Error message in OStatus plugin. Do not translate the domain names example.com + // TRANS: and example.net, as these are official standard domain names for use in examples. $this->error = _m("Sorry, we could not reach that address. Please make sure that the OStatus address is like nickname@example.com or http://example.net/nickname."); common_debug(sprintf('Bad feed URL: %s %s', get_class($e), $e->getMessage()), __FILE__); } diff --git a/plugins/OStatus/actions/ostatustag.php b/plugins/OStatus/actions/ostatustag.php index 95f56bbfc4..1df74d9079 100644 --- a/plugins/OStatus/actions/ostatustag.php +++ b/plugins/OStatus/actions/ostatustag.php @@ -74,7 +74,7 @@ class OStatusTagAction extends OStatusInitAction // TRANS: Field label. $this->input('profile', _m('Profile Account'), $this->profile, // TRANS: Field title. - _m('Your account id (i.e. user@identi.ca).')); + _m('Your account id (for example user@identi.ca).')); $this->elementEnd('li'); $this->elementEnd('ul'); $this->submit('submit', $submit); From 3501ad6c77b6c3519dbc849d9ca7827156b7c879 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Fri, 20 May 2011 16:56:12 +0200 Subject: [PATCH 03/26] Add FIXME for missing i18n. --- plugins/MobileProfile/MobileProfilePlugin.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/MobileProfile/MobileProfilePlugin.php b/plugins/MobileProfile/MobileProfilePlugin.php index 4c87f694bb..796bd3b529 100644 --- a/plugins/MobileProfile/MobileProfilePlugin.php +++ b/plugins/MobileProfile/MobileProfilePlugin.php @@ -312,13 +312,15 @@ class MobileProfilePlugin extends WAP20Plugin function onStartShowLocalNavBlock($action) { if ($this->serveMobile) { - $action->element('a', array('href' => '#', 'id' => 'navtoggle'), 'Show Navigation'); + // @todo FIXME: "Show Navigation" / "Hide Navigation" needs i18n + $action->element('a', array('href' => '#', 'id' => 'navtoggle'), 'Show Navigation'); return true; } } function onEndShowScripts($action) { + // @todo FIXME: "Show Navigation" / "Hide Navigation" needs i18n $action->inlineScript(' $(function() { $("#mobile-toggle-disable").click(function() { From e48c26e15695de321ce3de426b0e736d494bcbc6 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Fri, 20 May 2011 16:57:05 +0200 Subject: [PATCH 04/26] Update translator documentation, i18n and L10n. --- lib/inviteform.php | 15 +++++------ .../DomainWhitelist/DomainWhitelistPlugin.php | 4 +-- .../lib/whitelistinviteform.php | 27 ++++++++++--------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lib/inviteform.php b/lib/inviteform.php index da23d31264..364ca75b9b 100644 --- a/lib/inviteform.php +++ b/lib/inviteform.php @@ -41,7 +41,6 @@ require_once INSTALLDIR . '/lib/form.php'; * @author Zach Copley * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ - * */ class InviteForm extends Form { @@ -95,21 +94,21 @@ class InviteForm extends Form { $this->out->elementStart('ul', 'form_data'); $this->out->elementStart('li'); - // TRANS: Field label for a list of e-mail addresses. $this->out->textarea( 'addresses', + // TRANS: Field label for a list of e-mail addresses. _('Email addresses'), $this->out->trimmed('addresses'), - // TRANS: Tooltip for field label for a list of e-mail addresses. + // TRANS: Field title for a list of e-mail addresses. _('Addresses of friends to invite (one per line).') ); $this->out->elementEnd('li'); $this->out->elementStart('li'); - // TRANS: Field label for a personal message to send to invitees. $this->out->textarea( + // TRANS: Field label for a personal message to send to invitees. 'personal', _('Personal message'), $this->out->trimmed('personal'), - // TRANS: Tooltip for field label for a personal message to send to invitees. + // TRANS: Field title for a personal message to send to invitees. _('Optionally add a personal message to the invitation.') ); $this->out->elementEnd('li'); @@ -123,13 +122,13 @@ class InviteForm extends Form */ function formActions() { - // TRANS: Send button for inviting friends $this->out->submit( 'send', + // TRANS: Send button for inviting friends _m('BUTTON','Send'), 'submit form_action-primary', - // TRANS: Submit button title. 'send', - _('Send') + // TRANS: Submit button title. + _('Send invitations.') ); } } diff --git a/plugins/DomainWhitelist/DomainWhitelistPlugin.php b/plugins/DomainWhitelist/DomainWhitelistPlugin.php index cf0d94884d..da49338fe7 100644 --- a/plugins/DomainWhitelist/DomainWhitelistPlugin.php +++ b/plugins/DomainWhitelist/DomainWhitelistPlugin.php @@ -118,7 +118,7 @@ class DomainWhitelistPlugin extends Plugin } else { // TRANS: Client exception thrown when a given e-mailaddress is not in the domain whitelist. // TRANS: %s are whitelisted e-mail domains separated by comma's (localisable). - $message = sprintf(_('Email address must be in one of these domains: %s.'), + $message = sprintf(_m('Email address must be in one of these domains: %s.'), // TRANS: Separator for whitelisted domains. implode(_m('SEPARATOR',', '), $whitelist)); } @@ -132,7 +132,7 @@ class DomainWhitelistPlugin extends Plugin { if (!$this->matchesWhitelist($email)) { // TRANS: Exception thrown when an e-mail address does not match the site's domain whitelist. - throw new Exception(_('That email address is not allowed on this site.')); + throw new Exception(_m('That email address is not allowed on this site.')); } return true; diff --git a/plugins/DomainWhitelist/lib/whitelistinviteform.php b/plugins/DomainWhitelist/lib/whitelistinviteform.php index 7ff730e6a8..77a48f92fa 100644 --- a/plugins/DomainWhitelist/lib/whitelistinviteform.php +++ b/plugins/DomainWhitelist/lib/whitelistinviteform.php @@ -46,7 +46,7 @@ require_once INSTALLDIR . '/lib/form.php'; class WhitelistInviteForm extends Form { private $whitelist = null; - + /** * Constructor * @@ -86,7 +86,7 @@ class WhitelistInviteForm extends Form function formLegend() { // TRANS: Form legend. - $this->out->element('legend', null, _('Invite collegues')); + $this->out->element('legend', null, _m('Invite collegues')); } /** @@ -101,17 +101,17 @@ class WhitelistInviteForm extends Form $this->showEmailLI(); } $this->out->elementStart('li'); - // TRANS: Field label for a personal message to send to invitees. $this->out->textarea( - 'personal', _('Personal message'), + // TRANS: Field label for a personal message to send to invitees. + 'personal', _m('Personal message'), $this->out->trimmed('personal'), - // TRANS: Tooltip for field label for a personal message to send to invitees. - _('Optionally add a personal message to the invitation.') + // TRANS: Field title for a personal message to send to invitees. + _m('Optionally add a personal message to the invitation.') ); $this->out->elementEnd('li'); $this->out->elementEnd('ul'); } - + function showEmailLI() { $this->out->elementStart('li'); @@ -119,8 +119,8 @@ class WhitelistInviteForm extends Form $this->out->text('@'); if (count($this->whitelist) == 1) { $this->out->element( - 'span', - array('class' => 'email_invite'), + 'span', + array('class' => 'email_invite'), $this->whitelist[0] ); $this->out->hidden('domain[]', $this->whitelist[0]); @@ -154,10 +154,11 @@ class WhitelistInviteForm extends Form 'href' => 'javascript://', 'style' => 'display: none;' ), + // TRANS: Link description to action to add another item to a list. _m('Add another item') ); } - + /** * Action elements * @@ -165,13 +166,13 @@ class WhitelistInviteForm extends Form */ function formActions() { - // TRANS: Send button for inviting friends $this->out->submit( 'send', + // TRANS: Send button for inviting friends. _m('BUTTON','Send'), 'submit form_action-primary', - // TRANS: Submit button title. 'send', - _('Send') + // TRANS: Submit button title. + _m('Send invitations.') ); } } From 4aaba2d5f461b670738e404f39faff38f95d4c4b Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Fri, 20 May 2011 16:57:21 +0200 Subject: [PATCH 05/26] Superfluous whitespace removed. --- actions/invite.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/actions/invite.php b/actions/invite.php index 0e3a878f2e..1bfc9f76d3 100644 --- a/actions/invite.php +++ b/actions/invite.php @@ -60,7 +60,6 @@ class InviteAction extends CurrentUserDesignAction function sendInvitations() { if (Event::handle('StartSendInvitations', array(&$this))) { - // CSRF protection $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { @@ -162,7 +161,6 @@ class InviteAction extends CurrentUserDesignAction function showInvitationSuccess() { if (Event::handle('StartShowInvitationSuccess', array($this))) { - if ($this->already) { // TRANS: Message displayed inviting users to use a StatusNet site while the inviting user // TRANS: is already subscribed to one or more users with the given e-mail address(es). From def0483c5e7e627b6f5325cd8845499ca04156f4 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Fri, 20 May 2011 16:58:02 +0200 Subject: [PATCH 06/26] Small change to kick syntax highlighter into shape. --- plugins/EmailRegistration/scripts/cancelemailregistration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/EmailRegistration/scripts/cancelemailregistration.php b/plugins/EmailRegistration/scripts/cancelemailregistration.php index e6430e850f..d834aade60 100644 --- a/plugins/EmailRegistration/scripts/cancelemailregistration.php +++ b/plugins/EmailRegistration/scripts/cancelemailregistration.php @@ -27,7 +27,7 @@ $helptext = << Options: --d --dryrun Don't actually delete the email registration and confirmation code +-d --dryrun Do not actually delete the email registration and confirmation code Cancel an email registration code From f1772b75d5777651b634c5455edd3ceb5a32d08c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 23 May 2011 12:30:34 -0400 Subject: [PATCH 07/26] render question description in QnA plugin --- plugins/QnA/classes/QnA_Answer.php | 2 +- plugins/QnA/classes/QnA_Question.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/QnA/classes/QnA_Answer.php b/plugins/QnA/classes/QnA_Answer.php index d200c7b45a..1a415f4af4 100644 --- a/plugins/QnA/classes/QnA_Answer.php +++ b/plugins/QnA/classes/QnA_Answer.php @@ -219,7 +219,7 @@ class QnA_Answer extends Managed_DataObject $out->elementStart('p', array('class' => implode(' ', $cls))); $out->elementStart('span', 'answer-content'); - $out->raw(QnAPlugin::shorten($answer->content, $notice)); + $out->raw(common_render_text($answer->content)); $out->elementEnd('span'); if (!empty($answer->revisions)) { diff --git a/plugins/QnA/classes/QnA_Question.php b/plugins/QnA/classes/QnA_Question.php index 77d5a57fb1..e2430087c0 100644 --- a/plugins/QnA/classes/QnA_Question.php +++ b/plugins/QnA/classes/QnA_Question.php @@ -227,7 +227,7 @@ class QnA_Question extends Managed_DataObject if (!empty($question->description)) { $out->elementStart('span', 'question-description'); - $out->raw(QnAPlugin::shorten($question->description, $notice)); + $out->raw(common_render_text($question->description)); $out->elementEnd('span'); } From cb283be0714bf732daa35ec1c080aaf2c07da732 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 23 May 2011 16:40:48 -0400 Subject: [PATCH 08/26] Add registered_user_id column to invitation It's valuable for us to know which, if any, invitations have been converted. --- classes/Invitation.php | 1 + classes/statusnet.ini | 1 + db/core.php | 3 +++ 3 files changed, 5 insertions(+) diff --git a/classes/Invitation.php b/classes/Invitation.php index 0e87c1629c..83625b3932 100644 --- a/classes/Invitation.php +++ b/classes/Invitation.php @@ -14,6 +14,7 @@ class Invitation extends Memcached_DataObject public $user_id; // int(4) not_null public $address; // varchar(255) multiple_key not_null public $address_type; // varchar(8) multiple_key not_null + public $registered_user_id; // int(4) not_null public $created; // datetime() not_null /* Static get */ diff --git a/classes/statusnet.ini b/classes/statusnet.ini index bdf96c1ddc..017c4dd58e 100644 --- a/classes/statusnet.ini +++ b/classes/statusnet.ini @@ -258,6 +258,7 @@ user_id = 129 address = 130 address_type = 130 created = 142 +registered_user_id = 129 [invitation__keys] code = K diff --git a/db/core.php b/db/core.php index 10d8e51b9b..f8e4af9843 100644 --- a/db/core.php +++ b/db/core.php @@ -542,14 +542,17 @@ $schema['invitation'] = array( 'address' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'description' => 'invitation sent to'), 'address_type' => array('type' => 'varchar', 'length' => 8, 'not null' => true, 'description' => 'address type ("email", "xmpp", "sms")'), 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'), + 'registered_user_id' => array('type' => 'int', 'not null' => true, 'description' => 'if the invitation is converted, who the new user is'), ), 'primary key' => array('code'), 'foreign keys' => array( 'invitation_user_id_fkey' => array('user', array('user_id' => 'id')), + 'invitation_registered_user_id_fkey' => array('user', array('registered_user_id' => 'id')), ), 'indexes' => array( 'invitation_address_idx' => array('address', 'address_type'), 'invitation_user_id_idx' => array('user_id'), + 'invitation_registered_user_id_idx' => array('registered_user_id'), ), ); From b0b8d36439669bab3944a946f87b56938369df53 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 23 May 2011 17:23:54 -0400 Subject: [PATCH 09/26] registered_user_id can be null --- classes/statusnet.ini | 2 +- db/core.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/statusnet.ini b/classes/statusnet.ini index 017c4dd58e..c5c126a133 100644 --- a/classes/statusnet.ini +++ b/classes/statusnet.ini @@ -258,7 +258,7 @@ user_id = 129 address = 130 address_type = 130 created = 142 -registered_user_id = 129 +registered_user_id = 1 [invitation__keys] code = K diff --git a/db/core.php b/db/core.php index f8e4af9843..626672bf5f 100644 --- a/db/core.php +++ b/db/core.php @@ -542,7 +542,7 @@ $schema['invitation'] = array( 'address' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'description' => 'invitation sent to'), 'address_type' => array('type' => 'varchar', 'length' => 8, 'not null' => true, 'description' => 'address type ("email", "xmpp", "sms")'), 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'), - 'registered_user_id' => array('type' => 'int', 'not null' => true, 'description' => 'if the invitation is converted, who the new user is'), + 'registered_user_id' => array('type' => 'int', 'not null' => false, 'description' => 'if the invitation is converted, who the new user is'), ), 'primary key' => array('code'), 'foreign keys' => array( From c85eeb868e86cf5e0f7cb3885656d8620a8fc8ba Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 23 May 2011 17:25:00 -0400 Subject: [PATCH 10/26] note converted user id on registration --- classes/Invitation.php | 7 +++++++ classes/User.php | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/classes/Invitation.php b/classes/Invitation.php index 83625b3932..27ff400883 100644 --- a/classes/Invitation.php +++ b/classes/Invitation.php @@ -23,4 +23,11 @@ class Invitation extends Memcached_DataObject /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE + + function convert($user) + { + $orig = clone($this); + $this->registered_user_id = $user->id; + return $this->update($orig); + } } diff --git a/classes/User.php b/classes/User.php index 8642c78c27..9f79549327 100644 --- a/classes/User.php +++ b/classes/User.php @@ -263,6 +263,8 @@ class User extends Memcached_DataObject $user->nickname = $nickname; + $invite = null; + // Users who respond to invite email have proven their ownership of that address if (!empty($code)) { @@ -353,6 +355,12 @@ class User extends Memcached_DataObject return false; } + // Mark that this invite was converted + + if (!empty($invite)) { + $invite->convert($user); + } + if (!empty($email) && !$user->email) { $confirm = new Confirm_address(); From fd847c29c517d51851213168c3129b7b5169b5b8 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 23 May 2011 17:45:41 -0400 Subject: [PATCH 11/26] Make emailregistration more invitation-friendly --- plugins/EmailRegistration/emailregister.php | 34 +++++++++++---------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/plugins/EmailRegistration/emailregister.php b/plugins/EmailRegistration/emailregister.php index a7c8e8a2da..1b0902587f 100644 --- a/plugins/EmailRegistration/emailregister.php +++ b/plugins/EmailRegistration/emailregister.php @@ -107,7 +107,11 @@ class EmailregisterAction extends Action $this->invitation = Invitation::staticGet('code', $this->code); - if (empty($this->invitation)) { + if (!empty($this->invitation)) { + if (!empty($this->invitation->registered_user_id)) { + throw new ClientException(_m('Invitation already used.'), 403); + } + } else { $this->confirmation = Confirm_address::staticGet('code', $this->code); @@ -133,6 +137,9 @@ class EmailregisterAction extends Action } else { $this->invitation = Invitation::staticGet('code', $this->code); if (!empty($this->invitation)) { + if (!empty($this->invitation->registered_user_id)) { + throw new ClientException(_m('Invitation already used.'), 403); + } $this->state = self::CONFIRMINVITE; } else { $this->state = self::CONFIRMREGISTER; @@ -283,10 +290,15 @@ class EmailregisterAction extends Action $nickname = $this->nicknameFromEmail($email); try { - $this->user = User::register(array('nickname' => $nickname, - 'email' => $email, - 'password' => $this->password1, - 'email_confirmed' => true)); + $fields = array('nickname' => $nickname, + 'email' => $email, + 'password' => $this->password1, + 'email_confirmed' => true); + + if (!empty($this->invitation)) { + $fields['code'] = $this->invitation->code; + } + $this->user = User::register($fields); } catch (ClientException $e) { $this->error = $e->getMessage(); $nickname = $this->nicknameFromEmail($email); @@ -306,18 +318,8 @@ class EmailregisterAction extends Action // Re-init language env in case it changed (not yet, but soon) common_init_language(); - if (!empty($this->invitation)) { - $inviter = User::staticGet('id', $this->invitation->user_id); - if (!empty($inviter)) { - Subscription::start($inviter->getProfile(), - $this->user->getProfile()); - } - - $this->invitation->delete(); - } else if (!empty($this->confirmation)) { + if (!empty($this->confirmation)) { $this->confirmation->delete(); - } else { - throw new Exception('No confirmation thing.'); } Event::handle('EndRegistrationTry', array($this)); From ba55d4d010fa4fae4387f1570c3566602b293be9 Mon Sep 17 00:00:00 2001 From: Samantha Doherty Date: Tue, 24 May 2011 12:56:49 -0400 Subject: [PATCH 12/26] First batch of IE fixes. --- theme/base/css/ie.css | 78 +++++++++++++++++++++-------- theme/neo/css/display.css | 7 ++- theme/neo/css/ie.css | 100 -------------------------------------- 3 files changed, 65 insertions(+), 120 deletions(-) delete mode 100644 theme/neo/css/ie.css diff --git a/theme/base/css/ie.css b/theme/base/css/ie.css index 9dfb176698..a1144b489b 100644 --- a/theme/base/css/ie.css +++ b/theme/base/css/ie.css @@ -1,13 +1,19 @@ -/* Temporary copy of base styles for overriding */ +/* IE specific styles */ input.checkbox, input.radio { top:0; } + .form_notice textarea { - width: 485px; + width: 473px; } -.form_notice .count + label { + +.threaded-replies .form_notice textarea { + width: 385px; +} + +.form_notice .form_note + label { position:absolute; top:25px; left:83%; @@ -15,25 +21,47 @@ text-indent:-9999px; height:16px; width:16px; display:block; - top: 30px; + left: 390px; + top: 27px; } -.form_notice .submit { +.form_notice #notice_action-submit { width: 106px; max-width: 106px; } -.form_notice .attach-status, -.form_notice #notice_data-geo_selected { -width:78.75%; + +.form_notice .count { + right: 52px; } -.form_notice .attach-status button, -.form_notice #notice_data-geo_selected button { -padding:0 4px; + +#form_notice-direct.form_notice .count { + right: 18px; } + +#form_notice-direct label { + float: left; +} + +#form_notice-direct select { + margin-top: 0px; + float: left; +} + +.form_notice .error, +.form_notice .success, +.form_notice .notice-status { + width: 468px; +} + +.threaded-replies .form_notice textarea { + width: 395px; +} + .notice-options input.submit { font-size:0; text-align:right; text-indent:0; } + .notice div.entry-content .timestamp a { margin-right:4px; } @@ -54,8 +82,14 @@ z-index:9999; line-height:auto; } +#site_nav_global_primary ul { + margin-right: 0px; +} -/* IE specific styles */ +#site_nav_local_views ul { + list-style-type: none; + list-style-position: outside; +} .notice-options input.submit { color:#FFFFFF; @@ -65,16 +99,22 @@ line-height:auto; filter: alpha(opacity=0); } -.form_notice .count + label { - background:transparent url(../images/icons/icons-01.gif) no-repeat 0 -328px; +/* IE7 */ + +*+html .input_forms { + margin-bottom: -20px; } -.form_notice .notice_data-geo_wrap label { - background:transparent url(../images/icons/icons-01.gif) no-repeat 0 -1780px; +/* IE6 */ + +#content { + _width: 520px; } -.form_notice .notice_data-geo_wrap label.checked { - background:transparent url(../images/icons/icons-01.gif) no-repeat 0 -1846px; +#aside_primary { + _width: 190px; } - +#content h1 { + _clear: left; +} diff --git a/theme/neo/css/display.css b/theme/neo/css/display.css index 2ab4b9158d..a0df1e9cb4 100644 --- a/theme/neo/css/display.css +++ b/theme/neo/css/display.css @@ -383,7 +383,7 @@ address { } #form_notice-direct.form_notice .count { - top: 80px; + top: 78px; right: 7px; } @@ -450,6 +450,7 @@ address { text-align: left; color: #888; cursor: text; + background: #fff; } .input_form .form_settings li input { @@ -786,6 +787,10 @@ div.entry-content a.response:after { font-size: 1em; } +.threaded-replies:empty { + display: none; +} + .user_in .threaded-replies { margin-top: 0px; } diff --git a/theme/neo/css/ie.css b/theme/neo/css/ie.css deleted file mode 100644 index 9af3955301..0000000000 --- a/theme/neo/css/ie.css +++ /dev/null @@ -1,100 +0,0 @@ -/* Temporary copy of base styles for overriding */ - -input.checkbox, -input.radio { -top:0; -} -.form_notice textarea { - width: 473px; -} -.threaded-replies .form_notice textarea { - width: 385px; -} - -.form_notice .form_note + label { -position:absolute; -top:25px; -left:83%; -text-indent:-9999px; -height:16px; -width:16px; -display:block; - left: 390px; - top: 27px; -} -.form_notice #notice_action-submit { - width: 106px; - max-width: 106px; -} -.form_notice input.notice_data-attach_selected, -.form_notice #notice_data-geo_selected { -width:78.75%; -} -.form_notice input.notice_data-attach_selected button, -.form_notice #notice_data-geo_selected button { -padding:0 4px; -} -.notice-options input.submit { -font-size:0; -text-align:right; -text-indent:0; -} -.notice div.entry-content .timestamp a { -margin-right:4px; -} -.entity_profile { -width:64%; -} -.notice { -z-index:1; -} -.notice:hover { -z-index:9999; -} -.notice .thumbnail img { -z-index:9999; -} - -.form_settings fieldset fieldset legend { -line-height:auto; -} - -/* IE specific styles */ - -#site_nav_global_primary ul { - margin-right: 0px; -} - -#site_nav_local_views ul { - list-style-type: none; - list-style-position: outside; -} - -.notice-options input.submit { - color:#FFFFFF; -} - -.form_notice input.notice_data-attach { - filter: alpha(opacity=0); -} - -.form_notice .form_note + label { - background:transparent url(../../rebase/images/icons/icons-01.gif) no-repeat 0 -328px; -} - -.form_notice #notice_data-geo_wrap label { - background:transparent url(../../rebase/images/icons/icons-01.gif) no-repeat 0 -1780px; -} -.form_notice #notice_data-geo_wrap label.checked { - background:transparent url(../../rebase/images/icons/icons-01.gif) no-repeat 0 -1846px; -} - -/* IE6 sucks */ - -#content { - _width: 520px; -} - -#aside_primary { - _width: 190px; -} From 70f01b2b3409d801e35f9067256eef885b2143ec Mon Sep 17 00:00:00 2001 From: Samantha Doherty Date: Fri, 27 May 2011 11:50:49 -0400 Subject: [PATCH 13/26] Remove privacy checkbox replacement from Mobile Profile. --- plugins/MobileProfile/MobileProfilePlugin.php | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/MobileProfile/MobileProfilePlugin.php b/plugins/MobileProfile/MobileProfilePlugin.php index 796bd3b529..196a262095 100644 --- a/plugins/MobileProfile/MobileProfilePlugin.php +++ b/plugins/MobileProfile/MobileProfilePlugin.php @@ -339,6 +339,7 @@ class MobileProfilePlugin extends WAP20Plugin $("#navtoggle").text( text == "Show Navigation" ? "Hide Navigation" : "Show Navigation"); }); + $(".checkbox-wrapper").unbind("click"); });' ); } From 1264db7f788e27f6f17edcda042b13a001972eea Mon Sep 17 00:00:00 2001 From: Samantha Doherty Date: Fri, 27 May 2011 12:07:24 -0400 Subject: [PATCH 14/26] A little more style fixing for MobileProfile. --- theme/neo/css/mp-screen.css | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/theme/neo/css/mp-screen.css b/theme/neo/css/mp-screen.css index 559e71ce00..0dabae74cd 100644 --- a/theme/neo/css/mp-screen.css +++ b/theme/neo/css/mp-screen.css @@ -120,6 +120,10 @@ address img + .fn { color: #333; font-size: 1em; margin-bottom: 0px; + background: none; + text-transform: none; + letter-spacing: 0; + padding-bottom: 0; } #site_nav_local_views li { @@ -240,6 +244,12 @@ address img + .fn { left: 270px; } +.form_notice .error, +.form_notice .success, +.form_notice .notice-status { + width: 285px; +} + /*input type=file no good in iPhone/iPod Touch, Android, Opera Mini Simulator @@ -254,6 +264,7 @@ iPhone/iPod Touch, Android, Opera Mini Simulator clear: left; float: left; width: 200px; + z-index: 2; } .form_notice .checkbox-wrapper { @@ -262,7 +273,7 @@ iPhone/iPod Touch, Android, Opera Mini Simulator } .checkbox-wrapper label.checkbox { - display: none; + display: none !important; } .checkbox-wrapper #notice_private { @@ -283,6 +294,10 @@ iPhone/iPod Touch, Android, Opera Mini Simulator width: 300px; } +.input_form .form_settings label { + display: inline; +} + .input_form .form_settings li input { width: 292px; } @@ -295,6 +310,11 @@ iPhone/iPod Touch, Android, Opera Mini Simulator display: none; } +#event-startdate, #event-starttime, #event-enddate, #event-endtime { + width: 120px; + margin-right: 12px; +} + .input_form .form_settings .submit { font-size: 1em; margin: 10px 0; @@ -305,7 +325,8 @@ iPhone/iPod Touch, Android, Opera Mini Simulator .form_notice #notice_action-submit { text-align: center; left: 0px; - top: 192px; + top: 100%; + margin-top: -45px; width: 80px; font-size: 1em; } @@ -406,8 +427,8 @@ margin-left:0 !important; content: '\003E'; } -.notice .addressees:empty:before { - content: none; +.notice .addressees:empty { + display: none; } .user_in .notice div.entry-content { @@ -426,6 +447,10 @@ ul.qna-dummy { width: 220px; } +.threaded-replies #answer-form fieldset { + width: 220px; +} + .threaded-replies #qna-answer-submit { float: left; clear: left; From 97debbab68ea6bc42ebd0d00e51500019bbcd1c0 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 30 May 2011 09:57:11 -0400 Subject: [PATCH 15/26] use integer iterator for childNodes in ActivityUtils::getLinks() --- lib/activityutils.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/activityutils.php b/lib/activityutils.php index 3aa09deb4e..59f7cdcf3a 100644 --- a/lib/activityutils.php +++ b/lib/activityutils.php @@ -104,8 +104,9 @@ class ActivityUtils { $els = $element->childNodes; $out = array(); - - foreach ($els as $link) { + + for ($i = 0; $i < $els->length; $i++) { + $link = $els->item($i); if ($link->localName == self::LINK && $link->namespaceURI == self::ATOM) { $linkRel = $link->getAttribute(self::REL); $linkType = $link->getAttribute(self::TYPE); From 9167ba8d2d889ad3e8b51e02e93102b2b2dde7dc Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 30 May 2011 09:57:49 -0400 Subject: [PATCH 16/26] ActivityImporter catches thrown exceptions by plugins and marks entry done --- lib/activityimporter.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/activityimporter.php b/lib/activityimporter.php index b1f30fa4bf..b5c83516ec 100644 --- a/lib/activityimporter.php +++ b/lib/activityimporter.php @@ -63,9 +63,9 @@ class ActivityImporter extends QueueHandler $done = null; - if (Event::handle('StartImportActivity', - array($user, $author, $activity, $trusted, &$done))) { - try { + try { + if (Event::handle('StartImportActivity', + array($user, $author, $activity, $trusted, &$done))) { switch ($activity->verb) { case ActivityVerb::FOLLOW: $this->subscribeProfile($user, $author, $activity); @@ -83,10 +83,10 @@ class ActivityImporter extends QueueHandler Event::handle('EndImportActivity', array($user, $author, $activity, $trusted)); $done = true; - } catch (Exception $e) { - common_log(LOG_ERR, $e->getMessage()); - $done = true; } + } catch (Exception $e) { + common_log(LOG_ERR, $e->getMessage()); + $done = true; } return $done; } From cb4f27100267ed6dd6d7619a8a583196932d3e5d Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 30 May 2011 10:04:25 -0400 Subject: [PATCH 17/26] test to check that Bookmark related links are appearing correctly --- tests/ActivityParseTests.php | 109 +++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/tests/ActivityParseTests.php b/tests/ActivityParseTests.php index c2817a4602..6423eaaf03 100644 --- a/tests/ActivityParseTests.php +++ b/tests/ActivityParseTests.php @@ -405,6 +405,28 @@ class ActivityParseTests extends PHPUnit_Framework_TestCase $act = new Activity($entry, $feed); $this->assertEquals($act->actor->id, $expected); } + + public function testBookmarkRelated() + { + global $_example11; + $dom = new DOMDocument(); + $dom->loadXML($_example11); + + $feed = $dom->documentElement; + $entry = $dom->getElementsByTagName('entry')->item(0); + + $expected = 'http://blog.teambox.com/open-source-companies'; + + $links = ActivityUtils::getLinks($entry, 'related'); + + $this->assertFalse(empty($links)); + $this->assertTrue(is_array($links)); + $this->assertEquals(count($links), 1); + + $url = $links[0]->getAttribute('href'); + + $this->assertEquals($url, $expected); + } } $_example1 = << EXAMPLE10; + +$_example11 = << + + StatusNet + http://freelish.us/api/statuses/user_timeline/1.atom + demon timeline + Updates from demon on freelish.us! + http://avatar.status.net/f/freelishus/1-96-20110331163048.jpeg + 2011-05-30T09:36:03-04:00 + + http://activitystrea.ms/schema/1.0/person + http://freelishus.status.net/user/1 + demon + + + + + + 45.50884 -73.58781 + demon + Evan Prodromou + Montreal hacker and entrepreneur. + + Montreal, Quebec + + + + homepage + http://evan.status.net/ + true + + + + + + http://activitystrea.ms/schema/1.0/person + http://freelishus.status.net/user/1 + Evan Prodromou + + + + + + 45.50884 -73.58781 + demon + Evan Prodromou + Montreal hacker and entrepreneur. + + Montreal, Quebec + + + + homepage + http://evan.status.net/ + true + + + + + + + + + + + + + + http://activitystrea.ms/schema/1.0/bookmark + http://freelish.us/bookmark/9e930c3e-7ed9-47de-aba5-df6c60cec542 + Why you should build an open-source startup | Teambox Blog + + + http://activitystrea.ms/schema/1.0/post + 2011-05-26T20:36:25+00:00 + 2011-05-26T20:36:25+00:00 + + + + + + + + + +EXAMPLE11; From 5a9d969f222a4982ee2f5c8089617b49a88916a1 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 30 May 2011 11:22:36 -0400 Subject: [PATCH 18/26] use ReplyNoticeStream for replies page --- actions/replies.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/actions/replies.php b/actions/replies.php index 7ae2d0eb76..385ca4c6cc 100644 --- a/actions/replies.php +++ b/actions/replies.php @@ -85,8 +85,11 @@ class RepliesAction extends OwnerDesignAction common_set_returnto($this->selfUrl()); - $this->notice = $this->user->getReplies(($this->page-1) * NOTICES_PER_PAGE, - NOTICES_PER_PAGE + 1); + $stream = new ReplyNoticeStream($this->user->id, + Profile::current()); + + $this->notice = $stream->getNotices(($this->page-1) * NOTICES_PER_PAGE, + NOTICES_PER_PAGE + 1); if($this->page > 1 && $this->notice->N == 0){ // TRANS: Server error when page not found (404) From d44000077de839b86338f203639c5bd0baab5b3e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 30 May 2011 11:22:52 -0400 Subject: [PATCH 19/26] use ReplyNoticeStream for mentions API --- actions/apitimelinementions.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/actions/apitimelinementions.php b/actions/apitimelinementions.php index ecd2a1a0e6..6afb11f860 100644 --- a/actions/apitimelinementions.php +++ b/actions/apitimelinementions.php @@ -193,10 +193,13 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction { $notices = array(); - $notice = $this->user->getReplies( - ($this->page - 1) * $this->count, $this->count, - $this->since_id, $this->max_id - ); + $stream = new ReplyNoticeStream($this->user->id, + Profile::current()); + + $notice = $stream->getNotices(($this->page - 1) * $this->count, + $this->count, + $this->since_id, + $this->max_id); while ($notice->fetch()) { $notices[] = clone($notice); From 650af0a27102e5e9067850c88e5b8a446b44f045 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 30 May 2011 15:09:42 -0400 Subject: [PATCH 20/26] get the correct context for apitimelinementions --- actions/apitimelinementions.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/actions/apitimelinementions.php b/actions/apitimelinementions.php index 6afb11f860..25e08dd0e3 100644 --- a/actions/apitimelinementions.php +++ b/actions/apitimelinementions.php @@ -193,8 +193,13 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction { $notices = array(); - $stream = new ReplyNoticeStream($this->user->id, - Profile::current()); + if (empty($this->auth_user)) { + $profile = null; + } else { + $profile = $this->auth_user->profile; + } + + $stream = new ReplyNoticeStream($this->user->id, $profile); $notice = $stream->getNotices(($this->page - 1) * $this->count, $this->count, From d544c78276e6b822e94e7714a98f73b941189185 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 30 May 2011 15:29:18 -0400 Subject: [PATCH 21/26] correctly get profile for scope in apitimelinementions --- actions/apitimelinementions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/apitimelinementions.php b/actions/apitimelinementions.php index 25e08dd0e3..2b5053a84f 100644 --- a/actions/apitimelinementions.php +++ b/actions/apitimelinementions.php @@ -196,7 +196,7 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction if (empty($this->auth_user)) { $profile = null; } else { - $profile = $this->auth_user->profile; + $profile = $this->auth_user->getProfile(); } $stream = new ReplyNoticeStream($this->user->id, $profile); From ac55efeecfb4c95ddd808c70edc6f1ec62218930 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 30 May 2011 16:20:34 -0400 Subject: [PATCH 22/26] Don't show empty addressees in noticelistitem --- lib/noticelistitem.php | 64 ++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/lib/noticelistitem.php b/lib/noticelistitem.php index 2d41e53017..b56cd28092 100644 --- a/lib/noticelistitem.php +++ b/lib/noticelistitem.php @@ -229,31 +229,44 @@ class NoticeListItem extends Widget function showAddressees() { - $this->out->elementStart('span', 'addressees'); + $ga = $this->getGroupAddressees(); + $pa = $this->getProfileAddressees(); - $cnt = $this->showGroupAddressees(true); - $cnt = $this->showProfileAddressees($cnt == 0); + $a = array_merge($ga, $pa); - $this->out->elementEnd('span', 'addressees'); + if (!empty($a)) { + $this->out->elementStart('span', 'addressees'); + $first = true; + foreach ($a as $addr) { + if (!$first) { + // TRANS: Separator in profile addressees list. + $this->out->text(_m('SEPARATOR',', ')); + } else { + // TRANS: Start of profile addressees list. + $first = false; + } + $text = $addr['text']; + unset($addr['text']); + $this->out->element('a', $addr, $text); + } + $this->out->elementEnd('span', 'addressees'); + } } - function showGroupAddressees($first) + function getGroupAddressees() { + $ga = array(); + $groups = $this->getGroups(); foreach ($groups as $group) { - if (!$first) { - $this->out->text( _m('SEPARATOR',', ')); - } else { - $first = false; - } - $this->out->element('a', array('href' => $group->homeUrl(), - 'title' => $group->nickname, - 'class' => 'addressee group'), - $group->getBestName()); + $ga[] = array('href' => $group->homeUrl(), + 'title' => $group->nickname, + 'class' => 'addressee group', + 'text' => $group->getBestName()); } - return count($groups); + return $ga; } function getGroups() @@ -261,25 +274,20 @@ class NoticeListItem extends Widget return $this->notice->getGroups(); } - function showProfileAddressees($first) + function getProfileAddressees() { + $pa = array(); + $replies = $this->getReplyProfiles(); foreach ($replies as $reply) { - if (!$first) { - // TRANS: Separator in profile addressees list. - $this->out->text(_m('SEPARATOR',', ')); - } else { - // TRANS: Start of profile addressees list. - $first = false; - } - $this->out->element('a', array('href' => $reply->profileurl, - 'title' => $reply->nickname, - 'class' => 'addressee account'), - $reply->getBestName()); + $pa[] = array('href' => $reply->profileurl, + 'title' => $reply->nickname, + 'class' => 'addressee account', + 'text' => $reply->getBestName()); } - return count($replies); + return $pa; } function getReplyProfiles() From a0266089538e9f07528210a7d1ab39028e8558c3 Mon Sep 17 00:00:00 2001 From: Samantha Doherty Date: Tue, 31 May 2011 12:14:26 -0400 Subject: [PATCH 23/26] Only use mobile doctype on actual mobile devices. --- plugins/MobileProfile/MobileProfilePlugin.php | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/plugins/MobileProfile/MobileProfilePlugin.php b/plugins/MobileProfile/MobileProfilePlugin.php index 196a262095..e149573e88 100644 --- a/plugins/MobileProfile/MobileProfilePlugin.php +++ b/plugins/MobileProfile/MobileProfilePlugin.php @@ -49,6 +49,7 @@ class MobileProfilePlugin extends WAP20Plugin { public $DTD = null; public $serveMobile = false; + public $reallyMobile = false; public $mobileFeatures = array(); function __construct($DTD='http://www.wapforum.org/DTD/xhtml-mobile10.dtd') @@ -160,6 +161,7 @@ class MobileProfilePlugin extends WAP20Plugin $this->setMobileFeatures($httpuseragent); $this->serveMobile = true; + $this->reallyMobile = true; break; } } @@ -201,21 +203,28 @@ class MobileProfilePlugin extends WAP20Plugin header('Content-Type: '.$type); - $action->extraHeaders(); - if (preg_match("/.*\/.*xml/", $type)) { - // Required for XML documents - $action->xw->startDocument('1.0', 'UTF-8'); - } - $action->xw->writeDTD('html', - '-//WAPFORUM//DTD XHTML Mobile 1.0//EN', - $this->DTD); + if ($this->reallyMobile) { - $language = $action->getLanguage(); + $action->extraHeaders(); + if (preg_match("/.*\/.*xml/", $type)) { + // Required for XML documents + $action->xw->startDocument('1.0', 'UTF-8'); + } + $action->xw->writeDTD('html', + '-//WAPFORUM//DTD XHTML Mobile 1.0//EN', + $this->DTD); - $action->elementStart('html', array('xmlns' => 'http://www.w3.org/1999/xhtml', + $language = $action->getLanguage(); + + $action->elementStart('html', array('xmlns' => 'http://www.w3.org/1999/xhtml', 'xml:lang' => $language)); - return false; + return false; + + } else { + return true; + } + } function setMobileFeatures($useragent) From dddb6185f3bd29a7da20c0338e0df85409e3698b Mon Sep 17 00:00:00 2001 From: Samantha Doherty Date: Tue, 31 May 2011 12:42:28 -0400 Subject: [PATCH 24/26] Last bit of style cleanup for addressees and mobile profile. --- theme/base/css/display.css | 4 ---- theme/base/css/ie.css | 9 +++++++++ theme/base/images/icons/arrow_right.png | Bin 0 -> 182 bytes theme/neo/css/mp-screen.css | 4 ---- 4 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 theme/base/images/icons/arrow_right.png diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 6ae14d2c7d..40656b7cf9 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -418,10 +418,6 @@ address .poweredby { content: '\25B8'; } -.notice .addressees:empty:before { - content: none; -} - .fn { overflow: hidden; } diff --git a/theme/base/css/ie.css b/theme/base/css/ie.css index a1144b489b..337d96e7df 100644 --- a/theme/base/css/ie.css +++ b/theme/base/css/ie.css @@ -99,12 +99,21 @@ line-height:auto; filter: alpha(opacity=0); } +.notice .addressees:before { + content: '\003E'; +} + /* IE7 */ *+html .input_forms { margin-bottom: -20px; } +.notice .addressees { + background: url(../images/icons/arrow_right.png) no-repeat top left; + padding-left: 16px; +} + /* IE6 */ #content { diff --git a/theme/base/images/icons/arrow_right.png b/theme/base/images/icons/arrow_right.png new file mode 100644 index 0000000000000000000000000000000000000000..cefa7c2c7aa272f2399c4fd7c1adaa243d7cd520 GIT binary patch literal 182 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|3OrpLLo80e zy=2JM93as0&_9>&{w>XHo>9u&|%bE8j9=VHT`g0GkCiCxvX Date: Tue, 31 May 2011 12:48:59 -0400 Subject: [PATCH 25/26] Oops; tiny mistake in IE7 addressee stylin. --- theme/base/css/ie.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theme/base/css/ie.css b/theme/base/css/ie.css index 337d96e7df..c6ddbac654 100644 --- a/theme/base/css/ie.css +++ b/theme/base/css/ie.css @@ -109,7 +109,7 @@ line-height:auto; margin-bottom: -20px; } -.notice .addressees { +*+html .notice .addressees { background: url(../images/icons/arrow_right.png) no-repeat top left; padding-left: 16px; } From 712ba64fa6a4e862a0ceaf945482f568db7271ab Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 31 May 2011 11:46:50 -0700 Subject: [PATCH 26/26] Apply upstream fix to MSN library for darkip Upstream fix http://code.google.com/p/phpmsnclass/source/diff?spec=svn52&old=47&r=52&format=unidiff&path=%2Ftrunk%2Fphpmsnclassv2%2Fmsn.class.php --- plugins/Msn/extlib/phpmsnclass/msn.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Msn/extlib/phpmsnclass/msn.class.php b/plugins/Msn/extlib/phpmsnclass/msn.class.php index 3d10c25b2c..5675eb5c2f 100644 --- a/plugins/Msn/extlib/phpmsnclass/msn.class.php +++ b/plugins/Msn/extlib/phpmsnclass/msn.class.php @@ -2973,7 +2973,7 @@ X-OIM-Sequence-Num: 1 // t=tick&p= // binary secret // RST2: messenger.msn.com - // t=tick + // t=tick // RST3: contacts.msn.com // t=tick&p= // RST4: messengersecure.live.com @@ -2985,7 +2985,7 @@ X-OIM-Sequence-Num: 1 preg_match("#". "(.*)(.*)". "(.*)(.*)". - "(.*)(.*)". + "(.*)(.*)". "(.*)(.*)". "(.*)(.*)". "(.*)(.*)".