basic implementation 4.7/5.0

This commit is contained in:
2013-04-22 09:38:13 +00:00
parent 64e276125f
commit f43b3e5802
16 changed files with 54 additions and 37 deletions

View File

@ -0,0 +1,29 @@
<?php
// @copyright <20> D<> Data Development
//
// This Software is the property of Data Development and is protected
// by copyright law - it is NOT Freeware.
//
// Any unauthorized use of this software without a valid license key
// is a violation of the license agreement and will be prosecuted by
// civil and criminal law.
//
// http://www.shopmodule.com
// AUTOR Daniel Seifert <ds@shopmodule.com>
class d3_cfg_geoipset extends d3_cfg_mod_
{
public function render()
{
$this->_aViewData['sListClass'] = 'd3_cfg_geoipset_list';
$this->_aViewData['sMainClass'] = 'd3_cfg_geoipset_main';
$this->_hasListItems = false;
return parent::render();
}
}

View File

@ -0,0 +1,27 @@
<?php
// @copyright <20> D<> Data Development
//
// This Software is the property of Data Development and is protected
// by copyright law - it is NOT Freeware.
//
// Any unauthorized use of this software without a valid license key
// is a violation of the license agreement and will be prosecuted by
// civil and criminal law.
//
// http://www.shopmodule.com
// AUTOR Daniel Seifert <ds@shopmodule.com>
class d3_cfg_geoipset_licence extends d3_cfg_mod_licence
{
protected $_sModId = 'd3_geoip';
protected $_hasLicence = false;
protected $_hasNewsletterForm = false;
protected $_sMenuItemTitle = 'd3mxgeoip';
protected $_sMenuSubItemTitle = 'd3mxgeoip_settings';
}

View File

@ -0,0 +1,36 @@
<?php
// @copyright <20> D<> Data Development
//
// This Software is the property of Data Development and is protected
// by copyright law - it is NOT Freeware.
//
// Any unauthorized use of this software without a valid license key
// is a violation of the license agreement and will be prosecuted by
// civil and criminal law.
//
// http://www.shopmodule.com
// AUTOR Daniel Seifert <ds@shopmodule.com>
class d3_cfg_geoipset_list extends d3_cfg_mod_list
{
// enables language depended configuration
protected $_blD3ShowLangSwitch = false;
protected $_sMenuItemTitle = 'd3mxgeoip';
protected $_sMenuSubItemTitle = 'd3mxgeoip_settings';
public function render()
{
$sRet = parent::render();
// default page number 1
$this->_aViewData['oxid'] = 1;
$this->_aViewData["default_edit"] = "d3_cfg_geoipset_main";
$this->_aViewData["updatemain"] = $this->_blUpdateMain;
return $sRet;
}
}

View File

@ -0,0 +1,66 @@
<?php
// @copyright <20> D<> Data Development
//
// This Software is the property of Data Development and is protected
// by copyright law - it is NOT Freeware.
//
// Any unauthorized use of this software without a valid license key
// is a violation of the license agreement and will be prosecuted by
// civil and criminal law.
//
// http://www.shopmodule.com
// AUTOR Daniel Seifert <ds@shopmodule.com>
class d3_cfg_geoipset_main extends d3_cfg_mod_main
{
protected $_sModId = 'd3_geoip';
protected $_sThisTemplate = "d3_cfg_geoipset_main.tpl";
public function getIpCountry($sIP)
{
$oD3GeoIP = oxNew('d3geoip');
$oCountry = $oD3GeoIP->getUserLocationCountryObject($sIP);
if ($oCountry->getId())
$sTitle = $oCountry->getFieldData('oxtitle');
else
$sTitle = oxLang::getInstance()->translateString('D3_GEOIP_SET_IP_CHECKIP_NOTSET');
return $sTitle;
}
public function getCountryList()
{
$oCountryList = oxNew('oxcountrylist');
if ($oCountryList->getBaseObject()->isMultilang())
{
$oCountryList->getBaseObject()->setLanguage(oxLang::getInstance()->getTplLanguage());
}
$oListObject = $oCountryList->getBaseObject();
$sFieldList = $oListObject->getSelectFields();
$sQ = "select $sFieldList from " . $oListObject->getViewName();
$oCountryList->selectString($sQ);
return $oCountryList;
}
public function getIPCountryList()
{
$oGeoIp = oxNew('d3geoip');
$oCountryList = oxNew('oxcountrylist');
if ($oCountryList->getBaseObject()->isMultilang())
{
$oCountryList->getBaseObject()->setLanguage(oxLang::getInstance()->getTplLanguage());
}
$oListObject = $oCountryList->getBaseObject();
$sFieldList = $oListObject->getSelectFields();
$sQ = "select (SELECT d3startip FROM ".$oGeoIp->getViewName()." WHERE D3ISO = " .$oListObject->getViewName(). ".oxisoalpha2 LIMIT 1) as IP, $sFieldList from " . $oListObject->getViewName();
$oCountryList->selectString($sQ);
return $oCountryList;
}
}

View File

