protected function _getButtonUrl() { if (is_null($this->userInfo) || !$this->userInfo->hasData()) { return $this->client->createAuthUrl(); } else { return $this->getUrl('socialconnect/twitter/disconnect'); } }
protected function _construct() { parent::_construct(); $this->client = Mage::getSingleton('inchoo_socialconnect/twitter_oauth_client'); if (!$this->client->isEnabled()) { return; } $this->userInfo = Mage::registry('inchoo_socialconnect_twitter_userinfo'); $this->setTemplate('inchoo/socialconnect/twitter/account.phtml'); }
protected function _load() { try { $this->client->getAccessToken(); $response = $this->client->api('/account/verify_credentials.json', 'GET', $this->params); foreach ($response as $key => $value) { $this->{$key} = $value; } } catch (Inchoo_SocialConnect_Twitter_Oauth_Exception $e) { $this->_onException($e); } catch (Exception $e) { $this->_onException($e); } }