/**
  *
  * @return string
  */
 public function run()
 {
     $this->_run();
     $routeMatch = self::$_fc->route();
     $this->_viewRenderer = $this->_getViewRenderer($routeMatch->getResponseType());
     return array($this->_controllerResponse, $this->_viewRenderer, $this->_containerParams);
 }
Example #2
0
 public static function front_controller_post_view(XenForo_FrontController $fc, &$output)
 {
     // FailSafe
     if (!$fc) {
         return false;
     }
     $dependencies = $fc->getDependencies();
     // Disable on Admin dependencies
     if ($dependencies instanceof XenForo_Dependencies_Admin) {
         return false;
     }
     // XenForo Route
     $route = $fc->route();
     // Disable on attachment controller
     if ($route->getControllerName() === "XenForo_ControllerPublic_Attachment") {
         return false;
     }
     if ($route->getResponseType() === "html") {
         $keyPos = strpos($output, '<!--EHSS_Widget_Exists-->');
         if ($keyPos !== false) {
             $req = new Zend_Controller_Request_Http();
             $res = new Zend_Controller_Response_Http();
             $viewRenderer = $dependencies->getViewRenderer($res, 'html', $req);
             $template = $viewRenderer->renderView('', array(), 'eh_socialshare_js');
             $output = str_replace('<!--EHSS_Widget_Exists-->', '', $output);
             $output = str_replace('<script type="text/javascript" data-ehss="true"></script>', $template, $output);
         } else {
             $output = str_replace('<script type="text/javascript" data-ehss="true"></script>', '', $output);
         }
         return true;
     } else {
         return false;
     }
 }
Example #3
0
 public static function front_controller_post_view(XenForo_FrontController $fc, &$output)
 {
     $responseType = $fc->route()->getResponseType();
     $controllerName = $fc->route()->getControllerName();
     $dependencies = $fc->getDependencies();
     // Disable on Admin features
     if ($dependencies instanceof XenForo_Dependencies_Admin) {
         return;
     }
     // Disable on attachments
     if ($controllerName === "XenForo_ControllerPublic_Attachment") {
         return;
     }
     if ($responseType === "html") {
         $ehss_keyPos = strpos($output, '<!--EHSS_Widget_Exist-->');
         if ($ehss_keyPos !== false) {
             // Is this the only way to fetch template..?
             $request = new Zend_Controller_Request_Http();
             $response = new Zend_Controller_Response_Http();
             $viewRenderer = $dependencies->getViewRenderer($response, 'html', $request);
             $template = $viewRenderer->renderView('', array(), 'eh_socialshare_js');
             $output = str_replace('<!--EHSS_Widget_Exist-->', '', $output);
             $output = str_replace('<!--EHSS_Require_JS-->', $template, $output);
         } else {
             $output = str_replace('<!--EHSS_Require_JS-->', '', $output);
         }
     }
 }