@ -0,0 +1,236 @@
<?php
class d3_country_geoip extends oxAdminView
{
protected $_sDefSort = 'sort';
protected $_sThisTemplate = 'd3_country_geoip.tpl';
private $_oSet;
private $_sModId = 'd3_geoip';
public function render()
{
$this->_oSet = d3_cfg_mod::get($this->_sModId);
$myConfig = $this->getConfig();
if ( !$myConfig->getConfigParam( 'blAllowSharedEdit' ) )
$this->_aViewData['readonly'] = true;
$ret = parent::render();
$soxId = oxConfig::getParameter( "oxid");
// check if we right now saved a new entry
$sSavedID = oxConfig::getParameter( "saved_oxid");
if ( ($soxId == "-1" || !isset( $soxId)) && isset( $sSavedID) ) {
$soxId = $sSavedID;
oxSession::deleteVar( "saved_oxid");
$this->_aViewData["oxid"] = $soxId;
// for reloading upper frame
$this->_aViewData["updatelist"] = "1";
}
if ( $soxId != "-1" && isset( $soxId)) {
// load object
$oCountry = oxNew( "oxcountry" );
$oCountry->loadInLang( $this->_iEditLang, $soxId );
if ($oCountry->isForeignCountry()) {
$this->_aViewData["blForeignCountry"] = true;
} else {
$this->_aViewData["blForeignCountry"] = false;
}
$oOtherLang = $oCountry->getAvailableInLangs();
if (!isset($oOtherLang[$this->_iEditLang])) {
// echo "language entry doesn't exist! using: ".key($oOtherLang);
$oCountry->loadInLang( key($oOtherLang), $soxId );
}
$this->_aViewData["edit"] = $this->oCountry = $oCountry;
// remove already created languages
$aLang = array_diff (oxLang::getInstance()->getLanguageNames(), $oOtherLang );
if ( count( $aLang))
$this->_aViewData["posslang"] = $aLang;
foreach ( $oOtherLang as $id => $language) {
$oLang= new oxStdClass();
$oLang->sLangDesc = $language;
$oLang->selected = ($id == $this->_iEditLang);
$this->_aViewData["otherlang"][$id] = clone $oLang;
}
} else {
$this->_aViewData["blForeignCountry"] = true;
}
$this->oShopList = &oxNew('oxshoplist');
$oShop = &oxNew('oxshop');
$sSelect = "SELECT * FROM ".$oShop->getViewName()." WHERE ".$oShop->getSqlActiveSnippet();
$this->oShopList->selectString($sSelect);
$this->getLangList();
return $ret;
}
public function getModCfgValue($sIdent)
{
$this->_oSet = d3_cfg_mod::get($this->_sModId);
return $this->_oSet->getValue($sIdent);
}
public function saveshop()
{
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$_POST['editval']['oxcountry__d3geoiplang'] = '-1';
$_POST['editval']['oxcountry__d3geoipcur'] = '-1';
}
$this->save();
}
public function save()
{
$myConfig = $this->getConfig();
//allow malladmin only to perform this action
if ( !$myConfig->getConfigParam( 'blAllowSharedEdit' ) )
return;
$soxId = oxConfig::getParameter( "oxid");
$aParams = oxConfig::getParameter( "editval" );
$oCountry = oxNew( "oxcountry" );
if ( $soxId != "-1") {
$oCountry->loadInLang( $this->_iEditLang, $soxId );
} else {
$aParams['oxcountry__oxid'] = null;
}
//$aParams = $oCountry->ConvertNameArray2Idx( $aParams);
$oCountry->setLanguage(0);
$oCountry->assign( $aParams );
$oCountry->setLanguage($this->_iEditLang);
$oCountry = oxUtilsFile::getInstance()->processFiles( $oCountry );
$oCountry->save();
$this->_aViewData["updatelist"] = "1";
// set oxid if inserted
if ( $soxId == "-1")
oxSession::setVar( "saved_oxid", $oCountry->oxcountry__oxid->value);
}
public function getShopList()
{
return $this->oShopList;
}
public function getCurList()
{
$aCurrencies = array();
if ($this->getModCfgValue('blChangeShop') && $this->oCountry->getFieldData('d3geoipshop'))
{
$sShopId = $this->oCountry->getFieldData('d3geoipshop');
}
else
{
$sShopId = $this->getConfig()->getActiveView()->getViewConfig()->getActiveShopId();
}
$sQ = "select DECODE( oxvarvalue, '".$this->getConfig()->getConfigParam( 'sConfigKey' )."') as oxvarvalue from oxconfig where oxshopid = '".$sShopId."' AND oxvarname = 'aCurrencies'";
$sCurs = oxDb::getDb(2)->getOne($sQ);
foreach (unserialize($sCurs) as $sKey => $sValue)
{
$aFields = explode('@', $sValue);
$aCurrencies[$sKey]->id = $sKey;
$aCurrencies[$sKey]->name = $aFields[0];
$aCurrencies[$sKey]->sign = $aFields[4];
}
return $aCurrencies;
}
public function getLangList()
{
if ($this->getModCfgValue('blChangeShop') && $this->oCountry->getFieldData('d3geoipshop'))
{
$sShopId = $this->oCountry->getFieldData('d3geoipshop');
}
else
{
$sShopId = $this->getConfig()->getActiveView()->getViewConfig()->getActiveShopId();
}
$aLanguages = array();
$aLangParams = $this->getConfig()->getShopConfVar('aLanguageParams', $sShopId);
$aConfLanguages = $this->getConfig()->getShopConfVar('aLanguages', $sShopId);
if ( is_array( $aConfLanguages ) ) {
$i = 0;
reset( $aConfLanguages );
while ( list( $key, $val ) = each( $aConfLanguages ) ) {
if ( $blOnlyActive && is_array($aLangParams) ) {
//skipping non active languages
if ( !$aLangParams[$key]['active'] ) {
$i++;
continue;
}
}
if ( $val) {
$oLang = new oxStdClass();
if ( isset($aLangParams[$key]['baseId']) ) {
$oLang->id = $aLangParams[$key]['baseId'];
} else {
$oLang->id = $i;
}
$oLang->oxid = $key;
$oLang->abbr = $key;
$oLang->name = $val;
if ( is_array($aLangParams) ) {
$oLang->active = $aLangParams[$key]['active'];
$oLang->sort = $aLangParams[$key]['sort'];
}
if ( isset( $iLanguage ) && $oLang->id == $iLanguage ) {
$oLang->selected = 1;
} else {
$oLang->selected = 0;
}
if ($oLang->active)
$aLanguages[$oLang->id] = $oLang;
}
++$i;
}
}
if ( $blSort && is_array($aLangParams) ) {
uasort( $aLanguages, array($this, '_sortLanguagesCallback') );
}
return $aLanguages;
}
protected function _sortLanguagesCallback( $oLang1, $oLang2 )
{
$sSortParam = $this->_sDefSort;
$sVal1 = is_string($oLang1->$sSortParam) ? strtolower( $oLang1->$sSortParam ) : $oLang1->$sSortParam;
$sVal2 = is_string($oLang2->$sSortParam) ? strtolower( $oLang2->$sSortParam ) : $oLang2->$sSortParam;
if ( $this->_sDefSortOrder == 'asc' ) {
return ($sVal1 < $sVal2) ? -1 : 1;
} else {
return ($sVal1 > $sVal2) ? -1 : 1;
}
}
}

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="ISO-8859-15"?>
<OX>
<OXMENU id="NAVIGATION_ESHOPADMIN">
<MAINMENU id="mxmainmenu">
<SUBMENU id="mxcountries" cl="country" list="country_list">
<TAB id="tbclcountry_geoip" cl="d3_country_geoip" />
</SUBMENU>
</MAINMENU>
</OXMENU>
<OXMENU id="d3mxd3modules">
<MAINMENU id="d3mxgeoip">
<SUBMENU id="d3mxgeoip_settings" cl="d3_cfg_geoipset" list="d3_cfg_geoipset_list">
<TAB id="d3tbclgeoip_settings_main" cl="d3_cfg_geoipset_main" />
<TAB id="d3tbcl_licence" cl="d3_cfg_geoipset_licence" />
</SUBMENU>
</MAINMENU>
</OXMENU>
</OX>

