AppLayouts.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace ThurData\Servers\KerioEmail\Core\UI\Traits;
  3. use \ThurData\Servers\KerioEmail\Core\UI\Helpers\AppLayoutConstants;
  4. use \ThurData\Servers\KerioEmail\Core\UI\Helpers\TemplateConstants;
  5. use \ThurData\Servers\KerioEmail\Core\Helper;
  6. /**
  7. * App Layouts related functions
  8. * View Trat
  9. *
  10. * @autor ThurData <info@thrudata.ch>
  11. */
  12. trait AppLayouts
  13. {
  14. protected $appLayout = AppLayoutConstants::NAVBAR_TOP;
  15. public function getAppLayout()
  16. {
  17. return $this->appLayout;
  18. }
  19. public function setAppLayout($layout)
  20. {
  21. if (in_array($layout, [
  22. AppLayoutConstants::NAVBAR_LEFT,
  23. AppLayoutConstants::NAVBAR_LEFT_THIN,
  24. AppLayoutConstants::NAVBAR_RIGHT,
  25. AppLayoutConstants::NAVBAR_RIGHT_THIN,
  26. AppLayoutConstants::NAVBAR_TOP
  27. ]))
  28. {
  29. $this->appLayout = $layout;
  30. }
  31. return $this;
  32. }
  33. public function getAppLayoutTemplateDir()
  34. {
  35. return \ThurData\Servers\KerioEmail\Core\ModuleConstants::getTemplateDir() . DIRECTORY_SEPARATOR
  36. . (Helper\isAdmin() ? TemplateConstants::ADMIN_PATH : TemplateConstants::CLIENT_PATH . DIRECTORY_SEPARATOR) .
  37. TemplateConstants::MAIN_DIR . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR .'default' . DIRECTORY_SEPARATOR . 'appLayouts';
  38. }
  39. }