This commit is contained in:
Daniel Seifert 2015-12-21 13:28:34 +00:00
parent 8a8922e827
commit ddd6c86299
6 changed files with 67 additions and 46 deletions

3
.gitattributes vendored
View File

@ -2,6 +2,7 @@
/Doxyfile -text
copy_this/.noencode -text
copy_this/modules/d3/d3geoip/IntelliSenseHelper.php -text
copy_this/modules/d3/d3geoip/components/d3cmp_geoip.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_list.php -text
@ -10,8 +11,6 @@ copy_this/modules/d3/d3geoip/controllers/admin/d3_country_geoip.php -text
copy_this/modules/d3/d3geoip/menu.xml -text
copy_this/modules/d3/d3geoip/metadata.php -text
copy_this/modules/d3/d3geoip/models/d3geoip.php -text
copy_this/modules/d3/d3geoip/modules/components/d3_oxcmp_cur_geoip.php -text
copy_this/modules/d3/d3geoip/modules/components/d3_oxcmp_lang_geoip.php -text
copy_this/modules/d3/d3geoip/picture.png -text
copy_this/modules/d3/d3geoip/setup/d3geoip_update.php -text
copy_this/modules/d3/d3geoip/views/admin/de/d3_geoip_lang.php -text

View File

@ -1 +1 @@
copyAsIsFiles = modules/d3/d3geoip/controllers, modules/d3/d3geoip/models/d3geoip_update.php, modules/d3/d3geoip/modules/components, modules/d3/d3geoip/views, modules/d3/d3geoip/d3_geoip_stub.php, modules/d3/d3geoip/metadata.php
copyAsIsFiles = modules/d3/d3geoip/components, modules/d3/d3geoip/controllers, modules/d3/d3geoip/models/d3geoip_update.php, modules/d3/d3geoip/views, modules/d3/d3geoip/IntelliSenseHelper.php, modules/d3/d3geoip/metadata.php

View File

@ -1,5 +1,4 @@
<?php
/**
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
@ -10,12 +9,20 @@
*
* http://www.shopmodule.com
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <ds@shopmodule.com>
* @copyright © Data Development, Thomas Dartsch
* @author D³ Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3_oxcmp_cur_geoip extends d3_oxcmp_cur_geoip_parent
class d3cmp_geoip extends oxView
{
/**
* Marking object as component
*
* @var bool
*/
protected $_blIsComponent = true;
private $_sModId = 'd3_geoip';
/**
@ -33,8 +40,9 @@ class d3_oxcmp_cur_geoip extends d3_oxcmp_cur_geoip_parent
/** @var $oLocation d3geoip */
$oLocation = oxNew('d3geoip');
$oLocation->setCountryCurrency();
$oLocation->setCountryLanguage();
}
parent::init();
}
}
}

View File

@ -19,11 +19,9 @@ $aModule = array(
'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',
),
'extend' => array(),
'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',

View File

@ -1,34 +0,0 @@
<?php
/**
* 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
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
*
* http://www.shopmodule.com
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3_oxcmp_lang_geoip extends d3_oxcmp_lang_geoip_parent
{
private $_sModId = "d3_geoip";
/**
* @return null
*/
public function init()
{
if (d3_cfg_mod::get($this->_sModId)->isActive()) {
/** @var $oLocation d3geoip */
$oLocation = oxNew('d3geoip');
$oLocation->setCountryLanguage();
}
parent::init();
}
}

View File

@ -42,6 +42,8 @@ zQ9';
'do' => 'fixIndizes'),
array('check' => 'hasUnregisteredFiles',
'do' => 'showUnregisteredFiles'),
array('check' => 'checkRegisteredComponent',
'do' => 'registerComponent'),
array('check' => 'checkModCfgSameRevision',
'do' => 'updateModCfgSameRevision'),
);
@ -405,4 +407,52 @@ zQ9';
{
return $this->_showUnregisteredFiles('d3geoip', array('d3FileRegister'));
}
/**
* @return bool
*/
public function checkRegisteredComponent()
{
$sVarName = 'aUserComponentNames';
$sModuleId = '';
/** @var $oShop oxshop */
foreach ($this->getShopListByActiveModule('d3geoip') as $oShop) {
/** @var array $aUserComponents */
$aUserComponents = oxRegistry::getConfig()->getShopConfVar($sVarName, $oShop->getId(), $sModuleId);
if (false == $aUserComponents
|| false == $aUserComponents['d3cmp_geoip']
) {
return true;
}
}
return false;
}
/**
* @return bool
*/
public function registerComponent()
{
$blRet = true;
$sVarName = 'aUserComponentNames';
$sModuleId = '';
/** @var $oShop oxshop */
foreach ($this->getShopList() as $oShop) {
$aUserComponents = oxRegistry::getConfig()->getShopConfVar($sVarName, $oShop->getId(), $sModuleId);
if (false == $aUserComponents) {
$aUserComponents = array();
}
if (false == $aUserComponents['d3cmp_geoip']) {
$blDontUseCache = 1;
$aUserComponents['d3cmp_geoip'] = $blDontUseCache;
$this->fixOxconfigVariable($sVarName, $oShop->getId(), '', $aUserComponents, 'arr');
}
}
return $blRet;
}
}