Sidebar.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /* * ********************************************************************
  3. * KerioEmail product developed. (Nov 19, 2018)
  4. * *
  5. *
  6. * CREATED BY THURDATA -> http://thurdata.com
  7. * CONTACT -> contact@thurdata.com
  8. *
  9. *
  10. * This software is furnished under a license and may be used and copied
  11. * only in accordance with the terms of such license and with the
  12. * inclusion of the above copyright notice. This software or any other
  13. * copies thereof may not be provided or otherwise made available to any
  14. * other person. No title to and ownership of the software is hereby
  15. * transferred.
  16. *
  17. *
  18. * ******************************************************************** */
  19. namespace ThurData\Servers\KerioEmail\Core\UI\Widget\Sidebar;
  20. use \ThurData\Servers\KerioEmail\Core\UI\Builder\BaseContainer;
  21. /**
  22. * Description of Sidebar
  23. *
  24. * @autor ThurData <info@thrudata.ch>
  25. */
  26. class Sidebar extends BaseContainer
  27. {
  28. use SidebarTrait;
  29. protected $href;
  30. public function __construct($id, $href = null, $order = null)
  31. {
  32. $this->href = $href;
  33. $this->order = $order;
  34. parent::__construct($id);
  35. }
  36. public function getHref()
  37. {
  38. return $this->href;
  39. }
  40. public function setHref($href)
  41. {
  42. $this->href = $href;
  43. return $this;
  44. }
  45. public function get(){
  46. $children =[];
  47. foreach($this->children as $child){
  48. if(!$child->getOrder()){
  49. $children[]= $child;
  50. continue;
  51. }
  52. $children[$child->getOrder()]= $child;
  53. }
  54. ksort($children);
  55. return $children;
  56. }
  57. }