2022-06-14 12:06:58 +02:00
|
|
|
<?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 <support@shopmodule.com>
|
|
|
|
* @link http://www.oxidmodule.com
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace D3\Bonimascore\Application\Controller\Admin;
|
|
|
|
|
|
|
|
use D3\Bonimascore\Core\d3bonimascore_conf;
|
|
|
|
use D3\ModCfg\Application\Controller\Admin\d3_cfg_mod_main;
|
|
|
|
use D3\ModCfg\Application\Model\Configuration\d3_cfg_mod;
|
|
|
|
use D3\ModCfg\Application\Model\d3database;
|
|
|
|
use D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception;
|
|
|
|
use D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException;
|
|
|
|
use Doctrine\DBAL\DBALException;
|
|
|
|
use OxidEsales\Eshop\Application\Model\Country;
|
|
|
|
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
|
|
|
|
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
|
|
|
|
use OxidEsales\Eshop\Core\Exception\StandardException;
|
|
|
|
use OxidEsales\Eshop\Core\Model\ListModel;
|
|
|
|
use OxidEsales\Eshop\Core\Registry;
|
|
|
|
use PDO;
|
|
|
|
|
|
|
|
class d3bonimascore_config_main extends d3_cfg_mod_main
|
|
|
|
{
|
|
|
|
protected $_sModId = 'd3bonimascore';
|
|
|
|
|
|
|
|
protected $_sBoniversumDebugHelpTextIdent = 'D3_BONIMASCORE_ADMIN_DEBUGACTIVE_DESC';
|
|
|
|
|
|
|
|
protected $_sThisTemplate = 'd3bonimascore_config_main.tpl';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @throws d3ShopCompatibilityAdapterException
|
|
|
|
* @throws d3_cfg_mod_exception
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
* @throws StandardException
|
|
|
|
*/
|
|
|
|
public function save()
|
|
|
|
{
|
|
|
|
parent::save();
|
|
|
|
|
|
|
|
$aData = Registry::getRequest()->getRequestEscapedParameter('oxconfig');
|
|
|
|
if (is_array($aData) && count($aData)) {
|
|
|
|
foreach ($aData as $sName => $sValue) {
|
|
|
|
Registry::getConfig()->saveShopConfVar('str', $sName, $sValue);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach (Registry::getRequest()->getRequestEscapedParameter('config') as $key => $value) {
|
|
|
|
$this->d3GetSettings()->setValue($key, $value);
|
|
|
|
}
|
|
|
|
$this->d3GetSettings()->save();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return d3_cfg_mod|false
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
*/
|
|
|
|
public function d3GetSettings()
|
|
|
|
{
|
|
|
|
return d3_cfg_mod::get($this->d3getModId());
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gibt Liste aktiver Laender zurueck
|
|
|
|
* @return ListModel
|
|
|
|
* @throws DBALException
|
|
|
|
*/
|
2023-09-21 10:41:59 +02:00
|
|
|
public function d3GetCountryList()
|
2022-06-14 12:06:58 +02:00
|
|
|
{
|
|
|
|
$oQB = d3database::getInstance()->getQueryBuilder();
|
|
|
|
$oQB->select('*')
|
|
|
|
->from(oxNew(Country::class)->getViewName())
|
|
|
|
->where('oxactive='.$oQB->createNamedParameter(1, PDO::PARAM_INT));
|
|
|
|
|
|
|
|
/** @var ListModel $oList */
|
|
|
|
$oList = oxNew(ListModel::class);
|
|
|
|
$oList->init(Country::class);
|
|
|
|
$oList->selectString($oQB->getSQL(), $oQB->getParameters());
|
|
|
|
|
|
|
|
return $oList;
|
|
|
|
}
|
|
|
|
|
2023-09-21 10:41:59 +02:00
|
|
|
public function getHasDebugSwitch()
|
2022-06-14 12:06:58 +02:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
2023-09-21 10:41:59 +02:00
|
|
|
public function getDebugHelpTextIdent()
|
2022-06-14 12:06:58 +02:00
|
|
|
{
|
|
|
|
return $this->_sBoniversumDebugHelpTextIdent;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
* @throws StandardException
|
|
|
|
* @throws d3ShopCompatibilityAdapterException
|
|
|
|
* @throws d3_cfg_mod_exception
|
|
|
|
*/
|
2023-09-21 10:41:59 +02:00
|
|
|
public function hasPremiumOption()
|
2022-06-14 12:06:58 +02:00
|
|
|
{
|
|
|
|
return $this->d3GetSettings()->getLicenseConfigData(d3bonimascore_conf::SERIAL_BIT_PREMIUMEDITION, 1);
|
|
|
|
}
|
|
|
|
}
|