Title.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. namespace ModulesGarden\Servers\ProxmoxVps\Core\UI\Traits;
  3. // to do disable title
  4. /**
  5. * Title elements related functions
  6. *
  7. * @author Sławomir Miśkowicz <slawomir@modulesgarden.com>
  8. */
  9. trait Title
  10. {
  11. protected $title = null;
  12. protected $titleRaw = null;
  13. protected $showTitle = true;
  14. public function setTitle($title)
  15. {
  16. if (is_string($title) && $title !== '')
  17. {
  18. $this->title = $title;
  19. }
  20. return $this;
  21. }
  22. public function setRawTitle($title)
  23. {
  24. if (is_string($title) && $title !== '')
  25. {
  26. $this->titleRaw = $title;
  27. }
  28. return $this;
  29. }
  30. public function isRawTitle()
  31. {
  32. if ($this->titleRaw !== null)
  33. {
  34. return true;
  35. }
  36. return false;
  37. }
  38. public function getRawTitle()
  39. {
  40. return $this->titleRaw;
  41. }
  42. public function getTitle()
  43. {
  44. return $this->title;
  45. }
  46. public function setShowTitle()
  47. {
  48. $this->showTitle = true;
  49. }
  50. public function unsetShowTitle()
  51. {
  52. $this->showTitle = false;
  53. }
  54. public function isShowTitle()
  55. {
  56. return $this->showTitle;
  57. }
  58. }