fix small issues

This commit is contained in:
Daniel Seifert 2016-11-21 15:34:21 +00:00
parent c69f491005
commit 60bfcad932
5 changed files with 14 additions and 51 deletions

View File

@ -25,9 +25,6 @@ class d3cmp_geoip extends oxView
private $_sModId = 'd3_geoip';
/**
* @return null
*/
public function init()
{
if (d3_cfg_mod::get($this->_sModId)->isActive()) {

View File

@ -20,6 +20,9 @@ class d3_cfg_geoipset_main extends d3_cfg_mod_main
protected $_sThisTemplate = "d3_cfg_geoipset_main.tpl";
protected $_blHasDebugSwitch = true;
protected $_sDebugHelpTextIdent = 'D3_GEOIP_SET_DEBUG_DESC';
protected $_sMenuItemTitle = 'd3mxgeoip';
protected $_sMenuSubItemTitle = 'd3mxgeoip_settings';
public $oCountryList;
/**
* @param $sIP
@ -44,46 +47,30 @@ class d3_cfg_geoipset_main extends d3_cfg_mod_main
return $sTitle;
}
/**
* @return oxcountrylist
*/
public function getCountryList()
{
startProfile(__METHOD__);
/** @var $oCountryList oxcountrylist */
$oCountryList = oxNew('oxcountrylist');
$oListObject = $oCountryList->getBaseObject();
$sFieldList = $oListObject->getSelectFields();
$sQ = "select $sFieldList from " . $oListObject->getViewName();
$oCountryList->selectString($sQ);
stopProfile(__METHOD__);
return $oCountryList;
}
/**
* @return oxcountrylist
*/
public function getIPCountryList()
{
startProfile(__METHOD__);
if ($this->oCountryList) {
return $this->oCountryList;
}
startProfile(__METHOD__);
/** @var $oGeoIp d3geoip */
$oGeoIp = oxNew('d3geoip');
/** @var $oCountryList oxcountrylist */
$oCountryList = oxNew('oxcountrylist');
$oListObject = $oCountryList->getBaseObject();
$this->oCountryList = oxNew('oxcountrylist');
$oListObject = $this->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);
$this->oCountryList->selectString($sQ);
stopProfile(__METHOD__);
return $oCountryList;
return $this->oCountryList;
}
}

View File

@ -22,7 +22,6 @@ class d3_oxshopcontrol_geoip extends d3_oxshopcontrol_geoip_parent
* @param null $sFunction
* @param null $aParams
* @param null $aViewsChain
* @return null
*/
public function start ($sClass = null, $sFunction = null, $aParams = null, $aViewsChain = null)
{
@ -33,8 +32,6 @@ class d3_oxshopcontrol_geoip extends d3_oxshopcontrol_geoip_parent
/**
* check, if developer mode has to be enabled
*
* @return bool
*/
protected function _d3AddGeoIpComponent()
{

View File

@ -21,7 +21,7 @@ $iLangNr = 0;
// -------------------------------
$aLang = array(
'charset' => 'ISO-8859-15',
'd3mxgeoip' => 'GeoIP',
'd3mxgeoip' => "<i class='fa fa-globe'></i> GeoIP",
'd3mxgeoip_settings' => 'Einstellungen',
'd3tbclgeoip_settings_main' => 'Grundeinstellungen',
'tbclcountry_geoip' => 'GeoIP-Kundenumleitungen',

View File

@ -126,7 +126,6 @@ td.edittext {
<input id="blChangeShop" 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>
@ -137,7 +136,6 @@ td.edittext {
<input id="blChangeCurr" 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>
@ -148,7 +146,6 @@ td.edittext {
<input id="blChangeLang" 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>
@ -159,7 +156,6 @@ td.edittext {
<input id="blChangeURL" 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>
@ -169,13 +165,12 @@ td.edittext {
</dt>
<dd>
<select id="sFallbackCountryId" size="5" name="value[sFallbackCountryId]">
[{foreach from=$oView->getCountryList() item="oCountry"}]
[{foreach from=$oView->getIPCountryList() 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>
@ -197,7 +192,6 @@ td.edittext {
<input id="sTestIp" type="text" maxlength="39" 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>
@ -213,7 +207,6 @@ td.edittext {
</select>
[{oxinputhelp ident="D3_GEOIP_SET_IP_TESTCOUNTRY_DESC"}]
</dd>
<div class="spacer"></div>
</dl>
<dl>
<dt>
@ -227,7 +220,6 @@ td.edittext {
[{$oView->getIpCountry($edit->getValue('sCheckIp'))}]
[{/if}]
</dd>
<div class="spacer"></div>
</dl>
</div>
</div>
@ -247,14 +239,4 @@ td.edittext {
</table>
</form>
[{include file="d3_cfg_mod_inc.tpl"}]
<script type="text/javascript">
if (parent.parent) {
parent.parent.sShopTitle = "[{$actshopobj->oxshops__oxname->getRawValue()|oxaddslashes}]";
parent.parent.sMenuItem = "[{oxmultilang ident="d3mxgeoip"}]";
parent.parent.sMenuSubItem = "[{oxmultilang ident="d3mxgeoip_settings"}]";
parent.parent.sWorkArea = "[{$_act}]";
parent.parent.setTitle();
}
</script>
[{include file="d3_cfg_mod_inc.tpl"}]