Files
grzanieplus.pl/plugins/stSantanderRatyPlugin/modules/stSantanderRatyBackend/actions/actions.class.php
2025-03-12 17:06:23 +01:00

36 lines
959 B
PHP

<?php
class stSantanderRatyBackendActions extends autoStSantanderRatyBackendActions
{
public function validateConfig()
{
if ($this->getRequest()->getMethod() == sfRequest::POST)
{
$data = $this->getRequestParameter('config');
if (isset($data['shop_number']) && empty($data['shop_number']))
{
$this->getRequest()->setError('config{shop_number}', 'Proszę uzupełnić pole.');
}
}
return !$this->getRequest()->hasErrors();
}
protected function saveConfig()
{
$result = parent::saveConfig();
if ($this->config->get('enabled'))
{
stPaymentType::get(stSantanderRatyPaymentType::class)->getConfiguration()->enable();
}
else
{
stPaymentType::get(stSantanderRatyPaymentType::class)->getConfiguration()->disable();
}
return $result;
}
}