code syntax improved

This commit is contained in:
Daniel Seifert 2015-06-23 09:29:07 +00:00
parent 475405dbb8
commit 177b6ebce6
13 changed files with 287 additions and 287 deletions

2
.gitattributes vendored
View File

@ -1,12 +1,12 @@
* text=auto !eol * text=auto !eol
/Doxyfile -text /Doxyfile -text
copy_this/.noencode -text copy_this/.noencode -text
copy_this/modules/d3/d3geoip/IntelliSenseHelper.php -text
copy_this/modules/d3/d3geoip/controllers/admin/d3_cfg_geoipset.php -text copy_this/modules/d3/d3geoip/controllers/admin/d3_cfg_geoipset.php -text
copy_this/modules/d3/d3geoip/controllers/admin/d3_cfg_geoipset_licence.php -text copy_this/modules/d3/d3geoip/controllers/admin/d3_cfg_geoipset_licence.php -text
copy_this/modules/d3/d3geoip/controllers/admin/d3_cfg_geoipset_list.php -text copy_this/modules/d3/d3geoip/controllers/admin/d3_cfg_geoipset_list.php -text
copy_this/modules/d3/d3geoip/controllers/admin/d3_cfg_geoipset_main.php -text copy_this/modules/d3/d3geoip/controllers/admin/d3_cfg_geoipset_main.php -text
copy_this/modules/d3/d3geoip/controllers/admin/d3_country_geoip.php -text copy_this/modules/d3/d3geoip/controllers/admin/d3_country_geoip.php -text
copy_this/modules/d3/d3geoip/d3_geoip_stub.php -text
copy_this/modules/d3/d3geoip/menu.xml -text copy_this/modules/d3/d3geoip/menu.xml -text
copy_this/modules/d3/d3geoip/metadata.php -text copy_this/modules/d3/d3geoip/metadata.php -text
copy_this/modules/d3/d3geoip/models/d3geoip.php -text copy_this/modules/d3/d3geoip/models/d3geoip.php -text

View File

