예제 #1
0
 /**
  * @return null|string
  */
 protected function _toHtml()
 {
     if ($this->config->isEnabled()) {
         return parent::_toHtml();
     }
     return null;
 }
예제 #2
0
 public function dispatch(RequestInterface $request)
 {
     if (!$this->session->isLoggedIn()) {
         return $this->_redirect('customer/account/login');
     }
     if (!$this->config->isEnabled()) {
         return $this->_redirect($this->_redirect->getRefererUrl());
     }
     return parent::dispatch($request);
 }
예제 #3
0
 /**
  * @param RequestInterface $request
  *
  * @return ResponseInterface
  */
 public function dispatch(RequestInterface $request)
 {
     if (!$this->config->isEnabled()) {
         $this->_redirect($this->_redirect->getRefererUrl());
     }
     return parent::dispatch($request);
 }
예제 #4
0
 /**
  * @return bool
  */
 public function isEnabled()
 {
     return $this->config->isEnabled();
 }
예제 #5
0
 /**
  * Facebook constructor
  *
  * @param Config $config
  *
  * @throws \Facebook\Exceptions\FacebookSDKException
  */
 public function __construct(Config $config)
 {
     if ($config->isEnabled()) {
         parent::__construct(['app_id' => $config->getApiKey(), 'app_secret' => $config->getApiSecret(), 'default_graph_version' => $config->getVersion()]);
     }
 }