| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- namespace ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Others;
- use ModulesGarden\Servers\ProxmoxVps\Core\Traits\Lang;
- use ModulesGarden\Servers\ProxmoxVps\Core\UI\Builder\BaseContainer;
- use ModulesGarden\Servers\ProxmoxVps\Core\UI\Interfaces\AjaxElementInterface;
- use ModulesGarden\Servers\ProxmoxVps\Core\UI\ResponseTemplates\RawDataJsonResponse;
- /**
- * Class DetailsWidget
- *
- * @author Artur Pilch <artur.pi@modulesgarden.com>
- */
- class DetailsWidget extends BaseContainer implements AjaxElementInterface
- {
- use Lang;
- protected $id = 'detailsWidget';
- protected $name = 'detailsWidget';
- protected $title = 'detailsWidget';
- protected $vueComponent = true;
- protected $defaultVueComponentName = 'mg-details-widget';
- public function initContent()
- {
- }
- public function prepareAjaxData()
- {
- }
- public function getParsedTitle()
- {
- if($this->getRawTitle())
- {
- return $this->getRawTitle();
- }
- if($this->getTitle())
- {
- $this->loadLang();
- return $this->lang->controlerContextTranslate($this->getId() ,$this->getTitle());
- }
- return '';
- }
- public function returnAjaxData()
- {
- $this->prepareAjaxData();
- return (new RawDataJsonResponse([
- 'title' => $this->getParsedTitle(),
- 'data' => $this->data
- ]));
- }
- }
|