PHP Class TwitterPlugin, vanilla

Inheritance: extends Gdn_Plugin
Show file Open project: vanilla/vanilla Class Usage Examples

Public Properties

Property Type Description
$BaseApiUrl Twitter's URL.

Protected Properties

Property Type Description
$_AccessToken string
$_RedirectUri string

Public Methods

Method Description
accessToken ( string $Token = null, string $Secret = null ) : OAuthToken Gets/sets the current oauth access token.
api ( $Url, null $Params = null, string $Method = 'GET' ) : mixed | string
authorize ( boolean $Query = false )
base_AfterReactions_handler ( $Sender, $Args ) Add 'Twitter' option to the row.
base_BeforeSignInButton_handler ( $Sender, $Args )
base_beforeSignInLink_handler ( $Sender )
base_connectData_handler ( Gdn_Controller $Sender, array $Args )
base_discussionFormOptions_handler ( $Sender, $Args )
base_getConnections_handler ( $Sender, $Args )
base_signInIcons_handler ( $Sender, $Args )
commentModel_afterSaveComment_handler ( $Sender, $Args )
deleteOAuthToken ( $Token )
discussionController_afterBodyField_handler ( $Sender, $Args )
discussionModel_afterSaveDiscussion_handler ( $Sender, $Args )
entryController_signIn_handler ( Gdn_Controller $Sender, $Args )
entryController_twauthorize_create ( $Sender, string $Dir = '' )
getAccessToken ( $RequestToken, $Verifier ) : OAuthToken
getOAuthToken ( $Token ) : null | OAuthToken
getProfile ( ) : mixed | string
isConfigured ( ) : boolean
postController_twitter_create ( PostController $Sender, type $RecordType, type $ID )
profileConnecUrl ( ) : string
profileController_twitterConnect_create ( ProfileController $Sender, type $UserReference = '', type $Username = '', type $oauth_token = '', type $oauth_verifier = '' )
redirectUri ( null $NewValue = null ) : null | string
setOAuthToken ( $Token, null $Secret = null, string $Type = 'request' )
setup ( )
socialController_twitter_create ( $Sender, $Args )
socialReactions ( ) : boolean
socialSharing ( ) : boolean
socialSignIn ( ) : boolean
structure ( ) Perform any necessary database or configuration updates.

Protected Methods

Method Description
_authorizeHref ( boolean $Popup = false ) : string
_curl ( OAuthRequest $Request, $Post = null )
addReactButton ( $Sender, $Args ) Output Quote link.

Private Methods

Method Description
_getButton ( ) : string

Method Details

_authorizeHref() protected method

protected _authorizeHref ( boolean $Popup = false ) : string
$Popup boolean
return string

_curl() protected method

protected _curl ( OAuthRequest $Request, $Post = null )
$Request OAuthRequest

accessToken() public method

Gets/sets the current oauth access token.
public accessToken ( string $Token = null, string $Secret = null ) : OAuthToken
$Token string
$Secret string
return OAuthToken

addReactButton() protected method

Output Quote link.
protected addReactButton ( $Sender, $Args )

api() public method

public api ( $Url, null $Params = null, string $Method = 'GET' ) : mixed | string
$Url
$Params null
$Method string
return mixed | string

authorize() public method

public authorize ( boolean $Query = false )
$Query boolean

base_AfterReactions_handler() public method

Add 'Twitter' option to the row.
public base_AfterReactions_handler ( $Sender, $Args )

base_BeforeSignInButton_handler() public method

public base_BeforeSignInButton_handler ( $Sender, $Args )
$Sender
$Args

base_connectData_handler() public method

public base_connectData_handler ( Gdn_Controller $Sender, array $Args )
$Sender Gdn_Controller
$Args array

base_discussionFormOptions_handler() public method

public base_discussionFormOptions_handler ( $Sender, $Args )
$Sender
$Args

base_getConnections_handler() public method

public base_getConnections_handler ( $Sender, $Args )
$Sender
$Args

base_signInIcons_handler() public method

public base_signInIcons_handler ( $Sender, $Args )
$Sender
$Args

commentModel_afterSaveComment_handler() public method

public commentModel_afterSaveComment_handler ( $Sender, $Args )
$Sender
$Args

deleteOAuthToken() public method

public deleteOAuthToken ( $Token )
$Token

discussionController_afterBodyField_handler() public method

public discussionController_afterBodyField_handler ( $Sender, $Args )
$Sender
$Args

discussionModel_afterSaveDiscussion_handler() public method

public discussionModel_afterSaveDiscussion_handler ( $Sender, $Args )
$Sender
$Args

entryController_signIn_handler() public method

public entryController_signIn_handler ( Gdn_Controller $Sender, $Args )
$Sender Gdn_Controller

entryController_twauthorize_create() public method

public entryController_twauthorize_create ( $Sender, string $Dir = '' )
$Sender
$Dir string

getAccessToken() public method

public getAccessToken ( $RequestToken, $Verifier ) : OAuthToken
$RequestToken
$Verifier
return OAuthToken

getOAuthToken() public method

public getOAuthToken ( $Token ) : null | OAuthToken
$Token
return null | OAuthToken

getProfile() public method

public getProfile ( ) : mixed | string
return mixed | string

isConfigured() public method

public isConfigured ( ) : boolean
return boolean

postController_twitter_create() public method

public postController_twitter_create ( PostController $Sender, type $RecordType, type $ID )
$Sender PostController
$RecordType type
$ID type

profileConnecUrl() public static method

public static profileConnecUrl ( ) : string
return string

profileController_twitterConnect_create() public method

public profileController_twitterConnect_create ( ProfileController $Sender, type $UserReference = '', type $Username = '', type $oauth_token = '', type $oauth_verifier = '' )
$Sender ProfileController
$UserReference type
$Username type
$oauth_token type
$oauth_verifier type

redirectUri() public method

public redirectUri ( null $NewValue = null ) : null | string
$NewValue null
return null | string

setOAuthToken() public method

public setOAuthToken ( $Token, null $Secret = null, string $Type = 'request' )
$Token
$Secret null
$Type string

setup() public method

public setup ( )

socialController_twitter_create() public method

public socialController_twitter_create ( $Sender, $Args )
$Sender
$Args

socialReactions() public method

public socialReactions ( ) : boolean
return boolean

socialSharing() public method

public socialSharing ( ) : boolean
return boolean

socialSignIn() public method

public socialSignIn ( ) : boolean
return boolean

structure() public method

Perform any necessary database or configuration updates.
public structure ( )

Property Details

$BaseApiUrl public static property

Twitter's URL.
public static $BaseApiUrl

$_AccessToken protected property

protected string $_AccessToken
return string

$_RedirectUri protected property

protected string $_RedirectUri
return string