Przeglądaj źródła

new info button

andre 5 miesięcy temu
rodzic
commit
5591b1a481

+ 20 - 0
app/UI/Client/Setting/Buttons/InfoButton.php

@@ -0,0 +1,20 @@
+<?php
+
+namespace ThurData\Servers\KerioEmail\App\UI\Client\Setting\Buttons;
+
+use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\TaskHistory\Modals\InfoModal;
+use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Interfaces\ClientArea;
+use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Buttons\ButtonDataTableModalAction;
+
+class InfoButton extends ButtonDataTableModalAction implements ClientArea
+{
+    protected $icon = 'lu-zmdi lu-zmdi-info-outline';
+
+    public function initContent()
+    {
+        $this->initIds('infoButton ');
+        $this->initLoadModalAction(new InfoModal());
+        $this->setDisableByColumnValue("selfdns", "0");
+    }
+
+}

+ 38 - 0
app/UI/Client/Setting/Forms/InfoForm.php

@@ -0,0 +1,38 @@
+<?php
+namespace ThurData\Servers\KerioEmail\App\UI\Client\Setting\Forms;
+
+use ThurData\Servers\KerioEmail\App\Traits\FormExtendedTrait;
+use ThurData\Servers\KerioEmail\App\UI\Admin\Custom\Forms\SortedFieldForm;
+use ThurData\Servers\KerioEmail\App\UI\Client\Setting\Providers\SettingDataProvider;
+use ThurData\Servers\KerioEmail\Core\UI\Interfaces\ClientArea;
+use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Hidden;
+use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Select;
+use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Text;
+use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\FormConstants;
+use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\BaseForm;
+
+
+class InfoForm extends BaseForm implements ClientArea
+{
+    public function initContent()
+    {
+        $this->initIds('infoForm');
+        $this->setFormType('info');
+        $this->setProvider(new SettingDataProvider());
+        $this->initFields();
+        $this->loadDataToForm();
+    }
+
+    public function getAllowedActions()
+    {
+        return ['info'];
+    }
+
+    private function initFields()
+    {
+        $this->setConfirmMessage("error: :status:");
+        $this->addField(new Hidden("seldns"));
+        $this->addField(new Text("mxactive"));
+        $this->addLocalLangReplacements(["status" => null]);
+    }
+}

+ 45 - 0
app/UI/Client/Setting/Modals/InfoModal.php

@@ -0,0 +1,45 @@
+<?php
+/* * ********************************************************************
+*  ProxmoxVPS Product developed. (27.03.19)
+* *
+*
+*  CREATED BY MODULESGARDEN       ->       http://modulesgarden.com
+*  CONTACT                        ->       contact@modulesgarden.com
+*
+*
+* This software is furnished under a license and may be used and copied
+* only  in  accordance  with  the  terms  of such  license and with the
+* inclusion of the above copyright notice.  This software  or any other
+* copies thereof may not be provided or otherwise made available to any
+* other person.  No title to and  ownership of the  software is  hereby
+* transferred.
+*
+*
+* ******************************************************************** */
+
+namespace ModulesGarden\Servers\ProxmoxCloudVps\App\UI\TaskHistory\Modals;
+
+use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\TaskHistory\Forms\InfoForm;
+use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Interfaces\ClientArea;
+use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Buttons\ModalActionButtons\BaseCancelButton;
+use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Modals\ModalConfirmDanger;
+
+class InfoModal extends ModalConfirmDanger implements ClientArea
+{
+
+    public function initContent()
+    {
+        $this->initIds('infoTaskHistoryModal');
+        $this->addForm(new InfoForm());
+    }
+
+    protected function initActionButtons()
+    {
+        if (!empty($this->actionButtons))
+        {
+            return $this;
+        }
+        $this->addActionButton(new BaseCancelButton());
+        return $this;
+    }
+}