|
- <?php
-
- use common\logic\User\User\Wrapper\UserManager;
-
- function version(string $date, array $featuresMaintenanceArray, array $featuresMaintenanceAdminArray = []) {
- release_date($date);
- features($featuresMaintenanceArray[0] ?? [], $featuresMaintenanceAdminArray[0] ?? []);
- maintenance($featuresMaintenanceArray[1] ?? [], $featuresMaintenanceAdminArray[1] ?? []);
- }
-
- function release_date(string $date) {
- $html = '<div class="block block-release-date">';
- $html .= '<h4><span class="glyphicon glyphicon-calendar"></span> Date de sortie</h4>';
- $html .= '<ul><li>'.$date.'</li></ul>';
- $html .= '</div>';
- echo $html;
- }
-
- function features(array $featuresArray, array $featuresAdminArray) {
- $userManager = UserManager::getInstance();
- if(count($featuresArray) > 0 || count($featuresAdminArray) > 0) {
- $html = '<div class="block block-features">';
- $html .= '<h4><span class="glyphicon glyphicon-flash"></span> Évolutions</h4>';
- $html .= '<ul>';
- foreach($featuresArray as $feature) {
- $html .= '<li>'.$feature.'</li>';
- }
- if($userManager->isCurrentAdmin()) {
- foreach($featuresAdminArray as $feature) {
- $html .= '<li class="admin">'.$feature.'</li>';
- }
- }
- $html .= '</ul>';
- $html .= '</div>';
- echo $html;
- }
- }
-
- function maintenance(array $maintenanceArray, array $maintenanceAdminArray) {
- $userManager = UserManager::getInstance();
- if(count($maintenanceArray) > 0 || count($maintenanceAdminArray) > 0) {
- $html = '<div class="block block-maintenance">';
- $html .= '<h4><span class="glyphicon glyphicon-wrench"></span> Maintenance</h4>';
- $html .= '<ul>';
- foreach($maintenanceArray as $maintenance) {
- $html .= '<li>'.$maintenance.'</li>';
- }
- if($userManager->isCurrentAdmin()) {
- foreach ($maintenanceAdminArray as $maintenance) {
- $html .= '<li class="admin">' . $maintenance . '</li>';
- }
- }
- $html .= '</ul>';
- $html .= '</div>';
- echo $html;
- }
- }
|