@ -18,7 +18,7 @@ class d3_cfg_geoipset_main extends d3_cfg_mod_main
{ {
protected $_sModId = 'd3_geoip'; protected $_sModId = 'd3_geoip';
protected $_sThisTemplate = "d3_cfg_geoipset_main.tpl"; protected $_sThisTemplate = "d3_cfg_geoipset_main.tpl";
protected $_blHasDebugSwitch = TRUE; protected $_blHasDebugSwitch = true;
protected $_sDebugHelpTextIdent = 'D3_GEOIP_SET_DEBUG_DESC'; protected $_sDebugHelpTextIdent = 'D3_GEOIP_SET_DEBUG_DESC';
/** /**
@ -33,12 +33,9 @@ class d3_cfg_geoipset_main extends d3_cfg_mod_main
$oD3GeoIP = oxNew('d3geoip'); $oD3GeoIP = oxNew('d3geoip');
$oCountry = $oD3GeoIP->getUserLocationCountryObject($sIP); $oCountry = $oD3GeoIP->getUserLocationCountryObject($sIP);
if ($oCountry->getId()) if ($oCountry->getId()) {
{
$sTitle = $oCountry->getFieldData('oxtitle'); $sTitle = $oCountry->getFieldData('oxtitle');
} } else {
else
{
$sTitle = oxRegistry::getLang()->translateString('D3_GEOIP_SET_IP_CHECKIP_NOTSET'); $sTitle = oxRegistry::getLang()->translateString('D3_GEOIP_SET_IP_CHECKIP_NOTSET');
} }
@ -79,7 +76,9 @@ class d3_cfg_geoipset_main extends d3_cfg_mod_main
$oCountryList = oxNew('oxcountrylist'); $oCountryList = oxNew('oxcountrylist');
$oListObject = $oCountryList->getBaseObject(); $oListObject = $oCountryList->getBaseObject();
$sFieldList = $oListObject->getSelectFields(); $sFieldList = $oListObject->getSelectFields();
$sQ = "select (SELECT d3startip FROM ".$oGeoIp->getViewName()." WHERE D3ISO = " .$oListObject->getViewName(). ".oxisoalpha2 LIMIT 1) as IP, $sFieldList from " . $oListObject->getViewName(); $sQ = "select (SELECT d3startip FROM ".$oGeoIp->getViewName().
" WHERE D3ISO = " .$oListObject->getViewName(). ".
oxisoalpha2 LIMIT 1) as IP, $sFieldList from " . $oListObject->getViewName();
$oCountryList->selectString($sQ); $oCountryList->selectString($sQ);

View File

@ -31,9 +31,8 @@ class d3_country_geoip extends oxAdminView
*/ */
public function render() public function render()
{ {
if ( !oxRegistry::getConfig()->getConfigParam( 'blAllowSharedEdit' ) ) if (false == oxRegistry::getConfig()->getConfigParam('blAllowSharedEdit')) {
{ $this->addTplParam('readonly', true);
$this->addTplParam('readonly', TRUE);
} }
$ret = parent::render(); $ret = parent::render();
@ -41,59 +40,49 @@ class d3_country_geoip extends oxAdminView
$soxId = oxRegistry::getConfig()->getRequestParameter("oxid"); $soxId = oxRegistry::getConfig()->getRequestParameter("oxid");
// check if we right now saved a new entry // check if we right now saved a new entry
$sSavedID = oxRegistry::getConfig()->getRequestParameter("saved_oxid"); $sSavedID = oxRegistry::getConfig()->getRequestParameter("saved_oxid");
if ( ($soxId == "-1" || !isset( $soxId)) && isset( $sSavedID) ) if (($soxId == "-1" || !isset($soxId)) && isset($sSavedID)) {
{
$soxId = $sSavedID; $soxId = $sSavedID;
oxRegistry::getSession()->deleteVariable("saved_oxid"); oxRegistry::getSession()->deleteVariable("saved_oxid");
$this->addTplParam("oxid",$soxId); $this->addTplParam("oxid", $soxId);
// for reloading upper frame // for reloading upper frame
$this->addTplParam("updatelist", "1"); $this->addTplParam("updatelist", "1");
} }
if ( $soxId != "-1" && isset( $soxId)) if ($soxId != "-1" && isset($soxId)) {
{
// load object // load object
/** @var $oCountry oxcountry */ /** @var $oCountry oxcountry */
$oCountry = oxNew( "oxcountry" ); $oCountry = oxNew("oxcountry");
$oCountry->loadInLang( $this->_iEditLang, $soxId ); $oCountry->loadInLang($this->_iEditLang, $soxId);
if ($oCountry->isForeignCountry()) if ($oCountry->isForeignCountry()) {
{ $this->addTplParam("blForeignCountry", true);
$this->addTplParam("blForeignCountry", TRUE); } else {
} $this->addTplParam("blForeignCountry", false);
else
{
$this->addTplParam("blForeignCountry", FALSE);
} }
$oOtherLang = $oCountry->getAvailableInLangs(); $oOtherLang = $oCountry->getAvailableInLangs();
if (!isset($oOtherLang[$this->_iEditLang])) if (!isset($oOtherLang[$this->_iEditLang])) {
{ $oCountry->loadInLang(key($oOtherLang), $soxId);
$oCountry->loadInLang( key($oOtherLang), $soxId );
} }
$this->oCountry = $oCountry; $this->oCountry = $oCountry;
$this->addTplParam("edit", $oCountry); $this->addTplParam("edit", $oCountry);
// remove already created languages // remove already created languages
$aLang = array_diff (oxRegistry::getLang()->getLanguageNames(), $oOtherLang ); $aLang = array_diff(oxRegistry::getLang()->getLanguageNames(), $oOtherLang);
if ( count( $aLang)) if (count($aLang)) {
{
$this->addTplParam("posslang", $aLang); $this->addTplParam("posslang", $aLang);
} }
foreach ( $oOtherLang as $id => $language) foreach ($oOtherLang as $id => $language) {
{
$oLang= new stdClass(); $oLang= new stdClass();
$oLang->sLangDesc = $language; $oLang->sLangDesc = $language;
$oLang->selected = ($id == $this->_iEditLang); $oLang->selected = ($id == $this->_iEditLang);
$this->_aViewData["otherlang"][$id] = clone $oLang; $this->_aViewData["otherlang"][$id] = clone $oLang;
} }
} } else {
else $this->addTplParam("blForeignCountry", true);
{
$this->addTplParam("blForeignCountry", TRUE);
} }
$this->oShopList = oxNew('oxshoplist'); $this->oShopList = oxNew('oxshoplist');
@ -128,38 +117,33 @@ class d3_country_geoip extends oxAdminView
public function save() public function save()
{ {
//allow malladmin only to perform this action //allow malladmin only to perform this action
if ( !oxRegistry::getConfig()->getConfigParam( 'blAllowSharedEdit' ) ) if (false == oxRegistry::getConfig()->getConfigParam('blAllowSharedEdit')) {
{
return; return;
} }
$soxId = oxRegistry::getConfig()->getRequestParameter("oxid"); $soxId = oxRegistry::getConfig()->getRequestParameter("oxid");
$aParams = oxRegistry::getConfig()->getRequestParameter("editval" ); $aParams = oxRegistry::getConfig()->getRequestParameter("editval");
/** @var $oCountry oxcountry */ /** @var $oCountry oxcountry */
$oCountry = oxNew( "oxcountry" ); $oCountry = oxNew("oxcountry");
if ( $soxId != "-1") if ($soxId != "-1") {
{ $oCountry->loadInLang($this->_iEditLang, $soxId);
$oCountry->loadInLang( $this->_iEditLang, $soxId ); } else {
} $aParams['oxcountry__oxid'] = null;
else
{
$aParams['oxcountry__oxid'] = NULL;
} }
$oCountry->setLanguage(0); $oCountry->setLanguage(0);
$oCountry->assign( $aParams ); $oCountry->assign($aParams);
$oCountry->setLanguage($this->_iEditLang); $oCountry->setLanguage($this->_iEditLang);
$oCountry = oxRegistry::get('oxUtilsFile')->processFiles( $oCountry ); $oCountry = oxRegistry::get('oxUtilsFile')->processFiles($oCountry);
$oCountry->save(); $oCountry->save();
$this->addTplParam("updatelist", "1"); $this->addTplParam("updatelist", "1");
// set oxid if inserted // set oxid if inserted
if ( $soxId == "-1") if ($soxId == "-1") {
{ oxRegistry::getSession()->setVariable("saved_oxid", $oCountry->getId());
oxRegistry::getSession()->setVariable( "saved_oxid", $oCountry->getId());
} }
} }
@ -178,23 +162,19 @@ class d3_country_geoip extends oxAdminView
{ {
$aCurrencies = array(); $aCurrencies = array();
if ($this->getModCfgValue('blChangeShop') && $this->oCountry->getFieldData('d3geoipshop')) if ($this->getModCfgValue('blChangeShop') && $this->oCountry->getFieldData('d3geoipshop')) {
{
$sShopId = $this->oCountry->getFieldData('d3geoipshop'); $sShopId = $this->oCountry->getFieldData('d3geoipshop');
} } else {
else
{
$sShopId = oxRegistry::getConfig()->getActiveView()->getViewConfig()->getActiveShopId(); $sShopId = oxRegistry::getConfig()->getActiveView()->getViewConfig()->getActiveShopId();
} }
$sQ = "select DECODE( oxvarvalue, '".$this->getConfig()->getConfigParam( 'sConfigKey' )."') as oxvarvalue from oxconfig where oxshopid = '".$sShopId."' AND oxvarname = 'aCurrencies'"; $sQ = "select DECODE( oxvarvalue, '".oxRegistry::getConfig()->getConfigParam('sConfigKey').
"') as oxvarvalue from oxconfig where oxshopid = '".$sShopId."' AND oxvarname = 'aCurrencies'";
$sCurs = oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->getOne($sQ); $sCurs = oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->getOne($sQ);
if ($sCurs) if ($sCurs) {
{ foreach (unserialize($sCurs) as $sKey => $sValue) {
foreach (unserialize($sCurs) as $sKey => $sValue)
{
$aFields = explode('@', $sValue); $aFields = explode('@', $sValue);
$aCurrencies[$sKey]->id = $sKey; $aCurrencies[$sKey]->id = $sKey;
$aCurrencies[$sKey]->name = $aFields[0]; $aCurrencies[$sKey]->name = $aFields[0];
@ -211,12 +191,9 @@ class d3_country_geoip extends oxAdminView
*/ */
public function getLangList() public function getLangList()
{ {
if ($this->getModCfgValue('blChangeShop') && $this->oCountry->getFieldData('d3geoipshop')) if ($this->getModCfgValue('blChangeShop') && $this->oCountry->getFieldData('d3geoipshop')) {
{
$sShopId = $this->oCountry->getFieldData('d3geoipshop'); $sShopId = $this->oCountry->getFieldData('d3geoipshop');
} } else {
else
{
$sShopId = oxRegistry::getConfig()->getActiveView()->getViewConfig()->getActiveShopId(); $sShopId = oxRegistry::getConfig()->getActiveView()->getViewConfig()->getActiveShopId();
} }
@ -224,60 +201,50 @@ class d3_country_geoip extends oxAdminView
$aLangParams = oxRegistry::getConfig()->getShopConfVar('aLanguageParams', $sShopId); $aLangParams = oxRegistry::getConfig()->getShopConfVar('aLanguageParams', $sShopId);
$aConfLanguages = oxRegistry::getConfig()->getShopConfVar('aLanguages', $sShopId); $aConfLanguages = oxRegistry::getConfig()->getShopConfVar('aLanguages', $sShopId);
if ( is_array( $aConfLanguages ) ) if (is_array($aConfLanguages)) {
{
$i = 0; $i = 0;
reset( $aConfLanguages ); reset($aConfLanguages);
while ( list( $key, $val ) = each( $aConfLanguages ) ) while ((list($key, $val) = each($aConfLanguages))) {
{ if (is_array($aLangParams)) {
if (is_array($aLangParams) )
{
//skipping non active languages //skipping non active languages
if ( !$aLangParams[$key]['active'] ) if (false == $aLangParams[$key]['active']) {
{
$i++; $i++;
continue; continue;
} }
} }
if ( $val) if ($val) {
{
$oLang = new stdClass(); $oLang = new stdClass();
if ( isset($aLangParams[$key]['baseId']) ) if (isset($aLangParams[$key]['baseId'])) {
{
$oLang->id = $aLangParams[$key]['baseId']; $oLang->id = $aLangParams[$key]['baseId'];
} } else {
else
{
$oLang->id = $i; $oLang->id = $i;
} }
$oLang->oxid = $key; $oLang->oxid = $key;
$oLang->abbr = $key; $oLang->abbr = $key;
$oLang->name = $val; $oLang->name = $val;
if ( is_array($aLangParams) ) if (is_array($aLangParams)) {
{
$oLang->active = $aLangParams[$key]['active']; $oLang->active = $aLangParams[$key]['active'];
$oLang->sort = $aLangParams[$key]['sort']; $oLang->sort = $aLangParams[$key]['sort'];
} }
if ( isset( $iLanguage ) && $oLang->id == $iLanguage ) if (isset($iLanguage) && $oLang->id == $iLanguage) {
{
$oLang->selected = 1; $oLang->selected = 1;
} } else {
else
{
$oLang->selected = 0; $oLang->selected = 0;
} }
if ($oLang->active)
if ($oLang->active) {
$aLanguages[$oLang->id] = $oLang; $aLanguages[$oLang->id] = $oLang;
}
} }
++$i; ++$i;
} }
} }
if (is_array($aLangParams) ) { if (is_array($aLangParams)) {
uasort( $aLanguages, array($this, '_sortLanguagesCallback') ); uasort($aLanguages, array($this, '_sortLanguagesCallback'));
} }
return $aLanguages; return $aLanguages;
@ -288,20 +255,16 @@ class d3_country_geoip extends oxAdminView
* @param $oLang2 * @param $oLang2
* @return int * @return int
*/ */
protected function _sortLanguagesCallback( $oLang1, $oLang2 ) protected function _sortLanguagesCallback($oLang1, $oLang2)
{ {
$sSortParam = $this->_sDefSort; $sSortParam = $this->_sDefSort;
$sVal1 = is_string($oLang1->$sSortParam) ? strtolower( $oLang1->$sSortParam ) : $oLang1->$sSortParam; $sVal1 = is_string($oLang1->$sSortParam) ? strtolower($oLang1->$sSortParam) : $oLang1->$sSortParam;
$sVal2 = is_string($oLang2->$sSortParam) ? strtolower( $oLang2->$sSortParam ) : $oLang2->$sSortParam; $sVal2 = is_string($oLang2->$sSortParam) ? strtolower($oLang2->$sSortParam) : $oLang2->$sSortParam;
if ( $this->_sDefSortOrder == 'asc' ) if ($this->_sDefSortOrder == 'asc') {
{
return ($sVal1 < $sVal2) ? -1 : 1; return ($sVal1 < $sVal2) ? -1 : 1;
} } else {
else
{
return ($sVal1 > $sVal2) ? -1 : 1; return ($sVal1 > $sVal2) ? -1 : 1;
} }
} }
} }

View File

@ -39,12 +39,10 @@ class d3GeoIP extends oxbase
*/ */
public function getUserLocationCountryObject($sIP = null) public function getUserLocationCountryObject($sIP = null)
{ {
if (!$this->oCountry) if (!$this->oCountry) {
{
startProfile(__METHOD__); startProfile(__METHOD__);
if (!$sIP) if (!$sIP) {
{
$sIP = $this->getIP(); $sIP = $this->getIP();
} }
@ -56,14 +54,25 @@ class d3GeoIP extends oxbase
$sISOAlpha = $this->loadByIPNum($iIPNum); $sISOAlpha = $this->loadByIPNum($iIPNum);
if (!$sISOAlpha) if (!$sISOAlpha) {
{ $this->_getLog()->log(
$this->_getLog()->log(d3log::ERROR, __CLASS__, __FUNCTION__, __LINE__, 'get ISO by IP failed', $sIP); d3log::ERROR,
__CLASS__,
__FUNCTION__,
__LINE__,
'get ISO by IP failed',
$sIP
);
$this->oCountry = $this->getCountryFallBackObject(); $this->oCountry = $this->getCountryFallBackObject();
} } else {
else $this->_getLog()->log(
{ d3log::INFO,
$this->_getLog()->log(d3log::INFO, __CLASS__, __FUNCTION__, __LINE__, 'get ISO by IP', $sIP." => ".$sISOAlpha); __CLASS__,
__FUNCTION__,
__LINE__,
'get ISO by IP',
$sIP." => ".$sISOAlpha
);
$this->oCountry = $this->getCountryObject($sISOAlpha); $this->oCountry = $this->getCountryObject($sISOAlpha);
} }
@ -82,16 +91,15 @@ class d3GeoIP extends oxbase
{ {
startProfile(__METHOD__); startProfile(__METHOD__);
if ($this->_getModConfig()->getValue('blUseTestIp') && $this->_getModConfig()->getValue('sTestIp')) if ($this->_getModConfig()->getValue('blUseTestIp')
{ && $this->_getModConfig()->getValue('sTestIp')
) {
$sIP = $this->_getModConfig()->getValue('sTestIp'); $sIP = $this->_getModConfig()->getValue('sTestIp');
} } elseif ($this->_getModConfig()->getValue('blUseTestCountry')
elseif ($this->_getModConfig()->getValue('blUseTestCountry') && $this->_getModConfig()->getValue('sTestCountryIp')) && $this->_getModConfig()->getValue('sTestCountryIp')
{ ) {
$sIP = $this->_getModConfig()->getValue('sTestCountryIp'); $sIP = $this->_getModConfig()->getValue('sTestCountryIp');
} } else {
else
{
// ToDo: use $_SERVER['X-Forwared-For'] && Client-IP in case of proxy // ToDo: use $_SERVER['X-Forwared-For'] && Client-IP in case of proxy
$sIP = $_SERVER['REMOTE_ADDR']; $sIP = $_SERVER['REMOTE_ADDR'];
} }
@ -110,33 +118,30 @@ class d3GeoIP extends oxbase
protected function _getNumIp($sIP) protected function _getNumIp($sIP)
{ {
// make sure it is an ip // make sure it is an ip
if (filter_var($sIP, FILTER_VALIDATE_IP) === FALSE) if (filter_var($sIP, FILTER_VALIDATE_IP) === false) {
return FALSE; return false;
}
startProfile(__METHOD__); startProfile(__METHOD__);
$parts = unpack('N*', inet_pton($sIP)); $parts = unpack('N*', inet_pton($sIP));
if (strpos($sIP, '.') !== FALSE) if (strpos($sIP, '.') !== false) {
{
$parts = array(1=>0, 2=>0, 3=>0, 4=>$parts[1]); $parts = array(1=>0, 2=>0, 3=>0, 4=>$parts[1]);
} }
foreach ($parts as &$part) foreach ($parts as &$part) {
{ if ($part < 0) {
if ($part < 0)
$part += 4294967296; $part += 4294967296;
}
} }
if (function_exists('bcadd')) if (function_exists('bcadd')) {
{
$dIP = $parts[4]; $dIP = $parts[4];
$dIP = bcadd($dIP, bcmul($parts[3], '4294967296')); $dIP = bcadd($dIP, bcmul($parts[3], '4294967296'));
$dIP = bcadd($dIP, bcmul($parts[2], '18446744073709551616')); $dIP = bcadd($dIP, bcmul($parts[2], '18446744073709551616'));
$dIP = bcadd($dIP, bcmul($parts[1], '79228162514264337593543950336')); $dIP = bcadd($dIP, bcmul($parts[1], '79228162514264337593543950336'));
} } else {
else
{
throw new Exception('extension BCMath is required'); throw new Exception('extension BCMath is required');
} }
@ -153,7 +158,7 @@ class d3GeoIP extends oxbase
* @param int $iIPNum IP number * @param int $iIPNum IP number
* @return string * @return string
*/ */
public function LoadByIPNum($iIPNum) public function loadByIPNum($iIPNum)
{ {
startProfile(__METHOD__); startProfile(__METHOD__);
@ -176,7 +181,8 @@ class d3GeoIP extends oxbase
startProfile(__METHOD__); startProfile(__METHOD__);
$oCountry = oxNew('oxcountry'); $oCountry = oxNew('oxcountry');
$sSelect = "SELECT oxid FROM ".$oCountry->getViewName()." WHERE OXISOALPHA2 = '".$sISOAlpha."' AND OXACTIVE = '1'"; $sSelect = "SELECT oxid FROM ".$oCountry->getViewName().
" WHERE OXISOALPHA2 = '".$sISOAlpha."' AND OXACTIVE = '1'";
$oCountry->load(oxDb::getDb()->getOne($sSelect)); $oCountry->load(oxDb::getDb()->getOne($sSelect));
@ -196,8 +202,9 @@ class d3GeoIP extends oxbase
$oCountry = oxNew('oxcountry'); $oCountry = oxNew('oxcountry');
if ($this->_getModConfig()->getValue('blUseFallback') && $this->_getModConfig()->getValue('sFallbackCountryId')) if ($this->_getModConfig()->getValue('blUseFallback')
{ && $this->_getModConfig()->getValue('sFallbackCountryId')
) {
$oCountry->Load($this->_getModConfig()->getValue('sFallbackCountryId')); $oCountry->Load($this->_getModConfig()->getValue('sFallbackCountryId'));
} }
@ -217,17 +224,27 @@ class d3GeoIP extends oxbase
$this->performURLSwitch(); $this->performURLSwitch();
$this->performShopSwitch(); $this->performShopSwitch();
if (!$this->_getModConfig()->isActive() || !$this->_getModConfig()->getValue('blChangeLang')) if (!$this->_getModConfig()->isActive()
{ || false == $this->_getModConfig()->getValue('blChangeLang')) {
stopProfile(__METHOD__); stopProfile(__METHOD__);
return; return;
} }
$oCountry = $this->getUserLocationCountryObject(); $oCountry = $this->getUserLocationCountryObject();
if (!$this->isAdmin() && oxRegistry::getUtils()->isSearchEngine() === false && oxRegistry::getSession()->getVariable('d3isSetLang') === null && $oCountry->getId() && $oCountry->getFieldData('d3geoiplang') > -1) if (!$this->isAdmin()
{ && oxRegistry::getUtils()->isSearchEngine() === false
$this->_getLog()->log(d3log::INFO, __CLASS__, __FUNCTION__, __LINE__, 'set language', $this->getIP().' => '.$oCountry->getFieldData('d3geoiplang')); && oxRegistry::getSession()->getVariable('d3isSetLang') === null
&& $oCountry->getId() && $oCountry->getFieldData('d3geoiplang') > -1
) {
$this->_getLog()->log(
d3log::INFO,
__CLASS__,
__FUNCTION__,
__LINE__,
'set language',
$this->getIP().' => '.$oCountry->getFieldData('d3geoiplang')
);
oxRegistry::getLang()->setTplLanguage((int) $oCountry->getFieldData('d3geoiplang')); oxRegistry::getLang()->setTplLanguage((int) $oCountry->getFieldData('d3geoiplang'));
oxRegistry::getLang()->setBaseLanguage((int) $oCountry->getFieldData('d3geoiplang')); oxRegistry::getLang()->setBaseLanguage((int) $oCountry->getFieldData('d3geoiplang'));
oxRegistry::getSession()->setVariable('d3isSetLang', true); oxRegistry::getSession()->setVariable('d3isSetLang', true);
@ -242,16 +259,30 @@ class d3GeoIP extends oxbase
*/ */
public function setCountryCurrency() public function setCountryCurrency()
{ {
if (!$this->_getModConfig()->isActive() || !$this->_getModConfig()->getValue('blChangeCurr')) if (!$this->_getModConfig()->isActive()
|| false == $this->_getModConfig()->getValue('blChangeCurr')
) {
return; return;
}
startProfile(__METHOD__); startProfile(__METHOD__);
$oCountry = $this->getUserLocationCountryObject(); $oCountry = $this->getUserLocationCountryObject();
if (!$this->isAdmin() && oxRegistry::getUtils()->isSearchEngine() === false && !oxRegistry::getSession()->getVariable('d3isSetCurr') && $oCountry->getId() && $oCountry->getFieldData('d3geoipcur') > -1) if (!$this->isAdmin()
{ && oxRegistry::getUtils()->isSearchEngine() === false
$this->_getLog()->log(d3log::INFO, __CLASS__, __FUNCTION__, __LINE__, 'set currency', $this->getIP().' => '.$oCountry->getFieldData('d3geoipcur')); && !oxRegistry::getSession()->getVariable('d3isSetCurr')
&& $oCountry->getId()
&& $oCountry->getFieldData('d3geoipcur') > -1
) {
$this->_getLog()->log(
d3log::INFO,
__CLASS__,
__FUNCTION__,
__LINE__,
'set currency',
$this->getIP().' => '.$oCountry->getFieldData('d3geoipcur')
);
oxRegistry::getConfig()->setActShopCurrency((int) $oCountry->getFieldData('d3geoipcur')); oxRegistry::getConfig()->setActShopCurrency((int) $oCountry->getFieldData('d3geoipcur'));
oxRegistry::getSession()->setVariable('d3isSetCurr', true); oxRegistry::getSession()->setVariable('d3isSetCurr', true);
} }
@ -265,40 +296,38 @@ class d3GeoIP extends oxbase
*/ */
public function performShopSwitch() public function performShopSwitch()
{ {
if (!$this->_getModConfig()->isActive() || !$this->_getModConfig()->getValue('blChangeShop')) if (!$this->_getModConfig()->isActive() || !$this->_getModConfig()->getValue('blChangeShop')) {
return; return;
}
startProfile(__METHOD__); startProfile(__METHOD__);
$oCountry = $this->getUserLocationCountryObject(); $oCountry = $this->getUserLocationCountryObject();
$iNewShop = $oCountry->getFieldData('d3geoipshop'); $iNewShop = $oCountry->getFieldData('d3geoipshop');
if (oxRegistry::getConfig()->getRequestParameter('d3redirect') != 1 && if (oxRegistry::getConfig()->getRequestParameter('d3redirect') != 1
!$this->isAdmin() && && false == $this->isAdmin()
oxRegistry::getUtils()->isSearchEngine() === false && && oxRegistry::getUtils()->isSearchEngine() === false
$oCountry->getId() && && $oCountry->getId()
$this->getConfig()->isMall() && && $this->getConfig()->isMall()
$iNewShop > -1 && && $iNewShop > -1 &&
( (
$iNewShop != $this->getConfig()->getShopId() || $iNewShop != $this->getConfig()->getShopId()
strtolower($this->getConfig()->getActiveView()->getClassName()) == 'mallstart' || strtolower($this->getConfig()->getActiveView()->getClassName()) == 'mallstart'
) )
) ) {
{
$oNewConf = new oxConfig(); $oNewConf = new oxConfig();
$oNewConf->setShopId($iNewShop); $oNewConf->setShopId($iNewShop);
$oNewConf->init(); $oNewConf->init();
$this->getConfig()->onShopChange(); $this->getConfig()->onShopChange();
if (!oxRegistry::getSession()->getVariable('d3isSetLang') && if (!oxRegistry::getSession()->getVariable('d3isSetLang')
$this->_getModConfig()->getValue('blChangeLang') && && $this->_getModConfig()->getValue('blChangeLang')
$oCountry->getFieldData('d3geoiplang') > -1) && $oCountry->getFieldData('d3geoiplang') > -1
{ ) {
$sLangId = $oCountry->getFieldData('d3geoiplang'); $sLangId = $oCountry->getFieldData('d3geoiplang');
} } else {
else
{
$sLangId = ''; $sLangId = '';
} }
@ -309,9 +338,20 @@ class d3GeoIP extends oxbase
'fnc' => oxRegistry::getConfig()->getRequestParameter('fnc'), 'fnc' => oxRegistry::getConfig()->getRequestParameter('fnc'),
'shp' => $iNewShop 'shp' => $iNewShop
); );
$sUrl = str_replace('&amp;', '&', $oStr->generateParameterUrl($oNewConf->getShopHomeUrl($sLangId), $aParams)); $sUrl = str_replace(
'&amp;',
'&',
$oStr->generateParameterUrl($oNewConf->getShopHomeUrl($sLangId), $aParams)
);
$this->_getLog()->log(d3log::INFO, __CLASS__, __FUNCTION__, __LINE__, 'change shop', $this->getIP().' => '.$sUrl); $this->_getLog()->log(
d3log::INFO,
__CLASS__,
__FUNCTION__,
__LINE__,
'change shop',
$this->getIP().' => '.$sUrl
);
header("Location: ".$sUrl); header("Location: ".$sUrl);
exit(); exit();
@ -326,8 +366,8 @@ class d3GeoIP extends oxbase
*/ */
public function performURLSwitch() public function performURLSwitch()
{ {
if (!$this->_getModConfig()->isActive() || !$this->_getModConfig()->getValue('blChangeURL')) if (!$this->_getModConfig()->isActive()
{ || false == $this->_getModConfig()->getValue('blChangeURL')) {
return; return;
} }
@ -335,16 +375,22 @@ class d3GeoIP extends oxbase
$oCountry = $this->getUserLocationCountryObject(); $oCountry = $this->getUserLocationCountryObject();
if (!$this->isAdmin() && if (false == $this->isAdmin()
oxRegistry::getUtils()->isSearchEngine() === false && && oxRegistry::getUtils()->isSearchEngine() === false
$oCountry->getId() && && $oCountry->getId()
$oCountry->getFieldData('d3geoipurl') && && $oCountry->getFieldData('d3geoipurl')
strlen(trim($oCountry->getFieldData('d3geoipurl'))) > 0 && strlen(trim($oCountry->getFieldData('d3geoipurl'))) > 0
) ) {
{
$sNewUrl = $oCountry->getFieldData('d3geoipurl'); $sNewUrl = $oCountry->getFieldData('d3geoipurl');
$this->_getLog()->log(d3log::INFO, __CLASS__, __FUNCTION__, __LINE__, 'change url', $this->getIP().' => '.$oCountry->getFieldData('d3geoipurl')); $this->_getLog()->log(
d3log::INFO,
__CLASS__,
__FUNCTION__,
__LINE__,
'change url',
$this->getIP().' => '.$oCountry->getFieldData('d3geoipurl')
);
header("Location: ".$sNewUrl); header("Location: ".$sNewUrl);
exit(); exit();
@ -362,12 +408,12 @@ class d3GeoIP extends oxbase
{ {
startProfile(__METHOD__); startProfile(__METHOD__);
$oShoplist = oxNew( 'oxshoplist' ); $oShoplist = oxNew('oxshoplist');
$oShoplist->getList(); $oShoplist->getList();
$aShopUrls = array(); $aShopUrls = array();
foreach ( $oShoplist as $sId => $oShop )
{ foreach (array_keys($oShoplist) as $sId) {
$aShopUrls[$sId] = $this->getConfig()->getShopConfVar( 'sMallShopURL', $sId ); $aShopUrls[$sId] = $this->getConfig()->getShopConfVar('sMallShopURL', $sId);
} }
stopProfile(__METHOD__); stopProfile(__METHOD__);
@ -392,9 +438,8 @@ class d3GeoIP extends oxbase
*/ */
protected function _getLog() protected function _getLog()
{ {
if (!$this->oD3Log) if (!$this->oD3Log) {
{ $this->oD3Log = $this->_getModConfig()->d3getLog();
$this->oD3Log = $this->_getModConfig()->getLog();
} }
return $this->oD3Log; return $this->oD3Log;

View File

@ -23,10 +23,8 @@ class d3_oxcmp_cur_geoip extends d3_oxcmp_cur_geoip_parent
*/ */
public function init() public function init()
{ {
if (d3_cfg_mod::get($this->_sModId)->isActive()) if (d3_cfg_mod::get($this->_sModId)->isActive()) {
{ if (d3_cfg_mod::get($this->_sModId)->hasDebugMode()) {
if (d3_cfg_mod::get($this->_sModId)->hasDebugMode())
{
/** @var $oGeoIp d3geoip */ /** @var $oGeoIp d3geoip */
$oGeoIp = oxNew('d3geoip'); $oGeoIp = oxNew('d3geoip');
echo $oGeoIp->getIP(); echo $oGeoIp->getIP();
@ -39,5 +37,4 @@ class d3_oxcmp_cur_geoip extends d3_oxcmp_cur_geoip_parent
return parent::init(); return parent::init();
} }
} }

View File

@ -23,8 +23,7 @@ class d3_oxcmp_lang_geoip extends d3_oxcmp_lang_geoip_parent
*/ */
public function init() public function init()
{ {
if (d3_cfg_mod::get($this->_sModId)->isActive()) if (d3_cfg_mod::get($this->_sModId)->isActive()) {
{
/** @var $oLocation d3geoip */ /** @var $oLocation d3geoip */
$oLocation = oxNew('d3geoip'); $oLocation = oxNew('d3geoip');
$oLocation->setCountryLanguage(); $oLocation->setCountryLanguage();

View File

@ -20,46 +20,44 @@ $iLangNr = 0;
// RESOURCE IDENTITFIER = STRING // RESOURCE IDENTITFIER = STRING
// ------------------------------- // -------------------------------
$aLang = array( $aLang = array(
'charset' => 'ISO-8859-15',
'd3mxgeoip' => 'GeoIP',
'd3mxgeoip_settings' => 'Einstellungen',
'd3tbclgeoip_settings_main' => 'Grundeinstellungen',
'tbclcountry_geoip' => 'GeoIP-Kundenumleitungen',
'charset' => 'ISO-8859-15', 'D3_GEOIP_TRANSL' => 'GeoIP-Kundenumleitungen',
'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_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_SELSHOP' => 'zuständiger Shop',
'D3_GEOIP_SET_OPTIONS' => 'Optionen', 'D3_GEOIP_SELLANG' => 'vorgewählte Sprache',
'D3_GEOIP_SET_OPTIONS_CHANGESHOP' => 'Mandant wechseln, wenn eingestellt (nur EE)', 'D3_GEOIP_SELCUR' => 'vorgewählte Währung',
'D3_GEOIP_SET_OPTIONS_CHANGECURR' => 'Währung wechseln, wenn eingestellt', 'D3_GEOIP_CUSTSELSHOP' => ' - vom Kunden gewählter Shop - ',
'D3_GEOIP_SET_OPTIONS_CHANGELANG' => 'Sprache wechseln, wenn eingestellt', 'D3_GEOIP_CUSTSELLANG' => ' - vom Kunden gewählte Sprache - ',
'D3_GEOIP_SET_OPTIONS_CHANGEURL' => 'URL wechseln, wenn eingestellt', 'D3_GEOIP_CUSTSELCUR' => ' - vom Kunden gewählte Währung - ',
'D3_GEOIP_SET_OPTIONS_NOCOUNTRY' => 'Shop verwendet die Einstellung dieses Landes, wenn IP nicht zuzuordnen ist', 'D3_GEOIP_OR' => 'oder',
'D3_GEOIP_SET_IP' => 'IP-Einstellungen', 'D3_GEOIP_DISABLED' => '(deaktiviert)',
'D3_GEOIP_SET_IP_TESTIP' => 'statt Kunden-IP immer diese IP-Adresse verwenden', 'D3_GEOIP_SELURL' => 'zu wechselnde URL',
'D3_GEOIP_SET_IP_TESTCOUNTRY' => 'statt Kunden-IP immer eine IP-Adresse dieses Landes verwenden', '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.<br><br>Aktivieren / deaktivieren Sie den URL-Wechsel zusätzlich in den Modul-Grundeinstellungen.',
'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_METADATA_TITLE' => 'D³ GeoIP Vorauswahl',
'D3_GEOIP_SELLANG' => 'vorgewählte Sprache', 'D3_GEOIP_METADATA_DESC' => 'Begrüßen Sie Ihre Kunden in seiner Landessprache.',
'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.<br><br>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.'Die erforderlichen Daten finden Sie im Installationspaket des Moduls unter "setup+doku/geoip-Data_IPv4_*.sql" ("setup+doku/geoip-Data_IPv6_*.sql" für IPv6-Adressen) oder als handlichere SQL-Dateien unter "setup+doku/geoip_data_parts/". '.PHP_EOL.PHP_EOL.'Sie benötigen entweder die Komplettdateien oder die Sammlung kleinerer Daten. Führen Sie die SQL-Datei(en) bitte in Ihrer Datenbank aus.',
'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.'Die erforderlichen Daten finden Sie im Installationspaket des Moduls unter "setup+doku/geoip-Data_IPv4_*.sql" ("setup+doku/geoip-Data_IPv6_*.sql" für IPv6-Adressen) oder als handlichere SQL-Dateien unter "setup+doku/geoip_data_parts/". '.PHP_EOL.PHP_EOL.'Sie benötigen entweder die Komplettdateien oder die Sammlung kleinerer Daten. Führen Sie die SQL-Datei(en) bitte in Ihrer Datenbank aus.',
); );
/* /*

View File

@ -2,9 +2,9 @@
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
[{ if $updatelist == 1}] [{if $updatelist == 1}]
UpdateList('[{ $oxid }]'); UpdateList('[{$oxid}]');
[{ /if}] [{/if}]
function UpdateList( sID) function UpdateList( sID)
{ {
@ -47,11 +47,11 @@ function showFormatSettings(sElemId, visible, blUseOldElem)
sOldSettingElem = sElemId; sOldSettingElem = sElemId;
} }
if (visible == true) if (visible == true) {
document.getElementById(sElemId).style.display = 'block'; document.getElementById(sElemId).style.display = 'block';
else } else {
document.getElementById(sElemId).style.display = 'none'; document.getElementById(sElemId).style.display = 'none';
}
} }
--> -->
@ -110,26 +110,26 @@ td.edittext {
--> -->
</style> </style>
[{ if $readonly}] [{if $readonly}]
[{assign var="readonly" value="readonly disabled"}] [{assign var="readonly" value="readonly disabled"}]
[{else}] [{else}]
[{assign var="readonly" value=""}] [{assign var="readonly" value=""}]
[{/if}] [{/if}]
<form name="transfer" id="transfer" action="[{ $oViewConf->getSelfLink() }]" method="post"> <form name="transfer" id="transfer" action="[{$oViewConf->getSelfLink()}]" method="post">
[{ $oViewConf->getHiddenSid() }] [{$oViewConf->getHiddenSid()}]
<input type="hidden" name="oxid" value="[{ $oxid }]"> <input type="hidden" name="oxid" value="[{$oxid}]">
<input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]"> <input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
<input type="hidden" name="actshop" value="[{ $shop->id }]"> <input type="hidden" name="actshop" value="[{$shop->id}]">
<input type="hidden" name="editlanguage" value="[{ $editlanguage }]"> <input type="hidden" name="editlanguage" value="[{$editlanguage}]">
</form> </form>
<form name="myedit" id="myedit" action="[{ $oViewConf->getSelfLink() }]" method="post"> <form name="myedit" id="myedit" action="[{$oViewConf->getSelfLink()}]" method="post">
[{ $oViewConf->getHiddenSid() }] [{$oViewConf->getHiddenSid()}]
<input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]"> <input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
<input type="hidden" name="fnc" value="save"> <input type="hidden" name="fnc" value="save">
<input type="hidden" name="oxid" value="[{ $oxid }]"> <input type="hidden" name="oxid" value="[{$oxid}]">
<input type="hidden" name="editval[d3_cfg_mod__oxid]" value="[{ $oxid }]"> <input type="hidden" name="editval[d3_cfg_mod__oxid]" value="[{$oxid}]">
<table border="0" width="98%"> <table border="0" width="98%">
<tr> <tr>
@ -151,7 +151,7 @@ td.edittext {
<dd> <dd>
<input type="hidden" name="value[blChangeShop]" value="0"> <input type="hidden" name="value[blChangeShop]" value="0">
<input class="edittext ext_edittext" type="checkbox" name="value[blChangeShop]" value='1' [{if $edit->getValue('blChangeShop') == 1}]checked[{/if}]> <input class="edittext ext_edittext" type="checkbox" name="value[blChangeShop]" value='1' [{if $edit->getValue('blChangeShop') == 1}]checked[{/if}]>
[{ oxinputhelp ident="D3_GEOIP_SET_OPTIONS_CHANGESHOP_DESC" }] [{oxinputhelp ident="D3_GEOIP_SET_OPTIONS_CHANGESHOP_DESC"}]
</dd> </dd>
<div class="spacer"></div> <div class="spacer"></div>
</dl> </dl>
@ -162,7 +162,7 @@ td.edittext {
<dd> <dd>
<input type="hidden" name="value[blChangeCurr]" value="0"> <input type="hidden" name="value[blChangeCurr]" value="0">
<input class="edittext ext_edittext" type="checkbox" name="value[blChangeCurr]" value='1' [{if $edit->getValue('blChangeCurr') == 1}]checked[{/if}]> <input class="edittext ext_edittext" type="checkbox" name="value[blChangeCurr]" value='1' [{if $edit->getValue('blChangeCurr') == 1}]checked[{/if}]>
[{ oxinputhelp ident="D3_GEOIP_SET_OPTIONS_CHANGECURR_DESC" }] [{oxinputhelp ident="D3_GEOIP_SET_OPTIONS_CHANGECURR_DESC"}]
</dd> </dd>
<div class="spacer"></div> <div class="spacer"></div>
</dl> </dl>
@ -173,7 +173,7 @@ td.edittext {
<dd> <dd>
<input type="hidden" name="value[blChangeLang]" value="0"> <input type="hidden" name="value[blChangeLang]" value="0">
<input class="edittext ext_edittext" type="checkbox" name="value[blChangeLang]" value='1' [{if $edit->getValue('blChangeLang') == 1}]checked[{/if}]> <input class="edittext ext_edittext" type="checkbox" name="value[blChangeLang]" value='1' [{if $edit->getValue('blChangeLang') == 1}]checked[{/if}]>
[{ oxinputhelp ident="D3_GEOIP_SET_OPTIONS_CHANGELANG_DESC" }] [{oxinputhelp ident="D3_GEOIP_SET_OPTIONS_CHANGELANG_DESC"}]
</dd> </dd>
<div class="spacer"></div> <div class="spacer"></div>
</dl> </dl>
@ -184,7 +184,7 @@ td.edittext {
<dd> <dd>
<input type="hidden" name="value[blChangeURL]" value="0"> <input type="hidden" name="value[blChangeURL]" value="0">
<input class="edittext ext_edittext" type="checkbox" name="value[blChangeURL]" value='1' [{if $edit->getValue('blChangeURL') == 1}]checked[{/if}]> <input class="edittext ext_edittext" type="checkbox" name="value[blChangeURL]" value='1' [{if $edit->getValue('blChangeURL') == 1}]checked[{/if}]>
[{ oxinputhelp ident="D3_GEOIP_SET_OPTIONS_CHANGEURL_DESC" }] [{oxinputhelp ident="D3_GEOIP_SET_OPTIONS_CHANGEURL_DESC"}]
</dd> </dd>
<div class="spacer"></div> <div class="spacer"></div>
</dl> </dl>
@ -200,7 +200,7 @@ td.edittext {
<option value="[{$oCountry->getId()}]" [{if $edit->getValue('sFallbackCountryId') == $oCountry->getId()}] selected[{/if}]>[{$oCountry->oxcountry__oxtitle->value}]</option> <option value="[{$oCountry->getId()}]" [{if $edit->getValue('sFallbackCountryId') == $oCountry->getId()}] selected[{/if}]>[{$oCountry->oxcountry__oxtitle->value}]</option>
[{/foreach}] [{/foreach}]
</select> </select>
[{ oxinputhelp ident="D3_GEOIP_SET_OPTIONS_NOCOUNTRY_DESC" }] [{oxinputhelp ident="D3_GEOIP_SET_OPTIONS_NOCOUNTRY_DESC"}]
</dd> </dd>
<div class="spacer"></div> <div class="spacer"></div>
</dl> </dl>
@ -222,7 +222,7 @@ td.edittext {
</dt> </dt>
<dd> <dd>
<input type="text" maxlength="39" size="17" name="value[sTestIp]" value="[{$edit->getValue('sTestIp')}]"> <input type="text" maxlength="39" size="17" name="value[sTestIp]" value="[{$edit->getValue('sTestIp')}]">
[{ oxinputhelp ident="D3_GEOIP_SET_IP_TESTIP_DESC" }] [{oxinputhelp ident="D3_GEOIP_SET_IP_TESTIP_DESC"}]
</dd> </dd>
<div class="spacer"></div> <div class="spacer"></div>
</dl> </dl>
@ -238,7 +238,7 @@ td.edittext {
<option value="[{$oCountry->getFieldData('IP')}]" [{if $edit->getValue('sTestCountryIp') == $oCountry->getFieldData('IP')}] selected[{/if}]>[{$oCountry->getFieldData('oxtitle')}][{if !$oCountry->getFieldData('oxactive')}] [{oxmultilang ident="D3_GEOIP_SET_IP_TESTCOUNTRY_INACTIVE"}][{/if}]</option> <option value="[{$oCountry->getFieldData('IP')}]" [{if $edit->getValue('sTestCountryIp') == $oCountry->getFieldData('IP')}] selected[{/if}]>[{$oCountry->getFieldData('oxtitle')}][{if !$oCountry->getFieldData('oxactive')}] [{oxmultilang ident="D3_GEOIP_SET_IP_TESTCOUNTRY_INACTIVE"}][{/if}]</option>
[{/foreach}] [{/foreach}]
</select> </select>
[{ oxinputhelp ident="D3_GEOIP_SET_IP_TESTCOUNTRY_DESC" }] [{oxinputhelp ident="D3_GEOIP_SET_IP_TESTCOUNTRY_DESC"}]
</dd> </dd>
<div class="spacer"></div> <div class="spacer"></div>
</dl> </dl>
@ -248,7 +248,7 @@ td.edittext {
</dt> </dt>
<dd> <dd>
<input type="text" maxlength="39" size="17" name="value[sCheckIp]" value="[{$edit->getValue('sCheckIp')}]"> <input type="text" maxlength="39" size="17" name="value[sCheckIp]" value="[{$edit->getValue('sCheckIp')}]">
[{ oxinputhelp ident="D3_GEOIP_SET_IP_CHECKIP_DESC" }] [{oxinputhelp ident="D3_GEOIP_SET_IP_CHECKIP_DESC"}]
[{if $edit->getValue('sCheckIp')}] [{if $edit->getValue('sCheckIp')}]
[{$oView->getIpCountry($edit->getValue('sCheckIp'))}] [{$oView->getIpCountry($edit->getValue('sCheckIp'))}]
@ -259,12 +259,11 @@ td.edittext {
</div> </div>
</div> </div>
<table width="100%"> <table width="100%">
<tr> <tr>
<td class="edittext ext_edittext" align="left"> <td class="edittext ext_edittext" align="left">
<span class="d3modcfg_btn icon status_ok"> <span class="d3modcfg_btn icon status_ok">
<input type="submit" name="save" value="[{ oxmultilang ident="D3_GENERAL_GEOIP_SAVE" }]"> <input type="submit" name="save" value="[{oxmultilang ident="D3_GENERAL_GEOIP_SAVE"}]">
<div></div> <div></div>
</span> </span>
</td> </td>

View File

@ -2,40 +2,40 @@
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
window.onload = function () window.onload = function ()
{ {
[{ if $updatelist == 1}] [{if $updatelist == 1}]
top.oxid.admin.updateList('[{ $oxid }]'); top.oxid.admin.updateList('[{$oxid}]');
[{ /if}] [{/if}]
var oField = top.oxid.admin.getLockTarget(); var oField = top.oxid.admin.getLockTarget();
oField.onchange = oField.onkeyup = oField.onmouseout = top.oxid.admin.unlockSave; oField.onchange = oField.onkeyup = oField.onmouseout = top.oxid.admin.unlockSave;
} }
//--> //-->
</script> </script>
[{ if $readonly }] [{if $readonly}]
[{assign var="readonly" value="readonly disabled"}] [{assign var="readonly" value="readonly disabled"}]
[{else}] [{else}]
[{assign var="readonly" value=""}] [{assign var="readonly" value=""}]
[{/if}] [{/if}]
<form name="transfer" id="transfer" action="[{ $oViewConf->getSelfLink() }]" method="post"> <form name="transfer" id="transfer" action="[{$oViewConf->getSelfLink()}]" method="post">
[{ $oViewConf->getHiddenSid() }] [{$oViewConf->getHiddenSid()}]
<input type="hidden" name="oxid" value="[{ $oxid }]"> <input type="hidden" name="oxid" value="[{$oxid}]">
<input type="hidden" name="oxidCopy" value="[{ $oxid }]"> <input type="hidden" name="oxidCopy" value="[{$oxid}]">
<input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]"> <input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
<input type="hidden" name="language" value="[{ $actlang }]"> <input type="hidden" name="language" value="[{$actlang}]">
</form> </form>
<form name="myedit" id="myedit" action="[{ $oViewConf->getSelfLink() }]" method="post"> <form name="myedit" id="myedit" action="[{$oViewConf->getSelfLink()}]" method="post">
[{ $oViewConf->getHiddenSid() }] [{$oViewConf->getHiddenSid()}]
<input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]"> <input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
<input type="hidden" name="fnc" value=""> <input type="hidden" name="fnc" value="">
<input type="hidden" name="oxid" value="[{ $oxid }]"> <input type="hidden" name="oxid" value="[{$oxid}]">
<input type="hidden" name="voxid" value="[{ $oxid }]"> <input type="hidden" name="voxid" value="[{$oxid}]">
<input type="hidden" name="oxparentid" value="[{ $oxparentid }]"> <input type="hidden" name="oxparentid" value="[{$oxparentid}]">
<input type="hidden" name="editval[oxcountry__oxid]" value="[{ $oxid }]"> <input type="hidden" name="editval[oxcountry__oxid]" value="[{$oxid}]">
<input type="hidden" name="language" value="[{ $actlang }]"> <input type="hidden" name="language" value="[{$actlang}]">
<table cellspacing="0" cellpadding="0" border="0" width="98%"> <table cellspacing="0" cellpadding="0" border="0" width="98%">
<tr> <tr>
@ -85,7 +85,7 @@ window.onload = function ()
<td class="edittext"><br><br> <td class="edittext"><br><br>
</td> </td>
<td class="edittext"><br><br> <td class="edittext"><br><br>
<input type="submit" class="edittext" id="oLockButton" name="saveArticle" value="[{ oxmultilang ident="GENERAL_SAVE" }]" onClick="Javascript:document.myedit.fnc.value='save'"" [{ $readonly }] [{ if !$edit->oxcountry__oxtitle->value && !$oxparentid }]disabled[{/if}]><br> <input type="submit" class="edittext" id="oLockButton" name="saveArticle" value="[{oxmultilang ident="GENERAL_SAVE"}]" onClick="Javascript:document.myedit.fnc.value='save'"" [{$readonly}] [{if !$edit->oxcountry__oxtitle->value && !$oxparentid}]disabled[{/if}]><br>
</td> </td>
</tr> </tr>
</table> </table>