/**
  * Modifies the client view for the Forum.
  *
  * @param ConfigureClientView $event
  */
 public function addForumAssets(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         $event->addAssets([__DIR__ . '/../../less/forum/upload.less', __DIR__ . '/../../js/forum/dist/extension.js']);
         $event->addBootstrapper('flagrow/image-upload/main');
     }
 }
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         $event->addAssets([__DIR__ . '/../../js/forum/dist/extension.js']);
         $event->addBootstrapper('sijad/spoiler/alert/main');
     }
 }
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         $js = file_get_contents(realpath(__DIR__ . '/../../assets/js/depend.js'));
         $event->view->addHeadString($js);
     }
 }
Esempio n. 4
0
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         $event->addAssets(__DIR__ . '/../../js/forum/dist/extension.js');
         $event->addBootstrapper('beeta-dev/ext-ads/main');
     }
 }
 /**
  * Modifies the client view for the Forum.
  *
  * @param ConfigureClientView $event;
  */
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         $event->addAssets([__DIR__ . '/../../js/forum/dist/extension.js']);
         $event->addBootstrapper('datitisev/moderator-notes/main');
     }
 }
 /**
  * @param ConfigureClientView $event
  */
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         $event->addAssets([__DIR__ . '/../../js/forum/dist/extension.js', __DIR__ . '/../../less/forum/extension.less']);
         $event->addBootstrapper('flarum/subscriptions/main');
     }
 }
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         $rawJs = file_get_contents(realpath(__DIR__ . '/../../assets/js/facebook-jssdk.js'));
         $js = str_replace("%%APP_ID%%", $this->settings->get('vingle.like.share.facebook'), $rawJs);
         $event->view->addFootString($js);
     }
 }
Esempio n. 8
0
 public function rtlClientView(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         $event->addAssets([__DIR__ . '/../../less/forum/extension.less']);
     } else {
         if ($event->isAdmin()) {
             $event->addAssets([__DIR__ . '/../../less/admin/extension.less']);
         }
     }
 }
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isAdmin()) {
         $event->addAssets([__DIR__ . '/../../less/admin/analyticsPage.less', __DIR__ . '/../../js/admin/dist/extension.js']);
         $event->addBootstrapper('flagrow/analytics/main');
     } elseif ($event->isForum()) {
         $event->addAssets([__DIR__ . '/../../js/forum/dist/extension.js']);
         $event->addBootstrapper('flagrow/analytics/main');
     }
 }
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         if ($this->settings->get('hyn.analytics.google')) {
             $rawJs = file_get_contents(realpath(__DIR__ . '/../../assets/js/google-analytics.js'));
             $js = str_replace("%%TRACKING_CODE%%", $this->settings->get('hyn.analytics.google'), $rawJs);
             $event->view->addFootString($js);
         }
     }
 }
 /**
  * @param ConfigureClientView $event
  */
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         $event->addAssets([__DIR__ . '/../../js/forum/dist/extension.js', __DIR__ . '/../../less/forum/extension.less']);
         $event->addBootstrapper('jordanjay29/summaries/main');
     }
     if ($event->isAdmin()) {
         $event->addAssets([__DIR__ . '/../../js/admin/dist/extension.js']);
         $event->addBootstrapper('jordanjay29/summaries/main');
     }
 }
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         $event->addAssets([__DIR__ . '/../../css/forum/forum.css', __DIR__ . '/../../js/forum/dist/extension.js']);
         $event->addBootstrapper('matpompili/imgur-upload/main');
     }
     if ($event->isAdmin()) {
         $event->addAssets([__DIR__ . '/../../js/admin/dist/extension.js']);
         $event->addBootstrapper('matpompili/imgur-upload/main');
     }
 }
 /**
  * @param ConfigureClientView $event
  */
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         $event->addAssets([__DIR__ . '/../../js/forum/dist/extension.js', __DIR__ . '/../../less/forum/extension.less']);
         $event->addBootstrapper('johnhearfield/auth-google/main');
     }
     if ($event->isAdmin()) {
         $event->addAssets([__DIR__ . '/../../js/admin/dist/extension.js']);
         $event->addBootstrapper('johnhearfield/auth-google/main');
     }
 }
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isAdmin()) {
         $event->addAssets([__DIR__ . '/../../js/admin/dist/extension.js']);
         $event->addBootstrapper('vingle/share/facebook/main');
     }
     if ($event->isForum()) {
         $event->addAssets([__DIR__ . '/../../js/forum/dist/extension.js', __DIR__ . '/../../less/forum/extension.less']);
         $event->addBootstrapper('vingle/share/facebook/main');
     }
 }
 /**
  * @param ConfigureClientView $event
  */
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         $event->addAssets([__DIR__ . '/../../js/forum/dist/extension.js', __DIR__ . '/../../less/forum/extension.less']);
         $event->addBootstrapper('vovayatsyuk/auth/magento/main');
     }
     if ($event->isAdmin()) {
         $event->addAssets([__DIR__ . '/../../js/admin/dist/extension.js', __DIR__ . '/../../less/admin/extension.less']);
         $event->addBootstrapper('vovayatsyuk/auth/magento/main');
     }
 }
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         $event->addAssets([__DIR__ . '/../../js/forum/dist/extension.js', __DIR__ . '/../../less/forum/extension.less']);
         $event->addBootstrapper('Davis/SocialProfile/main');
     }
     if ($event->isAdmin()) {
         $event->addAssets([__DIR__ . '/../../js/admin/dist/extension.js']);
         $event->addBootstrapper('Davis/SocialProfile/main');
     }
 }