View File

@ -0,0 +1,40 @@
<?php
/**
* Metadata version
*/
$sMetadataVersion = '1.1';
/**
* Module information
*/
$aModule = array(
'id' => 'd3geoip',
'title' => (class_exists('d3utils') ? d3utils::getInstance()->getD3Logo() : 'D&sup3;') . ' GeoIP Vorauswahl',
'description' => array(
'de' => 'Begr&uuml;&szlig;en Sie Ihre Kunden in seiner Landessprache.',
'en' => '',
),
'thumbnail' => 'picture.png',
'version' => '3.0.0.0',
'author' => 'D&sup3; Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'url' => 'http://www.oxidmodule.com/',
'extend' => array(
'oxcmp_cur' => 'd3/d3geoip/modules/components/d3_oxcmp_cur_geoip',
'oxcmp_lang' => 'd3/d3geoip/modules/components/d3_oxcmp_lang_geoip',
),
'files' => array(
'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',
'd3geoip' => 'd3/d3geoip/models/d3geoip.php',
),
'templates' => array(
'd3_cfg_geoipset_main.tpl' => 'd3/d3geoip/views/admin/tpl/d3_cfg_geoipset_main.tpl',
),
'events' => array(
'onActivate' => 'd3install::checkUpdateStart',
),
'blocks' => array(
),
);

View File

