Compare commits
No commits in common. "09f9578d20be68abf5134f501705ef157b8468be" and "f5cde24eb64ed8736c7495799b57108b701ae325" have entirely different histories.
09f9578d20
...
f5cde24eb6
3 changed files with 16 additions and 14 deletions
|
@ -4,6 +4,7 @@ namespace MMK2410\PlausibleAnalytics\Hooks;
|
|||
|
||||
use TYPO3\CMS\Core\Page\AssetCollector;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
|
||||
|
||||
class PageRendererPreProcess
|
||||
{
|
||||
|
@ -16,7 +17,7 @@ class PageRendererPreProcess
|
|||
public function __construct(AssetCollector $assetCollector = null)
|
||||
{
|
||||
$this->assetCollector = $assetCollector ?? GeneralUtility::makeInstance(AssetCollector::class);
|
||||
$this->tsfe = $GLOBALS['TSFE'] ?? null;
|
||||
$this->tsfe = $GLOBALS['TSFE'];
|
||||
}
|
||||
|
||||
public function addLibrary(): void
|
||||
|
@ -29,15 +30,16 @@ class PageRendererPreProcess
|
|||
$plausible = $this->getPlausibleURL();
|
||||
|
||||
if (isset($domain) && isset($plausible) && !$this->tsfe->isBackendUserLoggedIn()) {
|
||||
$this->assetCollector->addJavaScript(
|
||||
'plausible_analytics',
|
||||
$plausible . '/js/plausible.js',
|
||||
[
|
||||
'async' => 'async',
|
||||
'defer' => 'defer',
|
||||
'data-domain' => $domain
|
||||
],
|
||||
);
|
||||
GeneralUtility::makeInstance(AssetCollector::class)
|
||||
->addJavaScript(
|
||||
'plausible_analytics',
|
||||
$plausible . '/js/plausible.js',
|
||||
[
|
||||
'async' => 'async',
|
||||
'defer' => 'defer',
|
||||
'data-domain' => $domain
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
}
|
||||
},
|
||||
"require": {
|
||||
"php": "7.2.0 - 8.1.99",
|
||||
"typo3/cms-core": "^10.4 || ^11.5"
|
||||
"php": "7.2.0 - 7.4.99",
|
||||
"typo3/cms-core": "^10.4"
|
||||
},
|
||||
"replace": {
|
||||
"typo3-ter/plausible-analytics": "self.version"
|
||||
|
|
|
@ -11,8 +11,8 @@ $EM_CONF[$_EXTKEY] = [
|
|||
'version' => '1.1.0',
|
||||
'constraints' => [
|
||||
'depends' => [
|
||||
'typo3' => '10.4.0-11.5.99',
|
||||
'php' => '7.2.0-8.1.99'
|
||||
'typo3' => '10.4.0-10.4.99',
|
||||
'php' => '7.2.0-7.4.99'
|
||||
],
|
||||
],
|
||||
'autoload' => [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue