forked from GNUsocial/gnu-social
Ticket #1196 - Fixed: Warning on invite tab in Facebook App
This commit is contained in:
parent
18b1304562
commit
5f2cf2553c
@ -17,7 +17,9 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('LACONICA')) { exit(1); }
|
if (!defined('LACONICA')) {
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
require_once(INSTALLDIR.'/lib/facebookaction.php');
|
require_once(INSTALLDIR.'/lib/facebookaction.php');
|
||||||
|
|
||||||
@ -89,16 +91,6 @@ class FacebookinviteAction extends FacebookAction
|
|||||||
|
|
||||||
function showFormContent()
|
function showFormContent()
|
||||||
{
|
{
|
||||||
|
|
||||||
// Get a list of users who are already using the app for exclusion
|
|
||||||
$exclude_ids = $this->facebook->api_client->friends_getAppUsers();
|
|
||||||
$exclude_ids_csv = null;
|
|
||||||
|
|
||||||
// fbml needs these as a csv string, not an array
|
|
||||||
if ($exclude_ids) {
|
|
||||||
$exclude_ids_csv = implode(',', $exclude_ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
$content = sprintf(_('You have been invited to %s'), common_config('site', 'name')) .
|
$content = sprintf(_('You have been invited to %s'), common_config('site', 'name')) .
|
||||||
htmlentities('<fb:req-choice url="' . $this->app_uri . '" label="Add"/>');
|
htmlentities('<fb:req-choice url="' . $this->app_uri . '" label="Add"/>');
|
||||||
|
|
||||||
@ -112,17 +104,23 @@ class FacebookinviteAction extends FacebookAction
|
|||||||
|
|
||||||
$multi_params = array('showborder' => 'false');
|
$multi_params = array('showborder' => 'false');
|
||||||
$multi_params['actiontext'] = $actiontext;
|
$multi_params['actiontext'] = $actiontext;
|
||||||
|
$multi_params['bypass'] = 'cancel';
|
||||||
|
|
||||||
if ($exclude_ids_csv) {
|
// Get a list of users who are already using the app for exclusion
|
||||||
|
$exclude_ids = $this->facebook->api_client->friends_getAppUsers();
|
||||||
|
$exclude_ids_csv = null;
|
||||||
|
|
||||||
|
// fbml needs these as a csv string, not an array
|
||||||
|
if ($exclude_ids) {
|
||||||
|
$exclude_ids_csv = implode(',', $exclude_ids);
|
||||||
$multi_params['exclude_ids'] = $exclude_ids_csv;
|
$multi_params['exclude_ids'] = $exclude_ids_csv;
|
||||||
}
|
}
|
||||||
|
|
||||||
$multi_params['bypass'] = 'cancel';
|
|
||||||
|
|
||||||
$this->element('fb:multi-friend-selector', $multi_params);
|
$this->element('fb:multi-friend-selector', $multi_params);
|
||||||
|
|
||||||
$this->elementEnd('fb:request-form');
|
$this->elementEnd('fb:request-form');
|
||||||
|
|
||||||
|
if ($exclude_ids) {
|
||||||
|
|
||||||
$this->element('h2', null, sprintf(_('Friends already using %s:'),
|
$this->element('h2', null, sprintf(_('Friends already using %s:'),
|
||||||
common_config('site', 'name')));
|
common_config('site', 'name')));
|
||||||
$this->elementStart('ul', array('id' => 'facebook-friends'));
|
$this->elementStart('ul', array('id' => 'facebook-friends'));
|
||||||
@ -137,6 +135,7 @@ class FacebookinviteAction extends FacebookAction
|
|||||||
|
|
||||||
$this->elementEnd("ul");
|
$this->elementEnd("ul");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function title()
|
function title()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user