This commit is contained in:
2026-09-15 10:35:56 +08:00
commit 782f8ea7aa
4086 changed files with 631288 additions and 0 deletions
@@ -0,0 +1,53 @@
<?php
declare(strict_types=1);
namespace Esun\Catalog\Block\Adminhtml\MixStepPricing;
use Esun\Catalog\Model\MixStepPricing\ValidationState;
use Magento\Backend\Block\Template;
use Magento\Backend\Block\Template\Context;
class Form extends Template
{
protected $_template = 'Esun_Catalog::mix_step_pricing/form.phtml';
public function __construct(
Context $context,
private readonly ValidationState $validationState,
array $data = []
) {
parent::__construct($context, $data);
}
public function isDelete(): bool
{
return $this->getMode() === 'delete';
}
public function getMode(): string
{
return (string)$this->getData('mode');
}
public function getValidationState(): array
{
return $this->validationState->get($this->getMode());
}
public function getValidateUrl(): string
{
return $this->getUrl('esun_catalog/mixsteppricing/' . ($this->isDelete() ? 'validateDelete' : 'validateImport'));
}
public function getRunUrl(): string
{
return $this->getUrl('esun_catalog/mixsteppricing/' . ($this->isDelete() ? 'runDelete' : 'runImport'));
}
public function getTemplateUrl(): string
{
return $this->getUrl(
'esun_catalog/mixsteppricing/' . ($this->isDelete() ? 'downloadDeleteTemplate' : 'downloadImportTemplate')
);
}
}