@ -0,0 +1,300 @@
<?php
// @copyright <20> D<> Data Development
//
// This Software is the property of Data Development and is protected
// by copyright law - it is NOT Freeware.
//
// Any unauthorized use of this software without a valid license key
// is a violation of the license agreement and will be prosecuted by
// civil and criminal law.
//
// http://www.shopmodule.com
// AUTOR Daniel Seifert <ds@shopmodule.com>
class d3GeoIP extends oxI18n
{
/**
* Current class name
*
* @var string
*/
protected $_sClassName = 'd3geoip';
/**
* ModCfg ID
*
* @var string
*/
private $_sModId = 'd3_geoip';
/**
* Class constructor, initiates parent constructor (parent::oxI18n()).
*
* @return null
*/
public function __construct()
{
parent::__construct();
$this->init('d3geoip');
}
/**
* get oxcountry object by given IP address (optional)
*
* @param string $sIP optional
* @return object
*/
public function getUserLocationCountryObject($sIP = false)
{
if (!$this->oCountry)
{
if (!$sIP)
$sIP = $this->getIP();
$iIPNum = $this->_getNumIp($sIP);
$sISOAlpha = $this->LoadByIPNum($iIPNum);
if (!$sISOAlpha)
{
$this->_getLog()->setLog('error', __CLASS__, __FUNCTION__, __LINE__, 'get ISO by IP failed', $sIP);
$this->oCountry = $this->getCountryFallBackObject();
}
else
{
$this->_getLog()->setLog('info', __CLASS__, __FUNCTION__, __LINE__, 'get ISO by IP', $sIP." => ".$sISOAlpha);
$this->oCountry = $this->getCountryObject($sISOAlpha);
}
}
return $this->oCountry;
}
/**
* get IP address from client or set test IP address
*
* @return string
*/
public function getIP()
{
if ($this->_getModConfig()->getValue('blUseTestIp') && $this->_getModConfig()->getValue('sTestIp'))
return $this->_getModConfig()->getValue('sTestIp');
elseif ($this->_getModConfig()->getValue('blUseTestCountry') && $this->_getModConfig()->getValue('sTestCountryIp'))
return $this->_getModConfig()->getValue('sTestCountryIp');
else
return $_SERVER['REMOTE_ADDR'];
}
/**
* get IP number by IP address
*
* @param string $sIP IP address
* @return int IP number
*/
protected function _getNumIp($sIP)
{
$aIP = explode('.',$sIP);
$iIP = ($aIP[0] * 16777216) + ($aIP[1] * 65536) + ($aIP[2] * 256) + ($aIP[3] * 1);
return $iIP;
}
/**
* get ISO alpha 2 ID by IP number
*
* @param int $iIPNum IP number
* @return string
*/
public function LoadByIPNum($iIPNum)
{
$sSelect = "SELECT d3iso FROM ".$this->_sClassName." WHERE d3startipnum <= '$iIPNum' AND d3endipnum >= '$iIPNum'";
return oxDb::getDb()->getOne($sSelect);
}
/**
* get oxcountry object by ISO alpha 2 ID
*
* @param string $sISOAlpha
* @return object
*/
public function getCountryObject($sISOAlpha)
{
$oCountry = oxNew('oxcountry');
$sSelect = "SELECT oxid FROM ".$oCountry->getViewName()." WHERE OXISOALPHA2 = '".$sISOAlpha."' AND OXACTIVE = '1'";
$oCountry->load(oxDb::getDb()->getOne($sSelect));
return $oCountry;
}
/**
* get oxcountry object for fallback, if set
*
* @return object
*/
public function getCountryFallBackObject()
{
$oCountry = oxNew('oxcountry');
if ($this->_getModConfig()->getValue('blUseFallback') && $this->_getModConfig()->getValue('sFallbackCountryId'))
{
$oCountry->Load($this->_getModConfig()->getValue('sFallbackCountryId'));
}
return $oCountry;
}
/*
public function setUserCountry()
{
if (!$this->getUser()) {
$oCountry = $this->getUserLocationCountryObject();
$oUser = &oxNew('oxuser');
$oUser->oxuser__oxcountryid = oxNew('oxfield');
$oUser->oxuser__oxcountryid->setValue($oCountry->getId());
$this->setUser($oUser);
}
return;
}
*/
/**
* check module active state and set user country specific language
*
*/
public function setCountryLanguage()
{
$this->performURLSwitch();
$this->performShopSwitch();
if (!$this->_getModConfig()->getFieldData('oxactive') || !$this->_getModConfig()->getValue('blChangeLang'))
return;
$oCountry = $this->getUserLocationCountryObject();
if (!$this->isAdmin() && oxUtils::getInstance()->isSearchEngine() === false && $this->getSession()->getVar('d3isSetLang') === null && $oCountry->getId() && $oCountry->getFieldData('d3geoiplang') > -1)
{
$this->_getLog()->setLog('info', __CLASS__, __FUNCTION__, __LINE__, 'set language', $this->getIP().' => '.$oCountry->getFieldData('d3geoiplang'));
oxLang::getInstance()->setTplLanguage((int) $oCountry->getFieldData('d3geoiplang'));
oxLang::getInstance()->setBaseLanguage((int) $oCountry->getFieldData('d3geoiplang'));
$this->getSession()->setVar('d3isSetLang', true);
}
}
/**
* check module active state and set user country specific currency
*
*/
public function setCountryCurrency()
{
if (!$this->_getModConfig()->getFieldData('oxactive') || !$this->_getModConfig()->getValue('blChangeCurr'))
return;
$oCountry = $this->getUserLocationCountryObject();
if (!$this->isAdmin() && oxUtils::getInstance()->isSearchEngine() === false && !$this->getSession()->getVar('d3isSetCurr') && $oCountry->getId() && $oCountry->getFieldData('d3geoipcur') > -1)
{
$this->_getLog()->setLog('info', __CLASS__, __FUNCTION__, __LINE__, 'set currency', $this->getIP().' => '.$oCountry->getFieldData('d3geoipcur'));
$this->getConfig()->setActShopCurrency((int) $oCountry->getFieldData('d3geoipcur'));
$this->getSession()->setVar('d3isSetCurr', true);
}
}
/**
* check module active state and perform switching to user country specific shop (EE only)
*
*/
public function performShopSwitch()
{
if (!$this->_getModConfig()->getFieldData('oxactive') || !$this->_getModConfig()->getValue('blChangeShop'))
return;
$oCountry = $this->getUserLocationCountryObject();
$iNewShop = $oCountry->getFieldData('d3geoipshop');
$aShopLinks = $this->getShopUrls();
if (!$this->isAdmin() && oxUtils::getInstance()->isSearchEngine() === false && $oCountry->getId() && $this->getConfig()->isMall() && $iNewShop > -1 && $iNewShop != $this->getConfig()->getShopId())
{
$oNewConf = new oxConfig();
$oNewConf->setShopId($iNewShop);
$oNewConf->init();
$this->getConfig()->onShopChange();
if (!$this->getSession()->getVar('d3isSetLang') && $oCountry->getFieldData('d3geoiplang') > -1)
$sLangId = $oCountry->getFieldData('d3geoiplang');
else
$sLangId = '';
$this->_getLog()->setLog('info', __CLASS__, __FUNCTION__, __LINE__, 'change shop', $this->getIP().' => '.$oNewConf->getShopHomeUrl($sLangId));
header("Location: ".$oNewConf->getShopHomeUrl($sLangId));
exit();
}
}
/**
* check module active state and perform switching to user country specific url
*
*/
public function performURLSwitch()
{
if (!$this->_getModConfig()->getFieldData('oxactive') || !$this->_getModConfig()->getValue('blChangeURL'))
return;
$oCountry = $this->getUserLocationCountryObject();
if (!$this->isAdmin() && oxUtils::getInstance()->isSearchEngine() === false && $oCountry->getId() && $oCountry->getFieldData('d3geoipurl') && strlen(trim($oCountry->getFieldData('d3geoipurl'))) > 0)
{
$sNewUrl = $oCountry->getFieldData('d3geoipurl');
$this->_getLog()->setLog('info', __CLASS__, __FUNCTION__, __LINE__, 'change url', $this->getIP().' => '.$oCountry->getFieldData('d3geoipurl'));
header("Location: ".$sNewUrl);
exit();
}
}
/**
* get all shop urls
*
* @return array
*/
public function getShopUrls()
{
$oShoplist = oxNew( 'oxshoplist' );
$oShoplist->getList();
$aShopUrls = array();
foreach ( $oShoplist as $sId => $oShop ) {
$aShopUrls[$sId] = $this->getConfig()->getShopConfVar( 'sMallShopURL', $sId );
}
return $aShopUrls;
}
/**
* get modcfg instance
*
* @return object
*/
protected function _getModConfig()
{
return d3_cfg_mod::get($this->_sModId);
}
/**
* get d3log instance
*
* @return object
*/
protected function _getLog()
{
if (!$this->oD3Log)
$this->oD3Log = $this->_getModConfig()->getLogInstance();
return $this->oD3Log;
}
}

