Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

Commit 158acd4

Browse files
committed
Merge pull request #258 from ebuildy/patch-1
Add displayAsPopup parameter for getLoginUrl
2 parents f807076 + d101f46 commit 158acd4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Facebook/FacebookRedirectLoginHelper.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,11 @@ public function __construct($redirectUrl, $appId = null, $appSecret = null)
8484
*
8585
* @param array $scope List of permissions to request during login
8686
* @param string $version Optional Graph API version if not default (v2.0)
87+
* @param boolean $displayAsPopup Indicate if the page will be displayed as a popup
8788
*
8889
* @return string
8990
*/
90-
public function getLoginUrl($scope = array(), $version = null)
91+
public function getLoginUrl($scope = array(), $version = null, $displayAsPopup = false)
9192
{
9293
$version = ($version ?: FacebookRequest::GRAPH_API_VERSION);
9394
$this->state = $this->random(16);
@@ -99,6 +100,12 @@ public function getLoginUrl($scope = array(), $version = null)
99100
'sdk' => 'php-sdk-' . FacebookRequest::VERSION,
100101
'scope' => implode(',', $scope)
101102
);
103+
104+
if ($displayAsPopup)
105+
{
106+
$params['display'] = 'popup';
107+
}
108+
102109
return 'https://www.facebook.com/' . $version . '/dialog/oauth?' .
103110
http_build_query($params, null, '&');
104111
}

0 commit comments

Comments
 (0)