first commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace KupShop\POSBundle\Admin\Tabs;
|
||||
|
||||
use KupShop\AdminBundle\Admin\WindowTab;
|
||||
|
||||
class PosTerminalSettingsTab extends WindowTab
|
||||
{
|
||||
protected $title = 'flapPosTerminalSettings';
|
||||
protected $template = 'window/PosTerminalSettings.tpl';
|
||||
|
||||
public function handleUpdate(): void
|
||||
{
|
||||
$data = getVal('data');
|
||||
if ($data['data']['terminal']['ip'] && !filter_var($data['data']['terminal']['ip'] ?? false, FILTER_VALIDATE_IP) !== false) {
|
||||
$this->getWindow()->addError(translate('invalid_ip', 'posSettings'));
|
||||
}
|
||||
}
|
||||
|
||||
public function getLabel()
|
||||
{
|
||||
return translate($this->title, 'posSettings');
|
||||
}
|
||||
|
||||
public static function getTypes(): array
|
||||
{
|
||||
return [
|
||||
'posSettings' => 1,
|
||||
];
|
||||
}
|
||||
|
||||
public static function isAllowed()
|
||||
{
|
||||
return findModule(\Modules::NEW_POS, \Modules::SUB_TERMINAL);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user