Description.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace ThurData\Servers\KerioEmail\App\UI\Admin\Custom\Pages;
  3. use ThurData\Servers\KerioEmail\Core\Helper\BuildUrl;
  4. use ThurData\Servers\KerioEmail\Core\UI\Builder\BaseContainer;
  5. use ThurData\Servers\KerioEmail\Core\UI\Interfaces\ClientArea;
  6. use ThurData\Servers\KerioEmail\Core\UI\Traits\Alerts;
  7. /**
  8. *
  9. * Created by PhpStorm.
  10. * User: Tomasz Bielecki ( tomasz.bi@thurdata.com )
  11. * Date: 03.10.19
  12. * Time: 15:13
  13. * Class Description
  14. */
  15. class Description extends BaseContainer implements ClientArea
  16. {
  17. use Alerts;
  18. protected $id = 'description';
  19. protected $name = 'description';
  20. protected $title = 'description';
  21. protected $description;
  22. public function __construct($baseId = null, $hasAlert = false,$type = null)
  23. {
  24. parent::__construct($baseId);
  25. $this->setTitle($baseId . 'PageTitle');
  26. $this->setDescription($baseId . 'PageDescription');
  27. if($hasAlert)
  28. {
  29. $this->addInternalAlert($baseId . 'AlertDescription',$type);
  30. }
  31. }
  32. public function getDescription()
  33. {
  34. return $this->description;
  35. }
  36. public function setDescription($description)
  37. {
  38. $this->description = $description;
  39. return $this;
  40. }
  41. public function getAssetsUrl()
  42. {
  43. return BuildUrl::getAssetsURL();
  44. }
  45. public function getIcon()
  46. {
  47. $asset = BuildUrl::getAppAssetsURL();
  48. return $asset.DIRECTORY_SEPARATOR.'icons'.DIRECTORY_SEPARATOR.$this->id.'.png';
  49. }
  50. }