InfoWidget.php 869 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Others;
  3. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Builder\BaseContainer;
  4. /**
  5. * InfoWidget
  6. *
  7. * @author Sławomir Miśkowicz <slawomir@modulesgarden.com>
  8. */
  9. class InfoWidget extends BaseContainer
  10. {
  11. protected $name = 'infoWidget';
  12. protected $id = 'infoWidget';
  13. protected $title = 'infoWidgetTitle';
  14. public function initContent()
  15. {
  16. $this->setMessage('Test');
  17. }
  18. public function setMessage($message, $isRaw = false, $htmlTagsAllowed = false)
  19. {
  20. $description = new ModuleDescription($this->getId() . '_desc');
  21. $description->setDescription($message);
  22. $description->setRaw($isRaw);
  23. if ($htmlTagsAllowed)
  24. {
  25. $description->allowHtmlTags();
  26. }
  27. $this->addElement($description);
  28. }
  29. }