diff --git a/copy_this/modules/d3/d3geoip/metadata.php b/copy_this/modules/d3/d3geoip/metadata.php
deleted file mode 100644
index 1b34e19..0000000
--- a/copy_this/modules/d3/d3geoip/metadata.php
+++ /dev/null
@@ -1,50 +0,0 @@
- 'd3geoip',
- 'title' => (class_exists('d3utils') ? d3utils::getInstance()->getD3Logo() : 'D³') . ' GeoIP Vorauswahl',
- 'description' => array(
- 'de' => 'Begrüßen Sie Ihre Kunden in seiner Landessprache.',
- 'en' => '',
- ),
- 'thumbnail' => 'picture.png',
- 'version' => '3.1.0.0',
- 'author' => 'D³ Data Development (Inh.: Thomas Dartsch)',
- 'email' => 'support@shopmodule.com',
- 'url' => 'http://www.oxidmodule.com/',
- 'extend' => array(
- 'oxcmp_lang' => 'd3/d3geoip/modules/components/d3_oxcmp_lang_geoip',
- 'oxshopcontrol' => 'd3/d3geoip/modules/controllers/d3_oxshopcontrol_geoip',
- ),
- 'files' => array(
- 'd3cmp_geoip' => 'd3/d3geoip/components/d3cmp_geoip.php',
- 'd3_cfg_geoipset' => 'd3/d3geoip/controllers/admin/d3_cfg_geoipset.php',
- 'd3_cfg_geoipset_list' => 'd3/d3geoip/controllers/admin/d3_cfg_geoipset_list.php',
- 'd3_cfg_geoipset_main' => 'd3/d3geoip/controllers/admin/d3_cfg_geoipset_main.php',
- 'd3_cfg_geoipset_licence' => 'd3/d3geoip/controllers/admin/d3_cfg_geoipset_licence.php',
- 'd3_country_geoip' => 'd3/d3geoip/controllers/admin/d3_country_geoip.php',
- 'd3geoip' => 'd3/d3geoip/models/d3geoip.php',
- 'd3geoip_update' => 'd3/d3geoip/setup/d3geoip_update.php',
- ),
- 'templates' => array(
- 'd3_cfg_geoipset_main.tpl' => 'd3/d3geoip/views/admin/tpl/d3_cfg_geoipset_main.tpl',
- 'd3_country_geoip.tpl' => 'd3/d3geoip/views/admin/tpl/d3_country_geoip.tpl',
- ),
- 'events' => array(
- 'onActivate' => 'd3install::checkUpdateStart',
- ),
- 'blocks' => array(
- ),
- 'd3FileRegister' => array(
- 'd3/d3geoip/IntelliSenseHelper.php',
- 'd3/d3geoip/metadata.php',
- 'd3/d3geoip/views/admin/de/d3_geoip_lang.php',
- ),
-);
\ No newline at end of file
diff --git a/copy_this/modules/d3/d3geoip/modules/components/d3_oxcmp_lang_geoip.php b/copy_this/modules/d3/d3geoip/modules/components/d3_oxcmp_lang_geoip.php
deleted file mode 100644
index 6793c39..0000000
--- a/copy_this/modules/d3/d3geoip/modules/components/d3_oxcmp_lang_geoip.php
+++ /dev/null
@@ -1,17 +0,0 @@
-_sModId)->isActive()) {
- /** @var $oLocation d3geoip */
- $oLocation = oxNew('d3geoip');
- $oLocation->setCountryLanguage();
- }
-
- parent::init();
- }
-}
\ No newline at end of file
diff --git a/copy_this/modules/d3/d3geoip/components/d3cmp_geoip.php b/copy_this/modules/d3/geoip/Application/Component/d3cmp_geoip.php
similarity index 62%
rename from copy_this/modules/d3/d3geoip/components/d3cmp_geoip.php
rename to copy_this/modules/d3/geoip/Application/Component/d3cmp_geoip.php
index b9f0d2a..da5aeac 100644
--- a/copy_this/modules/d3/d3geoip/components/d3cmp_geoip.php
+++ b/copy_this/modules/d3/geoip/Application/Component/d3cmp_geoip.php
@@ -14,7 +14,20 @@
* @link http://www.oxidmodule.com
*/
-class d3cmp_geoip extends oxView
+namespace D3\GeoIp\Application\Component;
+
+use D3\GeoIp\Application\Model\d3geoip;
+use D3\ModCfg\Application\Model\Configuration\d3_cfg_mod;
+use D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception;
+use D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException;
+use Doctrine\DBAL\DBALException;
+use OxidEsales\Eshop\Core\Controller\BaseController;
+use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
+use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
+use OxidEsales\Eshop\Core\Exception\StandardException;
+use OxidEsales\Eshop\Core\Registry;
+
+class d3cmp_geoip extends BaseController
{
/**
* Marking object as component
@@ -25,17 +38,27 @@ class d3cmp_geoip extends oxView
private $_sModId = 'd3_geoip';
+ /**
+ * @throws d3ShopCompatibilityAdapterException
+ * @throws d3_cfg_mod_exception
+ * @throws DBALException
+ * @throws DatabaseConnectionException
+ * @throws DatabaseErrorException
+ * @throws StandardException
+ * @throws ConnectionException
+ * @throws SystemComponentException
+ */
public function init()
{
if (d3_cfg_mod::get($this->_sModId)->isActive()) {
if (d3_cfg_mod::get($this->_sModId)->hasDebugMode()) {
/** @var $oGeoIp d3geoip */
- $oGeoIp = oxNew('d3geoip');
+ $oGeoIp = oxNew(d3geoip::class);
echo $oGeoIp->getIP();
}
/** @var $oLocation d3geoip */
- $oLocation = oxNew('d3geoip');
+ $oLocation = oxNew(d3geoip::class);
$oLocation->setCountryCurrency();
// moved to oxcmp_lang extension because here it's to late
// $oLocation->setCountryLanguage();
@@ -48,7 +71,7 @@ class d3cmp_geoip extends oxView
// reason: own component can added after default components only
if ($oLocation->hasNotSetCurrency($oBasket->getBasketCurrency())) {
/** @var oxUBase $oActView */
- $oActView = oxRegistry::getConfig()->getActiveView();
+ $oActView = Registry::getConfig()->getActiveView();
$aComponents = $oActView->getComponents();
/** @var oxcmp_cur $oCurCmp */
diff --git a/copy_this/modules/d3/d3geoip/controllers/admin/d3_cfg_geoipset.php b/copy_this/modules/d3/geoip/Application/Controller/Admin/d3_cfg_geoipset.php
similarity index 88%
rename from copy_this/modules/d3/d3geoip/controllers/admin/d3_cfg_geoipset.php
rename to copy_this/modules/d3/geoip/Application/Controller/Admin/d3_cfg_geoipset.php
index 61ec21e..2761010 100644
--- a/copy_this/modules/d3/d3geoip/controllers/admin/d3_cfg_geoipset.php
+++ b/copy_this/modules/d3/geoip/Application/Controller/Admin/d3_cfg_geoipset.php
@@ -1,5 +1,9 @@
getUserLocationCountryObject($sIP);
if ($oCountry->getId()) {
$sTitle = $oCountry->getFieldData('oxtitle');
} else {
- $sTitle = oxRegistry::getLang()->translateString('D3_GEOIP_SET_IP_CHECKIP_NOTSET');
+ $sTitle = Registry::getLang()->translateString('D3_GEOIP_SET_IP_CHECKIP_NOTSET');
}
stopProfile(__METHOD__);
@@ -48,7 +61,7 @@ class d3_cfg_geoipset_main extends d3_cfg_mod_main
}
/**
- * @return oxcountrylist
+ * @return CountryList
*/
public function getIPCountryList()
{
@@ -57,10 +70,10 @@ class d3_cfg_geoipset_main extends d3_cfg_mod_main
}
startProfile(__METHOD__);
- /** @var $oGeoIp d3geoip */
- $oGeoIp = oxNew('d3geoip');
- /** @var $oCountryList oxcountrylist */
- $this->oCountryList = oxNew('oxcountrylist');
+ /** @var $oGeoIp d3geoip */
+ $oGeoIp = oxNew(d3geoip::class);
+ /** @var $oCountryList CountryList */
+ $this->oCountryList = oxNew(CountryList::class);
$oListObject = $this->oCountryList->getBaseObject();
$sFieldList = $oListObject->getSelectFields();
$sQ = "select (SELECT d3startip FROM ".$oGeoIp->getViewName().
diff --git a/copy_this/modules/d3/d3geoip/controllers/admin/d3_country_geoip.php b/copy_this/modules/d3/geoip/Application/Controller/Admin/d3_country_geoip.php
similarity index 76%
rename from copy_this/modules/d3/d3geoip/controllers/admin/d3_country_geoip.php
rename to copy_this/modules/d3/geoip/Application/Controller/Admin/d3_country_geoip.php
index a44c328..f1c5bc8 100644
--- a/copy_this/modules/d3/d3geoip/controllers/admin/d3_country_geoip.php
+++ b/copy_this/modules/d3/geoip/Application/Controller/Admin/d3_country_geoip.php
@@ -1,5 +1,4 @@
getConfigParam('blAllowSharedEdit')) {
+ if (false == Registry::getConfig()->getConfigParam('blAllowSharedEdit')) {
$this->addTplParam('readonly', true);
}
$ret = parent::render();
- $soxId = oxRegistry::getConfig()->getRequestParameter("oxid");
+ $soxId = Registry::get(Request::class)->getRequestParameter("oxid");
// check if we right now saved a new entry
- $sSavedID = oxRegistry::getConfig()->getRequestParameter("saved_oxid");
+ $sSavedID = Registry::get(Request::class)->getRequestParameter("saved_oxid");
if (($soxId == "-1" || !isset($soxId)) && isset($sSavedID)) {
$soxId = $sSavedID;
- oxRegistry::getSession()->deleteVariable("saved_oxid");
+ Registry::getSession()->deleteVariable("saved_oxid");
$this->addTplParam("oxid", $soxId);
// for reloading upper frame
$this->addTplParam("updatelist", "1");
@@ -69,7 +77,7 @@ class d3_country_geoip extends oxAdminView
$this->addTplParam("edit", $oCountry);
// remove already created languages
- $aLang = array_diff(oxRegistry::getLang()->getLanguageNames(), $oOtherLang);
+ $aLang = array_diff(Registry::getLang()->getLanguageNames(), $oOtherLang);
if (count($aLang)) {
$this->addTplParam("posslang", $aLang);
@@ -98,6 +106,9 @@ class d3_country_geoip extends oxAdminView
/**
* @param $sIdent
* @return mixed
+ * @throws \Doctrine\DBAL\DBALException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
*/
public function getModCfgValue($sIdent)
{
@@ -117,12 +128,12 @@ class d3_country_geoip extends oxAdminView
public function save()
{
//allow malladmin only to perform this action
- if (false == oxRegistry::getConfig()->getConfigParam('blAllowSharedEdit')) {
+ if (false == Registry::getConfig()->getConfigParam('blAllowSharedEdit')) {
return;
}
- $soxId = oxRegistry::getConfig()->getRequestParameter("oxid");
- $aParams = oxRegistry::getConfig()->getRequestParameter("editval");
+ $soxId = Registry::get(Request::class)->getRequestParameter("oxid");
+ $aParams = Registry::get(Request::class)->getRequestParameter("editval");
/** @var $oCountry oxcountry */
$oCountry = oxNew("oxcountry");
@@ -136,14 +147,14 @@ class d3_country_geoip extends oxAdminView
$oCountry->setLanguage(0);
$oCountry->assign($aParams);
$oCountry->setLanguage($this->_iEditLang);
- $oCountry = oxRegistry::get('oxUtilsFile')->processFiles($oCountry);
+ $oCountry = Registry::get('oxUtilsFile')->processFiles($oCountry);
$oCountry->save();
$this->addTplParam("updatelist", "1");
// set oxid if inserted
if ($soxId == "-1") {
- oxRegistry::getSession()->setVariable("saved_oxid", $oCountry->getId());
+ Registry::getSession()->setVariable("saved_oxid", $oCountry->getId());
}
}
@@ -157,6 +168,9 @@ class d3_country_geoip extends oxAdminView
/**
* @return array
+ * @throws \Doctrine\DBAL\DBALException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
*/
public function getCurList()
{
@@ -166,13 +180,14 @@ class d3_country_geoip extends oxAdminView
) {
$sShopId = $this->oCountry->getFieldData('d3geoipshop');
} else {
- $sShopId = oxRegistry::getConfig()->getActiveView()->getViewConfig()->getActiveShopId();
+ $sShopId = Registry::getConfig()->getActiveView()->getViewConfig()->getActiveShopId();
}
- $sQ = "select DECODE( oxvarvalue, '".oxRegistry::getConfig()->getConfigParam('sConfigKey').
+ $sQ = "select DECODE( oxvarvalue, '".Registry::getConfig()->getConfigParam('sConfigKey').
"') as oxvarvalue from oxconfig where oxshopid = '".$sShopId."' AND oxvarname = 'aCurrencies'";
- $sCurs = oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->getOne($sQ);
+ $oDB = DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC);
+ $sCurs = $oDB->getOne($sQ);
return $this->d3ExtractCurList($sCurs);
}
@@ -201,6 +216,9 @@ class d3_country_geoip extends oxAdminView
/**
* ToDo: has to be refactored
* @return array
+ * @throws \Doctrine\DBAL\DBALException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
*/
public function getLangList()
{
@@ -210,12 +228,12 @@ class d3_country_geoip extends oxAdminView
) {
$sShopId = $this->oCountry->getFieldData('d3geoipshop');
} else {
- $sShopId = oxRegistry::getConfig()->getActiveView()->getViewConfig()->getActiveShopId();
+ $sShopId = Registry::getConfig()->getActiveView()->getViewConfig()->getActiveShopId();
}
$aLanguages = array();
- $aLangParams = oxRegistry::getConfig()->getShopConfVar('aLanguageParams', $sShopId);
- $aConfLanguages = oxRegistry::getConfig()->getShopConfVar('aLanguages', $sShopId);
+ $aLangParams = Registry::getConfig()->getShopConfVar('aLanguageParams', $sShopId);
+ $aConfLanguages = Registry::getConfig()->getShopConfVar('aLanguages', $sShopId);
if (is_array($aConfLanguages)) {
$i = 0;
diff --git a/copy_this/modules/d3/d3geoip/models/d3geoip.php b/copy_this/modules/d3/geoip/Application/Model/d3geoip.php
similarity index 60%
rename from copy_this/modules/d3/d3geoip/models/d3geoip.php
rename to copy_this/modules/d3/geoip/Application/Model/d3geoip.php
index 516bf3d..f376d8a 100644
--- a/copy_this/modules/d3/d3geoip/models/d3geoip.php
+++ b/copy_this/modules/d3/geoip/Application/Model/d3geoip.php
@@ -1,5 +1,4 @@
init('d3geoip');
}
- /**
- * get oxcountry object by given IP address (optional)
- *
- * @param string $sIP optional
- *
- * @return oxcountry
- * @throws d3_cfg_mod_exception
- * @throws oxConnectionException
- * @throws oxSystemComponentException
- */
+ /**
+ * get oxcountry object by given IP address (optional)
+ *
+ * @param string $sIP optional
+ *
+ * @return oxcountry
+ * @throws \D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException
+ * @throws \D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception
+ * @throws \Doctrine\DBAL\DBALException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
+ * @throws \OxidEsales\Eshop\Core\Exception\StandardException
+ */
public function getUserLocationCountryObject($sIP = null)
{
if (!$this->oCountry) {
@@ -50,7 +62,7 @@ class d3GeoIP extends oxBase
$sIP = $this->getIP();
}
- $sISOAlpha = $this->loadByIP(oxRegistry::getConfig()->checkParamSpecialChars($sIP));
+ $sISOAlpha = $this->loadByIP(Registry::getConfig()->checkParamSpecialChars($sIP));
if (!$sISOAlpha) {
$this->_getLog()->log(
@@ -80,12 +92,14 @@ class d3GeoIP extends oxBase
return $this->oCountry;
}
- /**
- * get IP address from client or set test IP address
- *
- * @return string
- * @throws d3_cfg_mod_exception
- */
+ /**
+ * get IP address from client or set test IP address
+ *
+ * @return string
+ * @throws \Doctrine\DBAL\DBALException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
+ */
public function getIP()
{
startProfile(__METHOD__);
@@ -123,17 +137,17 @@ class d3GeoIP extends oxBase
stopProfile(__METHOD__);
- return oxRegistry::getConfig()->checkParamSpecialChars($sIP);
+ return Registry::getConfig()->checkParamSpecialChars($sIP);
}
- /**
- * get ISO alpha 2 ID by IP address
- *
- * @param int $sIP IP address
- *
- * @return string
- * @throws oxConnectionException
- */
+ /**
+ * get ISO alpha 2 ID by IP address
+ *
+ * @param int $sIP IP address
+ *
+ * @return string
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
+ */
public function loadByIP($sIP)
{
startProfile(__METHOD__);
@@ -156,44 +170,47 @@ class d3GeoIP extends oxBase
0
) BETWEEN D3STARTIPBIN AND D3ENDIPBIN";
- $sISO = oxDb::getDb()->getOne($sSelect);
+ $oDB = DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC);
+ $sISO = $oDB->getOne($sSelect);
stopProfile(__METHOD__);
return $sISO;
}
- /**
- * get oxcountry object by ISO alpha 2 ID
- *
- * @param string $sISOAlpha
- *
- * @return oxcountry
- * @throws oxConnectionException
- * @throws oxSystemComponentException
- */
+ /**
+ * get Country object by ISO alpha 2 ID
+ *
+ * @param string $sISOAlpha
+ *
+ * @return Country
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
+ */
public function getCountryObject($sISOAlpha)
{
startProfile(__METHOD__);
- $oCountry = oxNew('oxcountry');
+ /** @var Country $oCountry */
+ $oCountry = oxNew(Country::class);
$sSelect = "SELECT oxid FROM ".$oCountry->getViewName().
" WHERE OXISOALPHA2 = '".$sISOAlpha."' AND OXACTIVE = '1'";
- $oCountry->load(oxDb::getDb()->getOne($sSelect));
+ $oDB = DatabaseProvider::getDb();
+ $oCountry->load($oDB->getOne($sSelect));
stopProfile(__METHOD__);
return $oCountry;
}
- /**
- * get oxcountry object for fallback, if set
- *
- * @return oxcountry
- * @throws d3_cfg_mod_exception
- * @throws oxSystemComponentException
- */
+ /**
+ * get Country object for fallback, if set
+ *
+ * @return oxcountry
+ * @throws \Doctrine\DBAL\DBALException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
+ */
public function getCountryFallBackObject()
{
startProfile(__METHOD__);
@@ -211,13 +228,18 @@ class d3GeoIP extends oxBase
return $oCountry;
}
- /**
- * check module active state and set user country specific language
- *
- * @throws d3_cfg_mod_exception
- * @throws oxConnectionException
- * @throws oxSystemComponentException
- */
+ /**
+ * check module active state and set user country specific language
+ *
+ * @throws \D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException
+ * @throws \D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception
+ * @throws \Doctrine\DBAL\DBALException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
+ * @throws \OxidEsales\Eshop\Core\Exception\StandardException
+ * @throws oxConnectionException
+ * @throws oxSystemComponentException
+ */
public function setCountryLanguage()
{
startProfile(__METHOD__);
@@ -234,9 +256,9 @@ class d3GeoIP extends oxBase
$oCountry = $this->getUserLocationCountryObject();
if (!$this->isAdmin()
- && oxRegistry::getUtils()->isSearchEngine() === false
- && oxRegistry::getSession()->getId()
- && oxRegistry::getSession()->getVariable('d3isSetLang') === null
+ && Registry::getUtils()->isSearchEngine() === false
+ && Registry::getSession()->getId()
+ && Registry::getSession()->getVariable('d3isSetLang') === null
&& $oCountry->getId() && $oCountry->getFieldData('d3geoiplang') > -1
) {
$this->_getLog()->log(
@@ -247,21 +269,26 @@ class d3GeoIP extends oxBase
'set language',
$this->getIP().' => '.$oCountry->getFieldData('d3geoiplang')
);
- oxRegistry::getLang()->setTplLanguage((int) $oCountry->getFieldData('d3geoiplang'));
- oxRegistry::getLang()->setBaseLanguage((int) $oCountry->getFieldData('d3geoiplang'));
- oxRegistry::getSession()->setVariable('d3isSetLang', true);
+ Registry::getLang()->setTplLanguage((int) $oCountry->getFieldData('d3geoiplang'));
+ Registry::getLang()->setBaseLanguage((int) $oCountry->getFieldData('d3geoiplang'));
+ Registry::getSession()->setVariable('d3isSetLang', true);
}
stopProfile(__METHOD__);
}
- /**
- * check module active state and set user country specific currency
- *
- * @throws d3_cfg_mod_exception
- * @throws oxConnectionException
- * @throws oxSystemComponentException
- */
+ /**
+ * check module active state and set user country specific currency
+ *
+ * @throws \D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException
+ * @throws \D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception
+ * @throws \Doctrine\DBAL\DBALException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
+ * @throws \OxidEsales\Eshop\Core\Exception\StandardException
+ * @throws oxConnectionException
+ * @throws oxSystemComponentException
+ */
public function setCountryCurrency()
{
if (!$this->_getModConfig()->isActive()
@@ -275,8 +302,8 @@ class d3GeoIP extends oxBase
$oCountry = $this->getUserLocationCountryObject();
if (!$this->isAdmin()
- && oxRegistry::getUtils()->isSearchEngine() === false
- && !oxRegistry::getSession()->getVariable('d3isSetCurr')
+ && Registry::getUtils()->isSearchEngine() === false
+ && !Registry::getSession()->getVariable('d3isSetCurr')
&& $oCountry->getId()
&& $oCountry->getFieldData('d3geoipcur') > -1
) {
@@ -288,8 +315,8 @@ class d3GeoIP extends oxBase
'set currency',
$this->getIP().' => '.$oCountry->getFieldData('d3geoipcur')
);
- oxRegistry::getConfig()->setActShopCurrency((int) $oCountry->getFieldData('d3geoipcur'));
- oxRegistry::getSession()->setVariable('d3isSetCurr', true);
+ Registry::getConfig()->setActShopCurrency((int) $oCountry->getFieldData('d3geoipcur'));
+ Registry::getSession()->setVariable('d3isSetCurr', true);
}
stopProfile(__METHOD__);
@@ -315,13 +342,18 @@ class d3GeoIP extends oxBase
return false;
}
- /**
- * check module active state and perform switching to user country specific shop (EE only)
- *
- * @throws d3_cfg_mod_exception
- * @throws oxConnectionException
- * @throws oxSystemComponentException
- */
+ /**
+ * check module active state and perform switching to user country specific shop (EE only)
+ *
+ * @throws \D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException
+ * @throws \D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception
+ * @throws \Doctrine\DBAL\DBALException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
+ * @throws \OxidEsales\Eshop\Core\Exception\StandardException
+ * @throws oxConnectionException
+ * @throws oxSystemComponentException
+ */
public function performShopSwitch()
{
if (!$this->_getModConfig()->isActive() || !$this->_getModConfig()->getValue('blChangeShop')) {
@@ -333,15 +365,15 @@ class d3GeoIP extends oxBase
$oCountry = $this->getUserLocationCountryObject();
$iNewShop = $oCountry->getFieldData('d3geoipshop');
- if (oxRegistry::getConfig()->getRequestParameter('d3redirect') != 1
+ if (Registry::get(Request::class)->getRequestParameter('d3redirect') != 1
&& false == $this->isAdmin()
- && oxRegistry::getUtils()->isSearchEngine() === false
+ && Registry::getUtils()->isSearchEngine() === false
&& $oCountry->getId()
&& $this->getConfig()->isMall()
&& $iNewShop > -1 &&
(
$iNewShop != $this->getConfig()->getShopId()
- || strtolower($this->getConfig()->getActiveView()->getClassName()) == 'mallstart'
+ || strtolower($this->getConfig()->getActiveView()->getClassKey()) == 'mallstart'
)
) {
$oNewConf = new oxConfig();
@@ -350,7 +382,7 @@ class d3GeoIP extends oxBase
$this->getConfig()->onShopChange();
- if (!oxRegistry::getSession()->getVariable('d3isSetLang')
+ if (!Registry::getSession()->getVariable('d3isSetLang')
&& $this->_getModConfig()->getValue('blChangeLang')
&& $oCountry->getFieldData('d3geoiplang') > -1
) {
@@ -360,10 +392,10 @@ class d3GeoIP extends oxBase
}
/** @var $oStr d3str */
- $oStr = oxRegistry::get('d3str');
+ $oStr = Registry::get('d3str');
$aParams = array(
'd3redirect' => '1',
- 'fnc' => oxRegistry::getConfig()->getRequestParameter('fnc'),
+ 'fnc' => Registry::get(Request::class)->getRequestParameter('fnc'),
'shp' => $iNewShop
);
$sUrl = str_replace(
@@ -388,13 +420,18 @@ class d3GeoIP extends oxBase
stopProfile(__METHOD__);
}
- /**
- * check module active state and perform switching to user country specific url
- *
- * @throws d3_cfg_mod_exception
- * @throws oxConnectionException
- * @throws oxSystemComponentException
- */
+ /**
+ * check module active state and perform switching to user country specific url
+ *
+ * @throws \D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException
+ * @throws \D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception
+ * @throws \Doctrine\DBAL\DBALException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
+ * @throws \OxidEsales\Eshop\Core\Exception\StandardException
+ * @throws oxConnectionException
+ * @throws oxSystemComponentException
+ */
public function performURLSwitch()
{
if (!$this->_getModConfig()->isActive()
@@ -407,7 +444,7 @@ class d3GeoIP extends oxBase
$oCountry = $this->getUserLocationCountryObject();
if (false == $this->isAdmin()
- && oxRegistry::getUtils()->isSearchEngine() === false
+ && Registry::getUtils()->isSearchEngine() === false
&& $oCountry->getId()
&& $oCountry->getFieldData('d3geoipurl')
&& strlen(trim($oCountry->getFieldData('d3geoipurl'))) > 0
@@ -453,23 +490,27 @@ class d3GeoIP extends oxBase
return $aShopUrls;
}
- /**
- * get modcfg instance
- *
- * @return d3_cfg_mod
- * @throws d3_cfg_mod_exception
- */
+ /**
+ * get modcfg instance
+ *
+ * @return d3_cfg_mod
+ * @throws \Doctrine\DBAL\DBALException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
+ */
protected function _getModConfig()
{
return d3_cfg_mod::get($this->_sModId);
}
- /**
- * get d3log instance
- *
- * @return d3log
- * @throws d3_cfg_mod_exception
- */
+ /**
+ * get d3log instance
+ *
+ * @return d3log
+ * @throws \Doctrine\DBAL\DBALException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
+ */
protected function _getLog()
{
if (!$this->oD3Log) {
diff --git a/copy_this/modules/d3/d3geoip/views/admin/de/d3_geoip_lang.php b/copy_this/modules/d3/geoip/Application/views/admin/de/d3_geoip_lang.php
similarity index 76%
rename from copy_this/modules/d3/d3geoip/views/admin/de/d3_geoip_lang.php
rename to copy_this/modules/d3/geoip/Application/views/admin/de/d3_geoip_lang.php
index 7baa5d4..3f3836a 100644
--- a/copy_this/modules/d3/d3geoip/views/admin/de/d3_geoip_lang.php
+++ b/copy_this/modules/d3/geoip/Application/views/admin/de/d3_geoip_lang.php
@@ -1,71 +1,71 @@
-
- * @link http://www.oxidmodule.com
- */
-
-$sLangName = 'Deutsch';
-$iLangNr = 0;
-// -------------------------------
-// RESOURCE IDENTITFIER = STRING
-// -------------------------------
-$aLang = array(
- 'charset' => 'ISO-8859-15',
- 'd3mxgeoip' => " GeoIP",
- 'd3mxgeoip_settings' => 'Einstellungen',
- 'd3tbclgeoip_settings_main' => 'Grundeinstellungen',
- 'tbclcountry_geoip' => 'GeoIP-Kundenumleitungen',
-
- 'D3_GEOIP_TRANSL' => 'GeoIP-Kundenumleitungen',
-
- 'D3_GEOIP_SET_DEBUG_DESC' => 'Mit aktiviertem Debug-Modus wird im Frontend die aktuelle '.
- 'IP-Adresse des Shopbesuchers gezeigt. Beachten Sie, dass Umleitungen, die auf Weiterleitungen basieren, dann '.
- 'nicht ausgeführt werden können.',
- 'D3_GEOIP_SET_OPTIONS' => 'Optionen',
- 'D3_GEOIP_SET_OPTIONS_CHANGESHOP' => 'Mandant wechseln, wenn eingestellt (nur EE)',
- 'D3_GEOIP_SET_OPTIONS_CHANGECURR' => 'Währung wechseln, wenn eingestellt',
- 'D3_GEOIP_SET_OPTIONS_CHANGELANG' => 'Sprache wechseln, wenn eingestellt',
- 'D3_GEOIP_SET_OPTIONS_CHANGEURL' => 'URL wechseln, wenn eingestellt',
- 'D3_GEOIP_SET_OPTIONS_NOCOUNTRY' => 'Shop verwendet die Einstellung dieses Landes, wenn IP nicht '.
- 'zuzuordnen ist',
- 'D3_GEOIP_SET_IP' => 'IP-Einstellungen',
- 'D3_GEOIP_SET_IP_TESTIP' => 'statt Kunden-IP immer diese IP-Adresse verwenden',
- 'D3_GEOIP_SET_IP_TESTCOUNTRY' => 'statt Kunden-IP immer eine IP-Adresse dieses Landes verwenden',
- 'D3_GEOIP_SET_IP_TESTCOUNTRY_INACTIVE' => '(inaktiv)',
- 'D3_GEOIP_SET_IP_CHECKIP' => 'diese IP-Adresse prüfen',
- 'D3_GEOIP_SET_IP_CHECKIP_NOTSET' => 'IP nicht zugewiesen oder Land nicht aktiv',
- 'D3_GENERAL_GEOIP_SAVE' => 'Speichern',
-
- 'D3_GEOIP_SELSHOP' => 'zuständiger Shop',
- 'D3_GEOIP_SELLANG' => 'vorgewählte Sprache',
- 'D3_GEOIP_SELCUR' => 'vorgewählte Währung',
- 'D3_GEOIP_CUSTSELSHOP' => ' - vom Kunden gewählter Shop - ',
- 'D3_GEOIP_CUSTSELLANG' => ' - vom Kunden gewählte Sprache - ',
- 'D3_GEOIP_CUSTSELCUR' => ' - vom Kunden gewählte Währung - ',
- 'D3_GEOIP_OR' => 'oder',
- 'D3_GEOIP_DISABLED' => '(deaktiviert)',
- 'D3_GEOIP_SELURL' => 'zu wechselnde URL',
- 'D3_GEOIP_SELURL_DESC' => 'Sobald im URL-Feld eine Eingabe vorhanden ist, wird bei '.
- 'passenden Kunden versucht, zur hinterlegten URL zu wechseln. Möchten Sie den Mandanten, die Währung und / '.
- 'oder die Sprache einstellen, entfernen Sie die URL.
Aktivieren / deaktivieren Sie den URL-Wechsel '.
- 'zusätzlich in den Modul-Grundeinstellungen.',
-
- 'D3_GEOIP_METADATA_TITLE' => 'D³ GeoIP Vorauswahl',
- 'D3_GEOIP_METADATA_DESC' => 'Begrüßen Sie Ihre Kunden in seiner Landessprache.',
-
- 'D3_GEOIP_UPDATE_ITEMINSTALL' => 'Die umfangreiche IP-Liste kann leider nicht über die '.
- 'automatische Installation eingebunden werden. Bitte installieren Sie diese manuell. '.PHP_EOL.PHP_EOL.
- 'Laden Sie bitte die aktuellen CSV-Daten des Anbieters Maxmind. In "setup+doku/importCSVtoMySQL" des Modulpaketes finden Sie weitere Informationen und die erforderlichen Datenbank-Befehle, um die nötigen Daten zu generieren.'.PHP_EOL.PHP_EOL.
- 'Alternativ finden Sie die erforderlichen Daten im Installationspaket des Moduls unter "setup+doku/geoip-data_*". '.PHP_EOL.PHP_EOL.
- 'Führen Sie die SQL-Datei(en) bitte in Ihrer Datenbank aus.',
-);
+
+ * @link http://www.oxidmodule.com
+ */
+
+$sLangName = 'Deutsch';
+$iLangNr = 0;
+// -------------------------------
+// RESOURCE IDENTITFIER = STRING
+// -------------------------------
+$aLang = array(
+ 'charset' => 'UTF-8',
+ 'd3mxgeoip' => " GeoIP",
+ 'd3mxgeoip_settings' => 'Einstellungen',
+ 'd3tbclgeoip_settings_main' => 'Grundeinstellungen',
+ 'tbclcountry_geoip' => 'GeoIP-Kundenumleitungen',
+
+ 'D3_GEOIP_TRANSL' => 'GeoIP-Kundenumleitungen',
+
+ 'D3_GEOIP_SET_DEBUG_DESC' => 'Mit aktiviertem Debug-Modus wird im Frontend die aktuelle '.
+ 'IP-Adresse des Shopbesuchers gezeigt. Beachten Sie, dass Umleitungen, die auf Weiterleitungen basieren, dann '.
+ 'nicht ausgeführt werden können.',
+ 'D3_GEOIP_SET_OPTIONS' => 'Optionen',
+ 'D3_GEOIP_SET_OPTIONS_CHANGESHOP' => 'Mandant wechseln, wenn eingestellt (nur EE)',
+ 'D3_GEOIP_SET_OPTIONS_CHANGECURR' => 'Währung wechseln, wenn eingestellt',
+ 'D3_GEOIP_SET_OPTIONS_CHANGELANG' => 'Sprache wechseln, wenn eingestellt',
+ 'D3_GEOIP_SET_OPTIONS_CHANGEURL' => 'URL wechseln, wenn eingestellt',
+ 'D3_GEOIP_SET_OPTIONS_NOCOUNTRY' => 'Shop verwendet die Einstellung dieses Landes, wenn IP nicht '.
+ 'zuzuordnen ist',
+ 'D3_GEOIP_SET_IP' => 'IP-Einstellungen',
+ 'D3_GEOIP_SET_IP_TESTIP' => 'statt Kunden-IP immer diese IP-Adresse verwenden',
+ 'D3_GEOIP_SET_IP_TESTCOUNTRY' => 'statt Kunden-IP immer eine IP-Adresse dieses Landes verwenden',
+ 'D3_GEOIP_SET_IP_TESTCOUNTRY_INACTIVE' => '(inaktiv)',
+ 'D3_GEOIP_SET_IP_CHECKIP' => 'diese IP-Adresse prüfen',
+ 'D3_GEOIP_SET_IP_CHECKIP_NOTSET' => 'IP nicht zugewiesen oder Land nicht aktiv',
+ 'D3_GENERAL_GEOIP_SAVE' => 'Speichern',
+
+ 'D3_GEOIP_SELSHOP' => 'zuständiger Shop',
+ 'D3_GEOIP_SELLANG' => 'vorgewählte Sprache',
+ 'D3_GEOIP_SELCUR' => 'vorgewählte Währung',
+ 'D3_GEOIP_CUSTSELSHOP' => ' - vom Kunden gewählter Shop - ',
+ 'D3_GEOIP_CUSTSELLANG' => ' - vom Kunden gewählte Sprache - ',
+ 'D3_GEOIP_CUSTSELCUR' => ' - vom Kunden gewählte Währung - ',
+ 'D3_GEOIP_OR' => 'oder',
+ 'D3_GEOIP_DISABLED' => '(deaktiviert)',
+ 'D3_GEOIP_SELURL' => 'zu wechselnde URL',
+ 'D3_GEOIP_SELURL_DESC' => 'Sobald im URL-Feld eine Eingabe vorhanden ist, wird bei '.
+ 'passenden Kunden versucht, zur hinterlegten URL zu wechseln. Möchten Sie den Mandanten, die Währung und / '.
+ 'oder die Sprache einstellen, entfernen Sie die URL.
Aktivieren / deaktivieren Sie den URL-Wechsel '.
+ 'zusätzlich in den Modul-Grundeinstellungen.',
+
+ 'D3_GEOIP_METADATA_TITLE' => 'D³ GeoIP Vorauswahl',
+ 'D3_GEOIP_METADATA_DESC' => 'Begrüßen Sie Ihre Kunden in seiner Landessprache.',
+
+ 'D3_GEOIP_UPDATE_ITEMINSTALL' => 'Die umfangreiche IP-Liste kann leider nicht über die '.
+ 'automatische Installation eingebunden werden. Bitte installieren Sie diese manuell. '.PHP_EOL.PHP_EOL.
+ 'Laden Sie bitte die aktuellen CSV-Daten des Anbieters Maxmind. In "setup+doku/importCSVtoMySQL" des Modulpaketes finden Sie weitere Informationen und die erforderlichen Datenbank-Befehle, um die nötigen Daten zu generieren.'.PHP_EOL.PHP_EOL.
+ 'Alternativ finden Sie die erforderlichen Daten im Installationspaket des Moduls unter "setup+doku/geoip-data_*". '.PHP_EOL.PHP_EOL.
+ 'Führen Sie die SQL-Datei(en) bitte in Ihrer Datenbank aus.',
+);
diff --git a/copy_this/modules/d3/d3geoip/views/admin/tpl/d3_cfg_geoipset_main.tpl b/copy_this/modules/d3/geoip/Application/views/admin/tpl/d3_cfg_geoipset_main.tpl
similarity index 100%
rename from copy_this/modules/d3/d3geoip/views/admin/tpl/d3_cfg_geoipset_main.tpl
rename to copy_this/modules/d3/geoip/Application/views/admin/tpl/d3_cfg_geoipset_main.tpl
diff --git a/copy_this/modules/d3/d3geoip/views/admin/tpl/d3_country_geoip.tpl b/copy_this/modules/d3/geoip/Application/views/admin/tpl/d3_country_geoip.tpl
similarity index 98%
rename from copy_this/modules/d3/d3geoip/views/admin/tpl/d3_country_geoip.tpl
rename to copy_this/modules/d3/geoip/Application/views/admin/tpl/d3_country_geoip.tpl
index 4ea0608..e3c4f4f 100644
--- a/copy_this/modules/d3/d3geoip/views/admin/tpl/d3_country_geoip.tpl
+++ b/copy_this/modules/d3/geoip/Application/views/admin/tpl/d3_country_geoip.tpl
@@ -1,118 +1,118 @@
-[{include file="headitem.tpl" title="GENERAL_ADMIN_TITLE"|oxmultilangassign}]
-
-
-
-[{if $readonly}]
- [{assign var="readonly" value="readonly disabled"}]
-[{else}]
- [{assign var="readonly" value=""}]
-[{/if}]
-
-