Imports für Klasse AeoUtil gefixed

This commit is contained in:
Carsten Götzinger 2018-02-13 14:28:34 +01:00
parent d8736b81e1
commit c4f307a8ad
4 changed files with 15 additions and 9 deletions

View File

@ -22,7 +22,6 @@ class ContaoManagerPlugin implements BundlePluginInterface
return [ return [
BundleConfig::create(CgoITAeoBundle::class) BundleConfig::create(CgoITAeoBundle::class)
->setLoadAfter([ContaoCoreBundle::class]) ->setLoadAfter([ContaoCoreBundle::class])
->setLoadAfter(['*'])
->setReplace(['aeo']), ->setReplace(['aeo']),
]; ];
} }

View File

@ -211,7 +211,6 @@ class tl_settings_aeo extends \Backend
*/ */
public function checkForModuleOrCE($varVal, \DataContainer $dc) { public function checkForModuleOrCE($varVal, \DataContainer $dc) {
$this->import('\\Database', 'Database'); $this->import('\\Database', 'Database');
$this->import('aeo\\AeoUtil', 'AeoUtil');
$arrValue = deserialize($varVal); $arrValue = deserialize($varVal);
foreach ($arrValue as $key => $value) { foreach ($arrValue as $key => $value) {

View File

@ -30,6 +30,8 @@
namespace cgoIT\aeo; namespace cgoIT\aeo;
use cgoIT\aeo\AeoUtil;
/** /**
* Class AeoFrontendUtil * Class AeoFrontendUtil
*/ */
@ -76,6 +78,8 @@ class AeoFrontendUtil extends \Frontend {
*/ */
protected $aeo; protected $aeo;
protected $aeoUtil;
/** /**
* Initialize the object * Initialize the object
* @param array * @param array
@ -85,7 +89,7 @@ class AeoFrontendUtil extends \Frontend {
if (TL_MODE == 'FE') { if (TL_MODE == 'FE') {
global $objPage; global $objPage;
$this->import('aeo\\AeoUtil', 'AeoUtil'); $this->aeoUtil = new AeoUtil();
if ($GLOBALS['TL_CONFIG']['aeo_replace_standard_obfuscation'] === true) { if ($GLOBALS['TL_CONFIG']['aeo_replace_standard_obfuscation'] === true) {
$this->use_rot_13 = $GLOBALS['TL_CONFIG']['aeo_use_rot_13']; $this->use_rot_13 = $GLOBALS['TL_CONFIG']['aeo_use_rot_13'];
@ -103,7 +107,7 @@ class AeoFrontendUtil extends \Frontend {
$folder .= $objPage->rootLanguage.'/'; $folder .= $objPage->rootLanguage.'/';
} }
if (in_array('i18nl10n', $this->Config->getActiveModules())) { if (in_array('i18nl10n', $this->Config->getActiveModules())) {
$this->AeoUtil->fixupCurrentLanguage(); $this->aeoUtil->fixupCurrentLanguage();
if ($GLOBALS['TL_CONFIG']['i18nl10n_urlParam'] == 'url') { if ($GLOBALS['TL_CONFIG']['i18nl10n_urlParam'] == 'url') {
$folder .= $GLOBALS['TL_LANGUAGE'] . '/'; $folder .= $GLOBALS['TL_LANGUAGE'] . '/';
} }
@ -123,7 +127,7 @@ class AeoFrontendUtil extends \Frontend {
if (strlen($GLOBALS['TL_CONFIG']['urlSuffix']) > 0) { if (strlen($GLOBALS['TL_CONFIG']['urlSuffix']) > 0) {
if (in_array('i18nl10n', $this->Config->getActiveModules()) && if (in_array('i18nl10n', $this->Config->getActiveModules()) &&
$GLOBALS['TL_CONFIG']['i18nl10n_urlParam'] == 'alias') { $GLOBALS['TL_CONFIG']['i18nl10n_urlParam'] == 'alias') {
$this->AeoUtil->fixupCurrentLanguage(); $this->aeoUtil->fixupCurrentLanguage();
$urlSuffix .= '.'.$GLOBALS['TL_LANGUAGE']; $urlSuffix .= '.'.$GLOBALS['TL_LANGUAGE'];
} }
$urlSuffix .= $GLOBALS['TL_CONFIG']['urlSuffix']; $urlSuffix .= $GLOBALS['TL_CONFIG']['urlSuffix'];
@ -186,7 +190,7 @@ class AeoFrontendUtil extends \Frontend {
{ {
global $objPage; global $objPage;
$objPage2 = $this->getPageDetails($objPage->id); $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) { if (TL_MODE == 'FE' && $this->replace_standard_obfuscation && $objPage2->id != $redirectPageId) {
$strContent = $this->aeoReplaceInsertTags($strContent); $strContent = $this->aeoReplaceInsertTags($strContent);

View File

@ -30,18 +30,22 @@
namespace cgoIT\aeo; namespace cgoIT\aeo;
use cgoIT\aeo\AeoUtil;
/** /**
* Class AeoRedirectUtil * Class AeoRedirectUtil
*/ */
class AeoRedirectUtil extends \Frontend { class AeoRedirectUtil extends \Frontend {
protected $aeoUtil;
/** /**
* Initialize the object * Initialize the object
* @param array * @param array
*/ */
public function __construct($arrAttributes=false) { public function __construct($arrAttributes=false) {
parent::__construct($arrAttributes); parent::__construct($arrAttributes);
$this->import('aeo\\AeoUtil', 'AeoUtil'); $this->aeoUtil = new AeoUtil();
} }
/** /**
@ -129,7 +133,7 @@ class AeoRedirectUtil extends \Frontend {
$strObfuscatedValues = $arrFragments[3]; $strObfuscatedValues = $arrFragments[3];
if (in_array('i18nl10n', $this->Config->getActiveModules()) && if (in_array('i18nl10n', $this->Config->getActiveModules()) &&
$GLOBALS['TL_CONFIG']['i18nl10n_urlParam'] == 'alias') { $GLOBALS['TL_CONFIG']['i18nl10n_urlParam'] == 'alias') {
$this->AeoUtil->fixupCurrentLanguage(); $this->aeoUtil->fixupCurrentLanguage();
$strObfuscatedValues = str_replace('.'.$GLOBALS['TL_LANGUAGE'], '', $strObfuscatedValues); $strObfuscatedValues = str_replace('.'.$GLOBALS['TL_LANGUAGE'], '', $strObfuscatedValues);
} }
$arrObfuscatedValues = explode('+', $strObfuscatedValues, 5); $arrObfuscatedValues = explode('+', $strObfuscatedValues, 5);
@ -219,7 +223,7 @@ class AeoRedirectUtil extends \Frontend {
} }
if (in_array('i18nl10n', $this->Config->getActiveModules()) && if (in_array('i18nl10n', $this->Config->getActiveModules()) &&
$GLOBALS['TL_CONFIG']['i18nl10n_urlParam'] == 'alias') { $GLOBALS['TL_CONFIG']['i18nl10n_urlParam'] == 'alias') {
$this->AeoUtil->fixupCurrentLanguage(); $this->aeoUtil->fixupCurrentLanguage();
$strUrl = str_replace('.'.$GLOBALS['TL_LANGUAGE'], '', $strUrl); $strUrl = str_replace('.'.$GLOBALS['TL_LANGUAGE'], '', $strUrl);
} }
return $strUrl; return $strUrl;