View File

@ -0,0 +1,22 @@
<?php
class d3_oxcmp_cur_geoip extends d3_oxcmp_cur_geoip_parent
{
private $_sModId = 'd3_geoip';
public function init()
{
if (d3_cfg_mod::get($this->_sModId)->getValue('blDebugmodeGlobal'))
{
$oGeoIp = oxNew('d3geoip');
echo $oGeoIp->getIP();
}
$oLocation = oxNew('d3geoip');
//$oLocation->setUserCountry();
$oLocation->setCountryCurrency();
return parent::init();
}
}

View File

@ -0,0 +1,13 @@
<?php
class d3_oxcmp_lang_geoip extends d3_oxcmp_lang_geoip_parent
{
public function init()
{
$oLocation = oxNew('d3geoip');
//$oLocation->setUserCountry();
$oLocation->setCountryLanguage();
return parent::init();
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,65 @@
<?php
/**
* This Software is the property of OXID eSales and is protected
* by copyright law - it is NOT Freeware.
*
* Any unauthorized use of this software without a valid license key
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
*
* @link http://www.oxid-esales.com
* @package lang
* @copyright (C) OXID eSales AG 2003-2009
* @version OXID eShop EE
* $Id: lang.php 23594 2009-10-26 13:19:30Z alfonsas $
*/
$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<65>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<70>fen',
'D3_GEOIP_SET_IP_CHECKIP_NOTSET' => 'IP nicht zugewiesen oder Land nicht aktiv',
'D3_GENERAL_GEOIP_SAVE' => 'Speichern',
'D3_GEOIP_SELSHOP' => 'zust<73>ndiger Shop',
'D3_GEOIP_SELLANG' => 'vorgew<65>hlte Sprache',
'D3_GEOIP_SELCUR' => 'vorgew<65>hlte W<>hrung',
'D3_GEOIP_CUSTSELSHOP' => ' - vom Kunden gew<65>hlter Shop - ',
'D3_GEOIP_CUSTSELLANG' => ' - vom Kunden gew<65>hlte Sprache - ',
'D3_GEOIP_CUSTSELCUR' => ' - vom Kunden gew<65>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<75>tzlich in den Modul-Grundeinstellungen.',
'D3_GEOIP_METADATA_TITLE' => 'D<> GeoIP Vorauswahl',
'D3_GEOIP_METADATA_DESC' => 'Begr<67><72>en Sie Ihre Kunden in seiner Landessprache.',
);
/*
[{ oxmultilang ident='ACTIONS_MAIN_YOUWANTTODELETE' }]
*/

View File

@ -0,0 +1,343 @@
[{include file="headitem.tpl" title="GENERAL_ADMIN_TITLE"|oxmultilangassign}]
<link rel="stylesheet" type="text/css" href="[{$oViewConf->getResourceUrl() }]d3_mod_cfg.css">
<script type="text/javascript">
<!--
[{ if $updatelist == 1}]
UpdateList('[{ $oxid }]');
[{ /if}]
function UpdateList( sID)
{
var oSearch = parent.list.document.getElementById("search");
oSearch.oxid.value=sID;
oSearch.fnc.value='';
oSearch.submit();
}
function EditThis( sID)
{
var oTransfer = document.getElementById("transfer");
oTransfer.oxid.value=sID;
oTransfer.cl.value='';
oTransfer.submit();
var oSearch = parent.list.document.getElementById("search");
oSearch.actedit.value = 0;
oSearch.oxid.value=sID;
oSearch.submit();
}
function _groupExp(el) {
var _cur = el.parentNode;
if (_cur.className == "exp") _cur.className = "";
else _cur.className = "exp";
}
var sOldSettingElem = '';
function showFormatSettings(sElemId, visible, blUseOldElem)
{
if (blUseOldElem && sOldSettingElem) {
document.getElementById(sOldSettingElem).style.display = 'none';
sOldSettingElem = sElemId;
} else if (blUseOldElem) {
document.getElementById('settings_global').style.display = 'none';
document.getElementById('settingstxt_global').style.display = 'none';
sOldSettingElem = sElemId;
}
if (visible == true)
document.getElementById(sElemId).style.display = 'block';
else
document.getElementById(sElemId).style.display = 'none';
}
-->
</script>
<style type="text/css">
<!--
.questbox{
background-color: #07f;
color: white;
float: right;
position: relative;
display: block;
padding: 1px 4px;
font-weight: bold;
z-index: 98;
cursor: help;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: 10px;
line-height: 12px;
}
.helptextbox{
background-color: white;
color: black;
border: 1px solid black;
position: absolute;
overflow: hidden;
padding: 5px;
margin-top: 15px;
width: 300px;
z-index: 99;
}
fieldset{
border: 1px inset black;
background-color: #F0F0F0;
}
legend{
font-weight: bold;
}
dl dt{
font-weight: normal;
width: 55%;
}
.ext_edittext {
padding: 2px;
}
td.edittext {
white-space: normal;
}
-->
</style>
[{ if $readonly}]
[{assign var="readonly" value="readonly disabled"}]
[{else}]
[{assign var="readonly" value=""}]
[{/if}]
<form name="transfer" id="transfer" action="[{ $oViewConf->getSelfLink() }]" method="post">
[{ $oViewConf->getHiddenSid() }]
<input type="hidden" name="oxid" value="[{ $oxid }]">
<input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
<input type="hidden" name="actshop" value="[{ $shop->id }]">
<input type="hidden" name="editlanguage" value="[{ $editlanguage }]">
</form>
<form name="myedit" id="myedit" action="[{ $oViewConf->getSelfLink() }]" method="post">
[{ $oViewConf->getHiddenSid() }]
<input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
<input type="hidden" name="fnc" value="save">
<input type="hidden" name="oxid" value="[{ $oxid }]">
<input type="hidden" name="editval[d3_cfg_mod__oxid]" value="[{ $oxid }]">
<table border="0" width="98%">
<tr>
<td valign="top" class="edittext">
<table style="width: 100%">
<tr>
<td style="width:50%; border-right: 1px solid #999;">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td class="edittext ext_edittext">
[{oxmultilang ident="D3_CFG_MOD_GENERAL_MODULEACTIVE"}]
</td>
<td class="edittext ext_edittext">
<input type="hidden" name="editval[d3_cfg_mod__oxactive]" value='0'>
<input class="edittext ext_edittext" type="checkbox" name="editval[d3_cfg_mod__oxactive]" value='1' [{if $edit->d3_cfg_mod__oxactive->value == 1}]checked[{/if}]>
[{oxinputhelp ident="D3_CFG_MOD_GENERAL_MODULEACTIVE_DESC"}]
</td>
</tr>
<tr>
<td class="edittext ext_edittext">
</td>
<td class="edittext ext_edittext">
</td>
</tr>
<tr>
<td class="edittext ext_edittext">
[{if $edit->getValue('blDebugmodeGlobal') == 1}]<span style="font-weight: bold; color: #CD0210;">[{/if}][{oxmultilang ident="D3_CFG_MOD_GENERAL_DEBUGACTIVE"}][{if $edit->getValue('blDebugmodeGlobal') == 1}]</span>[{/if}]&nbsp;
</td>
<td class="edittext ext_edittext">
<input type="hidden" name="value[blDebugmodeGlobal]" value="0">
<input class="edittext ext_edittext" type="checkbox" name="value[blDebugmodeGlobal]" value='1' [{if $edit->getValue('blDebugmodeGlobal') == 1}]checked[{/if}]>
[{oxinputhelp ident="D3_GEOIP_SET_DEBUG_DESC"}]
</td>
</tr>
</table>
</td>
<td>
[{assign var="blD3HasLog" value=$oView->checkD3Log() }]
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td class="edittext ext_edittext" style="width: 100%;">
[{if $blD3HasLog}]
[{oxmultilang ident="D3_CFG_MOD_GENERAL_MODULELOGGING"}]
[{/if}]
</td>
<td class="edittext ext_edittext" align="left">
[{if $blD3HasLog}]
<select name="editval[d3_cfg_mod__oxismodulelog]" class="edittext">
<option value="0" [{if $edit->d3_cfg_mod__oxismodulelog->value == 0}]selected[{/if}]>[{oxmultilang ident="D3_CFG_MOD_GENERAL_MODULELOGGING_NONE"}]</option>
<option value="1" [{if $edit->d3_cfg_mod__oxismodulelog->value == 1}]selected[{/if}]>[{oxmultilang ident="D3_CFG_MOD_GENERAL_MODULELOGGING_ALL"}]</option>
<option value="2" [{if $edit->d3_cfg_mod__oxismodulelog->value == 2}]selected[{/if}]>[{oxmultilang ident="D3_CFG_MOD_GENERAL_MODULELOGGING_ERRORS"}]</option>
</select>
[{/if}]
</td>
</tr>
<tr>
<td class="edittext ext_edittext" style="width: 100%;">
&nbsp;
</td>
<td class="edittext ext_edittext" align="left">
&nbsp;
</td>
</tr>
</table>
</td>
</tr>
</table>
<div class="groupExp">
<div class="">
<a class="rc" onclick="_groupExp(this); return false;" href="#">
<b>
[{oxmultilang ident="D3_GEOIP_SET_OPTIONS"}]
</b>
</a>
<dl>
<dt>
[{oxmultilang ident="D3_GEOIP_SET_OPTIONS_CHANGESHOP"}]
</dt>
<dd>
<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}]>
[{ oxinputhelp ident="D3_GEOIP_SET_OPTIONS_CHANGESHOP_DESC" }]
</dd>
<div class="spacer"></div>
</dl>
<dl>
<dt>
[{oxmultilang ident="D3_GEOIP_SET_OPTIONS_CHANGECURR"}]
</dt>
<dd>
<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}]>
[{ oxinputhelp ident="D3_GEOIP_SET_OPTIONS_CHANGECURR_DESC" }]
</dd>
<div class="spacer"></div>
</dl>
<dl>
<dt>
[{oxmultilang ident="D3_GEOIP_SET_OPTIONS_CHANGELANG"}]
</dt>
<dd>
<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}]>
[{ oxinputhelp ident="D3_GEOIP_SET_OPTIONS_CHANGELANG_DESC" }]
</dd>
<div class="spacer"></div>
</dl>
<dl>
<dt>
[{oxmultilang ident="D3_GEOIP_SET_OPTIONS_CHANGEURL"}]
</dt>
<dd>
<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}]>
[{ oxinputhelp ident="D3_GEOIP_SET_OPTIONS_CHANGEURL_DESC" }]
</dd>
<div class="spacer"></div>
</dl>
<dl>
<dt>
[{oxmultilang ident="D3_GEOIP_SET_OPTIONS_NOCOUNTRY"}]
<input type="hidden" name="value[blUseFallback]" value="0">
<input class="edittext ext_edittext" type="checkbox" name="value[blUseFallback]" value='1' [{if $edit->getValue('blUseFallback') == 1}]checked[{/if}]>
</dt>
<dd>
<select size="5" name="value[sFallbackCountryId]">
[{foreach from=$oView->getCountryList() item="oCountry"}]
<option value="[{$oCountry->getId()}]" [{if $edit->getValue('sFallbackCountryId') == $oCountry->getId()}] selected[{/if}]>[{$oCountry->oxcountry__oxtitle->value}]</option>
[{/foreach}]
</select>
[{ oxinputhelp ident="D3_GEOIP_SET_OPTIONS_NOCOUNTRY_DESC" }]
</dd>
<div class="spacer"></div>
</dl>
</div>
</div>
<div class="groupExp">
<div class="">
<a class="rc" onclick="_groupExp(this); return false;" href="#">
<b>
[{oxmultilang ident="D3_GEOIP_SET_IP"}]
</b>
</a>
<dl>
<dt>
[{oxmultilang ident="D3_GEOIP_SET_IP_TESTIP"}]
<input type="hidden" name="value[blUseTestIp]" value="0">
<input class="edittext ext_edittext" type="checkbox" name="value[blUseTestIp]" value='1' [{if $edit->getValue('blUseTestIp') == 1}]checked[{/if}]>
</dt>
<dd>
<input type="text" maxlength="15" size="17" name="value[sTestIp]" value="[{$edit->getValue('sTestIp')}]">
[{ oxinputhelp ident="D3_GEOIP_SET_IP_TESTIP_DESC" }]
</dd>
<div class="spacer"></div>
</dl>
<dl>
<dt>
[{oxmultilang ident="D3_GEOIP_SET_IP_TESTCOUNTRY"}]
<input type="hidden" name="value[blUseTestCountry]" value="0">
<input class="edittext ext_edittext" type="checkbox" name="value[blUseTestCountry]" value='1' [{if $edit->getValue('blUseTestCountry') == 1}]checked[{/if}]>
</dt>
<dd>
<select name="value[sTestCountryIp]" size="1" class="edittext ext_edittext">
[{foreach from=$oView->getIPCountryList() item="oCountry"}]
<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}]
</select>
[{ oxinputhelp ident="D3_GEOIP_SET_IP_TESTCOUNTRY_DESC" }]
</dd>
<div class="spacer"></div>
</dl>
<dl>
<dt>
[{oxmultilang ident="D3_GEOIP_SET_IP_CHECKIP"}]
</dt>
<dd>
<input type="text" maxlength="15" size="17" name="value[sCheckIp]" value="[{$edit->getValue('sCheckIp')}]">
[{ oxinputhelp ident="D3_GEOIP_SET_IP_CHECKIP_DESC" }]
[{if $edit->getValue('sCheckIp')}]
[{$oView->getIpCountry($edit->getValue('sCheckIp'))}]
[{/if}]
</dd>
<div class="spacer"></div>
</dl>
</div>
</div>
<table width="100%">
<tr>
<td class="edittext ext_edittext" align="left">
<span class="d3modcfg_btn icon status_ok">
<input type="submit" name="save" value="[{ oxmultilang ident="D3_GENERAL_GEOIP_SAVE" }]">
<div></div>
</span>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
[{include file="bottomitem.tpl"}]

