Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

_macros.php 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. use common\logic\User\User\Wrapper\UserManager;
  3. function version(string $date, array $featuresMaintenanceArray, array $featuresMaintenanceAdminArray = []) {
  4. release_date($date);
  5. features($featuresMaintenanceArray[0] ?? [], $featuresMaintenanceAdminArray[0] ?? []);
  6. maintenance($featuresMaintenanceArray[1] ?? [], $featuresMaintenanceAdminArray[1] ?? []);
  7. }
  8. function release_date(string $date) {
  9. $html = '<div class="block block-release-date">';
  10. $html .= '<h4><span class="glyphicon glyphicon-calendar"></span> Date de sortie</h4>';
  11. $html .= '<ul><li>'.$date.'</li></ul>';
  12. $html .= '</div>';
  13. echo $html;
  14. }
  15. function features(array $featuresArray, array $featuresAdminArray) {
  16. $userManager = UserManager::getInstance();
  17. if(count($featuresArray) > 0) {
  18. $html = '<div class="block block-features">';
  19. $html .= '<h4><span class="glyphicon glyphicon-flash"></span> Évolutions</h4>';
  20. $html .= '<ul>';
  21. foreach($featuresArray as $feature) {
  22. $html .= '<li>'.$feature.'</li>';
  23. }
  24. if($userManager->isCurrentAdmin()) {
  25. foreach($featuresAdminArray as $feature) {
  26. $html .= '<li class="admin">'.$feature.'</li>';
  27. }
  28. }
  29. $html .= '</ul>';
  30. $html .= '</div>';
  31. echo $html;
  32. }
  33. }
  34. function maintenance(array $maintenanceArray, array $maintenanceAdminArray) {
  35. $userManager = UserManager::getInstance();
  36. if(count($maintenanceArray) > 0) {
  37. $html = '<div class="block block-maintenance">';
  38. $html .= '<h4><span class="glyphicon glyphicon-wrench"></span> Maintenance</h4>';
  39. $html .= '<ul>';
  40. foreach($maintenanceArray as $maintenance) {
  41. $html .= '<li>'.$maintenance.'</li>';
  42. }
  43. if($userManager->isCurrentAdmin()) {
  44. foreach ($maintenanceAdminArray as $maintenance) {
  45. $html .= '<li class="admin">' . $maintenance . '</li>';
  46. }
  47. }
  48. $html .= '</ul>';
  49. $html .= '</div>';
  50. echo $html;
  51. }
  52. }