View.class.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. class View{
  3. public static function views(){
  4. $views = array();
  5. foreach (glob(__DIR__.SLASH.'view/*.class.php') as $file) {
  6. require_once($file);
  7. $uid = str_replace('.class.php','',basename($file));
  8. $views[] = $uid;
  9. }
  10. return $views;
  11. }
  12. //@TODO: Possibilité de customiser les couleurs disponibles en
  13. //configuration et de laisser celles-ci par défaut si rien n'est défini
  14. public static function colorSet(){
  15. return array(
  16. '#1abc9c',
  17. '#9b59b6',
  18. '#3498db',
  19. '#34495e',
  20. '#f1c40f',
  21. '#e67e22',
  22. '#2ecc71',
  23. '#8e44ad',
  24. '#27ae60',
  25. '#e74c3c',
  26. '#d35400',
  27. '#c0392b',
  28. '#95a5a6',
  29. '#cd84f1',
  30. '#ffcccc',
  31. '#ff4d4d',
  32. '#ffaf40',
  33. '#ff9f1a',
  34. '#ff3838',
  35. '#ffb8b8',
  36. '#c56cf0',
  37. '#7efff5',
  38. '#18dcff',
  39. '#7d5fff',
  40. '#7158e2',
  41. '#17c0eb',
  42. '#3ae374',
  43. '#F8EFBA',
  44. '#3B3B98',
  45. '#FC427B',
  46. '#BDC581',
  47. '#55E6C1',
  48. '#B33771',
  49. '#FEA47F',
  50. '#6D214F',
  51. '#ffdd59',
  52. '#0fbcf9',
  53. '#34e7e4',
  54. '#d2dae2',
  55. '#808e9b',
  56. '#f53b57',
  57. '#474787',
  58. '#ffb142',
  59. '#34ace0',
  60. '#2c2c54',
  61. '#b33939',
  62. '#20bf6b',
  63. '#26de81',
  64. '#fd9644',
  65. '#fc5c65',
  66. '#FFEB3B',
  67. '#FFC107',
  68. '#CDDC39',
  69. '#795548',
  70. '#FF5722',
  71. '#E91E63',
  72. '#673AB7',
  73. '#2196F3',
  74. '#8BC34A',
  75. '#607D8B',
  76. '#9E9E9E',
  77. '#e74c3c',
  78. '#f1c40f',
  79. '#d35400',
  80. '#c0392b',
  81. '#ff7675',
  82. '#00cec9',
  83. '#fd79a8',
  84. '#ffeaa7'
  85. );
  86. }
  87. public static function require_all(){
  88. foreach(glob(__DIR__.SLASH.'view'.SLASH.'*.class.php') as $view) require_once($view);
  89. }
  90. public static function array_depth($array) {
  91. $max_depth = 1;
  92. foreach ($array as $value) {
  93. if (is_array($value)) {
  94. $depth = self::array_depth($value) + 1;
  95. if ($depth > $max_depth) $max_depth = $depth;
  96. }
  97. }
  98. return $max_depth;
  99. }
  100. }
  101. ?>