View File

@ -0,0 +1,120 @@
[{include file="headitem.tpl" title="GENERAL_ADMIN_TITLE"|oxmultilangassign}]
<script type="text/javascript">
<!--
window.onload = function ()
{
[{ if $updatelist == 1}]
top.oxid.admin.updateList('[{ $oxid }]');
[{ /if}]
var oField = top.oxid.admin.getLockTarget();
oField.onchange = oField.onkeyup = oField.onmouseout = top.oxid.admin.unlockSave;
}
//-->
</script>
[{ if $readonly }]
[{assign var="readonly" value="readonly disabled"}]
[{else}]
[{assign var="readonly" value=""}]
[{/if}]
<form name="transfer" id="transfer" action="[{ $oViewConf->getSelfLink() }]" method="post">
[{ $oViewConf->getHiddenSid() }]
<input type="hidden" name="oxid" value="[{ $oxid }]">
<input type="hidden" name="oxidCopy" value="[{ $oxid }]">
<input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
<input type="hidden" name="language" value="[{ $actlang }]">
</form>
<form name="myedit" id="myedit" action="[{ $oViewConf->getSelfLink() }]" method="post">
[{ $oViewConf->getHiddenSid() }]
<input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
<input type="hidden" name="fnc" value="">
<input type="hidden" name="oxid" value="[{ $oxid }]">
<input type="hidden" name="voxid" value="[{ $oxid }]">
<input type="hidden" name="oxparentid" value="[{ $oxparentid }]">
<input type="hidden" name="editval[oxcountry__oxid]" value="[{ $oxid }]">
<input type="hidden" name="language" value="[{ $actlang }]">
<table cellspacing="0" cellpadding="0" border="0" width="98%">
<tr>
<td valign="top" class="edittext" style="width: 45%">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td class="edittext" width="120">
[{oxmultilang ident="D3_GEOIP_SELSHOP"}]:
</td>
<td class="edittext">
<SELECT name="editval[oxcountry__d3geoipshop]" class="edittext" onchange="document.getElementById('myedit').fnc.value = 'saveshop'; document.getElementById('myedit').submit();" [{if !$oView->getModCfgValue('blChangeShop')}]disabled[{/if}]>
<option value="-1">[{oxmultilang ident="D3_GEOIP_CUSTSELSHOP"}]</option>
[{foreach from=$oView->getShopList() item=shop}]
<option value="[{$shop->oxshops__oxid->value}]" [{if $edit->oxcountry__d3geoipshop->value == $shop->oxshops__oxid->value}]selected[{/if}]>[{$shop->oxshops__oxname->value}]</option>
[{/foreach}]
</SELECT>[{if !$oView->getModCfgValue('blChangeShop')}] [{oxmultilang ident="D3_GEOIP_DISABLED"}][{/if}]
</td>
</tr>
<tr>
<td class="edittext">
[{oxmultilang ident="D3_GEOIP_SELLANG"}]:
</td>
<td class="edittext">
<SELECT name="editval[oxcountry__d3geoiplang]" class="edittext" [{if !$oView->getModCfgValue('blChangeLang')}]disabled[{/if}]>
<option value="-1">[{oxmultilang ident="D3_GEOIP_CUSTSELLANG"}]</option>
[{foreach from=$oView->getLangList() item=lang}]
<option value="[{$lang->id}]" [{if $edit->oxcountry__d3geoiplang->value == $lang->id}]selected[{/if}]>[{$lang->name}]</option>
[{/foreach}]
</SELECT>[{if !$oView->getModCfgValue('blChangeLang')}] [{oxmultilang ident="D3_GEOIP_DISABLED"}][{/if}]
</td>
</tr>
<tr>
<td class="edittext">
[{oxmultilang ident="D3_GEOIP_SELCUR"}]:
</td>
<td class="edittext">
<SELECT name="editval[oxcountry__d3geoipcur]" class="edittext" [{if !$oView->getModCfgValue('blChangeCurr')}]disabled[{/if}]>
<option value="-1">[{oxmultilang ident="D3_GEOIP_CUSTSELCUR"}]</option>
[{foreach from=$oView->getCurList() item=cur}]
<option value="[{$cur->id}]" [{if $edit->oxcountry__d3geoipcur->value == $cur->id}]selected[{/if}]>[{$cur->name}] ([{$cur->sign}])</option>
[{/foreach}]
</SELECT>[{if !$oView->getModCfgValue('blChangeCurr')}] [{oxmultilang ident="D3_GEOIP_DISABLED"}][{/if}]
</td>
</tr>
<tr>
<td class="edittext"><br><br>
</td>
<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>
</td>
</tr>
</table>
</td>
<td valign="top" class="edittext" align="left" width="10%">
[{oxmultilang ident="D3_GEOIP_OR"}]
</td>
<!-- Anfang rechte Seite -->
<td valign="top" class="edittext" align="left" width="45%">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td class="edittext" width="120">
[{oxmultilang ident="D3_GEOIP_SELURL"}]:
</td>
<td class="edittext">
<input type="text" maxlength="255" size="50" name="editval[oxcountry__d3geoipurl]" value="[{$edit->oxcountry__d3geoipurl->value}]" [{if !$oView->getModCfgValue('blChangeURL')}]disabled[{/if}]> [{if !$oView->getModCfgValue('blChangeURL')}] [{oxmultilang ident="D3_GEOIP_DISABLED"}][{/if}]
[{oxinputhelp ident="D3_GEOIP_SELURL_DESC"}]
</td>
</tr>
</table>
</td>
<!-- Ende rechte Seite -->
</tr>
</table>
</form>
[{include file="bottomnaviitem.tpl"}]
[{include file="bottomitem.tpl"}]