Esempio n. 17
0
 /**
  * @param ConfigureClientView $event
  */
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         $event->addAssets([__DIR__ . '/../../js/forum/dist/extension.js']);
         $event->addBootstrapper('flarum/akismet/main');
     }
     if ($event->isAdmin()) {
         $event->addAssets([__DIR__ . '/../../js/admin/dist/extension.js']);
         $event->addBootstrapper('flarum/akismet/main');
     }
 }
Esempio n. 18
0
 /**
  * Modifies the client view for the Forum.
  *
  * @param ConfigureClientView $event
  */
 public function addForumAssets(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         $event->addAssets([__DIR__ . '/../../js/forum/dist/extension.js']);
         //Include css and java for KaTeX
         $event->view->addHeadString('<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.css">');
         $event->view->addHeadString('<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.js"></script>');
         $event->view->addHeadString('<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/contrib/auto-render.min.js"></script>');
         $event->addBootstrapper('flagrow/latex/main');
     }
 }
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isAdmin()) {
         $event->addAssets([__DIR__ . '/../../js/admin/dist/extension.js']);
         $event->addBootstrapper('sijad/google/analytics/main');
     }
     if ($event->isForum() && ($code = $this->settings->get('sijad-google-analytics.tracking_code'))) {
         $event->view->addFootString($code);
         $event->addAssets([__DIR__ . '/../../js/forum/dist/extension.js']);
         $event->addBootstrapper('sijad/google/analytics/main');
     }
 }
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         $event->addAssets([__DIR__ . '/../../js/forum/dist/extension.js']);
         $event->addAssets([__DIR__ . '/../../less/fullPage.less']);
         $event->addBootstrapper('matpompili/login-page/main');
     }
     if ($event->isAdmin()) {
         $event->addAssets([__DIR__ . '/../../js/admin/dist/extension.js']);
         $event->addBootstrapper('matpompili/login-page/main');
     }
 }
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         $event->addAssets([__DIR__ . '/../../js/forum/dist/extension.js', __DIR__ . '/../../less/forum/extension.less']);
         $event->addBootstrapper('Davis/SocialProfile/main');
         $js = file_get_contents(realpath(__DIR__ . '/../../assets/js/depend.js'));
         $event->view->addFootString($js);
     }
     if ($event->isAdmin()) {
         $event->addAssets([__DIR__ . '/../../js/admin/dist/extension.js']);
         $event->addBootstrapper('Davis/SocialProfile/main');
     }
 }
 /**
  * @param ConfigureClientView $event
  */
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         // Add google analytics if tracking UA has been configured.
         if ($this->settings->get('flagrow.analytics.statusGoogle') && $this->settings->get('flagrow.analytics.googleTrackingCode')) {
             $rawJs = file_get_contents(realpath(__DIR__ . '/../../assets/js/google-analytics.js'));
             $js = str_replace("%%TRACKING_CODE%%", $this->settings->get('flagrow.analytics.googleTrackingCode'), $rawJs);
             $event->view->addHeadString($js);
         }
         // get the validation data
         $settings = array('statusPiwik' => $this->settings->get('flagrow.analytics.statusPiwik'), 'piwikUrl' => $this->settings->get('flagrow.analytics.piwikUrl'), 'piwikSiteId' => $this->settings->get('flagrow.analytics.piwikSiteId'));
         // Add piwik specific tracking code if configured in admin.
         if ($settings['statusPiwik'] && $settings['piwikUrl'] && $settings['piwikSiteId']) {
             // get all the data
             $settings += array('piwikHideAliasUrl' => $this->settings->get('flagrow.analytics.piwikHideAliasUrl'), 'piwikAliasUrl' => $this->settings->get('flagrow.analytics.piwikAliasUrl'), 'piwikTrackSubdomain' => $this->settings->get('flagrow.analytics.piwikTrackSubdomain'), 'piwikPrependDomain' => $this->settings->get('flagrow.analytics.piwikPrependDomain'));
             $rawJs = file_get_contents(realpath(__DIR__ . '/../../assets/js/piwik-analytics.js'));
             $options = [];
             $options[] = "_paq.push(['setSiteId', " . $settings['piwikSiteId'] . "]);";
             if ($settings['piwikTrackSubdomain']) {
                 $options[] = "_paq.push(['setCookieDomain', '*." . $_SERVER['HTTP_HOST'] . "']);";
             }
             if ($settings['piwikPrependDomain']) {
                 $options[] = "_paq.push(['setDocumentTitle', document.domain + '/' + document.title]);";
             }
             if ($settings['piwikHideAliasUrl'] && $settings['piwikAliasUrl']) {
                 $options[] = "_paq.push(['setDomains', ['*." . $settings['piwikAliasUrl'] . "']]);";
             }
             // Sanity check, add empty string or the combined array.
             if (count($options)) {
                 $options = implode("\n    ", $options);
             } else {
                 $options = '';
             }
             // Replace the ##piwik_options## has with the settings or an empty string.
             $js = str_replace('##piwik_options##', $options, $rawJs);
             $js = str_replace("##piwik_url##", $settings['piwikUrl'], $js);
             $event->view->addHeadString($js);
         }
     }
 }
 /**
  * @param ConfigureClientView $event
  */
 public function getClientView(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         $this->clientView = $event->view;
         if ($this->settings->get('avatar4eg.share-social.open_graph') && (bool) $this->settings->get('avatar4eg.share-social.open_graph') === true) {
             $this->openGraph = true;
         }
         if ($this->settings->get('avatar4eg.share-social.twitter_card') && (bool) $this->settings->get('avatar4eg.share-social.twitter_card') === true) {
             $this->twitterCard = true;
         }
         if ($this->openGraph || $this->twitterCard) {
             $data = [];
             $data['url'] = $this->urlGenerator->toBase();
             $data['title'] = $this->plainText($this->settings->get('welcome_title'), 80);
             $data['description'] = $this->plainText($this->settings->get('forum_description'), 150);
             $this->addOpenGraph(['type' => 'website', 'site_name' => $this->settings->get('forum_title')]);
             $this->addOpenGraph($data);
             $this->addTwitterCard(['card' => 'summary']);
             $this->addTwitterCard($data);
         }
     }
 }
