From be63bc8e1c0dde72ef57a578905ab1546dfdd30b Mon Sep 17 00:00:00 2001 From: dholi Date: Fri, 1 Oct 2021 10:58:03 -0300 Subject: [PATCH] Docs --- .../Adminhtml/System/Config/Documentation.php | 26 ++++++++ .../Adminhtml/System/Config/Information.php | 59 ------------------- .../System/Config/InstalledVersion.php | 35 +++++++++++ src/module-bling/etc/adminhtml/system.xml | 14 ++++- 4 files changed, 72 insertions(+), 62 deletions(-) create mode 100644 src/module-bling/Block/Adminhtml/System/Config/Documentation.php delete mode 100644 src/module-bling/Block/Adminhtml/System/Config/Information.php create mode 100644 src/module-bling/Block/Adminhtml/System/Config/InstalledVersion.php diff --git a/src/module-bling/Block/Adminhtml/System/Config/Documentation.php b/src/module-bling/Block/Adminhtml/System/Config/Documentation.php new file mode 100644 index 0000000..d38bef7 --- /dev/null +++ b/src/module-bling/Block/Adminhtml/System/Config/Documentation.php @@ -0,0 +1,26 @@ +' . __('Documentation') . ''; + } +} diff --git a/src/module-bling/Block/Adminhtml/System/Config/Information.php b/src/module-bling/Block/Adminhtml/System/Config/Information.php deleted file mode 100644 index aefb71c..0000000 --- a/src/module-bling/Block/Adminhtml/System/Config/Information.php +++ /dev/null @@ -1,59 +0,0 @@ -_getHeaderHtml($element); - $html .= $this->getUserGuide($element); - $html .= $this->_getFooterHtml($element); - $html = preg_replace('(onclick=\"Fieldset.toggleCollapse.*?\")', '', $html); - - return $html; - } - - private function getUserGuide($fieldset) { - return $this->getFieldHtml($fieldset, 'magento_path', __('User Guide'), $this->userGuide); - } - - protected function getFieldHtml($fieldset, $fieldName, $label = '', $value = '') { - $field = $fieldset->addField($fieldName, 'label', [ - 'name' => 'dummy', - 'label' => $label, - 'after_element_html' => $value, - ])->setRenderer($this->getFieldRenderer()); - - return $field->toHtml(); - } - - private function getFieldRenderer() { - if (empty($this->fieldRenderer)) { - $this->fieldRenderer = $this->_layout->createBlock(Field::class); - } - - return $this->fieldRenderer; - } - -} diff --git a/src/module-bling/Block/Adminhtml/System/Config/InstalledVersion.php b/src/module-bling/Block/Adminhtml/System/Config/InstalledVersion.php new file mode 100644 index 0000000..437187a --- /dev/null +++ b/src/module-bling/Block/Adminhtml/System/Config/InstalledVersion.php @@ -0,0 +1,35 @@ +create(ModuleResource::class); + + $dbVersion = (string)$moduleResource->getDbVersion('Eloom_Bling'); + + $element->setValue($dbVersion); + + return '' . $element->getEscapedValue() . ' - [' . __('Releases') . ']'; + } +} diff --git a/src/module-bling/etc/adminhtml/system.xml b/src/module-bling/etc/adminhtml/system.xml index 50a8ad1..1076bf5 100644 --- a/src/module-bling/etc/adminhtml/system.xml +++ b/src/module-bling/etc/adminhtml/system.xml @@ -9,10 +9,18 @@ eloom Eloom_Bling::config - + - Eloom\Bling\Block\Adminhtml\System\Config\Information + + + + Eloom\Bling\Block\Adminhtml\System\Config\InstalledVersion + + + + + Eloom\Bling\Block\Adminhtml\System\Config\Documentation +