diff options
Diffstat (limited to 'actions')
-rw-r--r-- | actions/facebookinvite.php | 60 |
1 files changed, 52 insertions, 8 deletions
diff --git a/actions/facebookinvite.php b/actions/facebookinvite.php index 7addc4b31..14c09db3d 100644 --- a/actions/facebookinvite.php +++ b/actions/facebookinvite.php @@ -28,38 +28,82 @@ class FacebookinviteAction extends FacebookAction { parent::handle($args); - $this->display(); + if ($this->arg('ids')) { + $this->showThankYou(); + } else { + $this->showInviteForm(); + } } - function display() - { + function showThankYou() + { $facebook = get_facebook(); - $fbuid = $facebook->require_login(); $this->show_header('Invite'); + common_element('h2', null, _('Thanks for inviting your friends to use Identi.ca!')); + common_element('p', null, _('Invitations have been sent to the following users:')); + + $friend_ids = $_POST['ids']; // Hmm... $arg->('ids) doesn't seem to work + + common_element_start("ul"); + + foreach ($friend_ids as $friend) { + common_element_start('li'); + common_element('fb:profile-pic', array('uid' => $friend)); + common_element('fb:name', array('uid' => $friend, + 'capitalize' => 'true')); + common_element_end('li'); + } + + common_element_end("ul"); + + $this->show_footer(); + } + + function showInviteForm() + { + + $facebook = get_facebook(); + $fbuid = $facebook->require_login(); + + $this->show_header('Invite'); // Get a list of users who are already using the app for exclusion $exclude_ids = $facebook->api_client->friends_getAppUsers(); - $content = 'You have been invited to Identi.ca! ' . + $content = _('You have been invited to Identi.ca!') . htmlentities('<fb:req-choice url="http://apps.facebook.com/identica_app/" label="Add"/>'); common_element_start('fb:request-form', array('action' => 'invite.php', - 'method' => 'POST', + 'method' => 'post', 'invite' => 'true', 'type' => 'Identi.ca', 'content' => $content)); - + common_hidden('invite', 'true'); $actiontext = 'Invite your friends to use Identi.ca.'; common_element('fb:multi-friend-selector', array('showborder' => 'false', 'actiontext' => $actiontext, - 'exclude_ids' => implode(',', $exclude_ids))); + 'exclude_ids' => implode(',', $exclude_ids), + 'bypass' => 'cancel')); common_element_end('fb:request-form'); + common_element('h2', null, _('Friends already using Identi.ca:')); + common_element_start("ul"); + + foreach ($exclude_ids as $friend) { + common_element_start('li'); + common_element('fb:profile-pic', array('uid' => $friend)); + common_element('fb:name', array('uid' => $friend, + 'capitalize' => 'true')); + common_element_end('li'); + } + + common_element_end("ul"); + $this->show_footer(); } |