diff --git a/Block/Adminhtml/System/Config/Form/Field/Version.php b/Block/Adminhtml/System/Config/Form/Field/Version.php new file mode 100644 index 00000000..3767f0a7 --- /dev/null +++ b/Block/Adminhtml/System/Config/Form/Field/Version.php @@ -0,0 +1,43 @@ +environmentVersions = $environmentVersions; + parent::__construct( + $context, + $data + ); + } + + protected function _getElementHtml(AbstractElement $element) + { + $element->setDisabled('disabled'); + $element->setValue($this->environmentVersions->getRvvupModuleVersion()); + + return $element->getElementHtml(); + } +} diff --git a/Model/Environment/GetEnvironmentVersions.php b/Model/Environment/GetEnvironmentVersions.php index 5124790a..76c85277 100644 --- a/Model/Environment/GetEnvironmentVersions.php +++ b/Model/Environment/GetEnvironmentVersions.php @@ -146,7 +146,7 @@ private function getCachedEnvironmentVersions(): ?string * * @return string */ - private function getRvvupModuleVersion(): string + public function getRvvupModuleVersion(): string { // Attempt to figure out what plugin version we have depending on installation method $packages = $this->composerInformation->getInstalledMagentoPackages(); diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index cbf3a177..017f66bf 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -19,6 +19,10 @@ Rvvup\Payments\Block\Adminhtml\CredentialValidator + + + Rvvup\Payments\Block\Adminhtml\System\Config\Form\Field\Version + Rvvup\Payments\Model\Config\Env\Indicator