diff --git a/src/ContaoManagerPlugin.php b/src/ContaoManagerPlugin.php index b464aa6..19c4c51 100644 --- a/src/ContaoManagerPlugin.php +++ b/src/ContaoManagerPlugin.php @@ -22,7 +22,6 @@ class ContaoManagerPlugin implements BundlePluginInterface return [ BundleConfig::create(CgoITAeoBundle::class) ->setLoadAfter([ContaoCoreBundle::class]) - ->setLoadAfter(['*']) ->setReplace(['aeo']), ]; } diff --git a/src/Resources/contao/dca/tl_settings.php b/src/Resources/contao/dca/tl_settings.php index 3aae7a1..77a7e0e 100644 --- a/src/Resources/contao/dca/tl_settings.php +++ b/src/Resources/contao/dca/tl_settings.php @@ -211,7 +211,6 @@ class tl_settings_aeo extends \Backend */ public function checkForModuleOrCE($varVal, \DataContainer $dc) { $this->import('\\Database', 'Database'); - $this->import('aeo\\AeoUtil', 'AeoUtil'); $arrValue = deserialize($varVal); foreach ($arrValue as $key => $value) { diff --git a/src/Resources/contao/util/AeoFrontendUtil.php b/src/Resources/contao/util/AeoFrontendUtil.php index dfaa265..30eca66 100644 --- a/src/Resources/contao/util/AeoFrontendUtil.php +++ b/src/Resources/contao/util/AeoFrontendUtil.php @@ -30,6 +30,8 @@ namespace cgoIT\aeo; +use cgoIT\aeo\AeoUtil; + /** * Class AeoFrontendUtil */ @@ -76,6 +78,8 @@ class AeoFrontendUtil extends \Frontend { */ protected $aeo; + protected $aeoUtil; + /** * Initialize the object * @param array @@ -85,7 +89,7 @@ class AeoFrontendUtil extends \Frontend { if (TL_MODE == 'FE') { global $objPage; - $this->import('aeo\\AeoUtil', 'AeoUtil'); + $this->aeoUtil = new AeoUtil(); if ($GLOBALS['TL_CONFIG']['aeo_replace_standard_obfuscation'] === true) { $this->use_rot_13 = $GLOBALS['TL_CONFIG']['aeo_use_rot_13']; @@ -103,7 +107,7 @@ class AeoFrontendUtil extends \Frontend { $folder .= $objPage->rootLanguage.'/'; } if (in_array('i18nl10n', $this->Config->getActiveModules())) { - $this->AeoUtil->fixupCurrentLanguage(); + $this->aeoUtil->fixupCurrentLanguage(); if ($GLOBALS['TL_CONFIG']['i18nl10n_urlParam'] == 'url') { $folder .= $GLOBALS['TL_LANGUAGE'] . '/'; } @@ -123,7 +127,7 @@ class AeoFrontendUtil extends \Frontend { if (strlen($GLOBALS['TL_CONFIG']['urlSuffix']) > 0) { if (in_array('i18nl10n', $this->Config->getActiveModules()) && $GLOBALS['TL_CONFIG']['i18nl10n_urlParam'] == 'alias') { - $this->AeoUtil->fixupCurrentLanguage(); + $this->aeoUtil->fixupCurrentLanguage(); $urlSuffix .= '.'.$GLOBALS['TL_LANGUAGE']; } $urlSuffix .= $GLOBALS['TL_CONFIG']['urlSuffix']; @@ -186,7 +190,7 @@ class AeoFrontendUtil extends \Frontend { { global $objPage; $objPage2 = $this->getPageDetails($objPage->id); - $redirectPageId = $this->AeoUtil->getRedirectPageForLanguage(deserialize($this->jump_to_no_js), $objPage2->rootLanguage); + $redirectPageId = $this->aeoUtil->getRedirectPageForLanguage(deserialize($this->jump_to_no_js), $objPage2->rootLanguage); if (TL_MODE == 'FE' && $this->replace_standard_obfuscation && $objPage2->id != $redirectPageId) { $strContent = $this->aeoReplaceInsertTags($strContent); diff --git a/src/Resources/contao/util/AeoRedirectUtil.php b/src/Resources/contao/util/AeoRedirectUtil.php index 9f9a662..2f05fd7 100644 --- a/src/Resources/contao/util/AeoRedirectUtil.php +++ b/src/Resources/contao/util/AeoRedirectUtil.php @@ -30,18 +30,22 @@ namespace cgoIT\aeo; +use cgoIT\aeo\AeoUtil; + /** * Class AeoRedirectUtil */ class AeoRedirectUtil extends \Frontend { + protected $aeoUtil; + /** * Initialize the object * @param array */ public function __construct($arrAttributes=false) { parent::__construct($arrAttributes); - $this->import('aeo\\AeoUtil', 'AeoUtil'); + $this->aeoUtil = new AeoUtil(); } /** @@ -129,7 +133,7 @@ class AeoRedirectUtil extends \Frontend { $strObfuscatedValues = $arrFragments[3]; if (in_array('i18nl10n', $this->Config->getActiveModules()) && $GLOBALS['TL_CONFIG']['i18nl10n_urlParam'] == 'alias') { - $this->AeoUtil->fixupCurrentLanguage(); + $this->aeoUtil->fixupCurrentLanguage(); $strObfuscatedValues = str_replace('.'.$GLOBALS['TL_LANGUAGE'], '', $strObfuscatedValues); } $arrObfuscatedValues = explode('+', $strObfuscatedValues, 5); @@ -219,7 +223,7 @@ class AeoRedirectUtil extends \Frontend { } if (in_array('i18nl10n', $this->Config->getActiveModules()) && $GLOBALS['TL_CONFIG']['i18nl10n_urlParam'] == 'alias') { - $this->AeoUtil->fixupCurrentLanguage(); + $this->aeoUtil->fixupCurrentLanguage(); $strUrl = str_replace('.'.$GLOBALS['TL_LANGUAGE'], '', $strUrl); } return $strUrl;