Esempio n. 24
0
 /**
  * @param ConfigureClientView $event
  */
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         // Check that the settings are configured before taking over login.
         $authSettings = SingleSO::settingsAuth($this->settings, false);
         if ($authSettings) {
             // Register the forum script.
             $event->addAssets([__DIR__ . '/../../js/forum/dist/extension.js']);
             $event->addBootstrapper('singleso/singleso-flarum/main');
             // Register some settings for the extension.
             $view = $event->view;
             $actor = $view->getActor();
             // Is the viewing user a guest.
             $guest = (bool) $actor->isGuest();
             // Is the user a manged user.
             $managed = (bool) (!$guest && isset($actor->singleso_id));
             // Logout hook if has logout URL, and is managed user.
             $logout = (bool) $authSettings['logout_url'];
             // Register the extension settings.
             $view->setVariable('singleso-singleso-flarum', ['controller' => SingleSO::CONTROLLER_PATH, 'logout' => $logout, 'managed' => $managed, 'guest' => $guest]);
             // JavaScript could also do the auto-login redirect.
             // Advantages:
             // - Preserve the URL hash (only used on the admin panel?).
             // - Potentially JSONP checking instead of cookie.
             // Disadvantages:
             // - Error pages not handled (pages that require login).
             // - Slower to do the login redirect.
             // - Requires JavaScript (Flarum already requires it).
             // Choosing to use middelware for the auto-login cookie.
             // do {
             // 	// Check if a guest.
             // 	if (!$guest) {
             // 		break;
             // 	}
             //
             // 	// Check if global login cookie configured.
             // 	$globalCookie = $authSettings['global_cookie'];
             // 	if (!$globalCookie) {
             // 		break;
             // 	}
             //
             // 	// Check if request contains the cookie.
             // 	$request = $view->getRequest();
             // 	$cookies = $request->getCookieParams();
             // 	if (!isset($cookies[$globalCookie])) {
             // 		break;
             // 	}
             //
             // 	// If all checks passed, inject the inline script.
             // 	$view->addHeadString(
             // 		'<script>' . $this->autoLoginScript() . '</script>',
             // 		'singleso-singleso-flarum-autologin'
             // 	);
             // } while(false);
         }
     }
     if ($event->isAdmin()) {
         // Register admin panel script.
         $event->addAssets([__DIR__ . '/../../js/admin/dist/extension.js']);
         $event->addBootstrapper('singleso/singleso-flarum/main');
         $view = $event->view;
         // Register the extension settings.
         $view->setVariable('singleso-singleso-flarum', ['controller' => SingleSO::CONTROLLER_PATH]);
     }
 }
Esempio n. 25
0
 public function setFilename(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         $event->view->getAssets()->setFilename(FLARUM_TENANT);
     }
 }
 /**
  * @param ConfigureClientView $event
  */
 public function addAssets(ConfigureClientView $event)
 {
     if ($event->isForum()) {
         $event->addAssets([__DIR__ . '/../../less/forum/extension.less']);
     }
 }