|
|
|
|
|
|
|
|
|
|
|
|
|
|
function features(array $featuresArray, array $featuresAdminArray, User $userCurrent) { |
|
|
function features(array $featuresArray, array $featuresAdminArray, User $userCurrent) { |
|
|
$userModule = UserModule::getInstance(); |
|
|
$userModule = UserModule::getInstance(); |
|
|
if(count($featuresArray) > 0 || count($featuresAdminArray) > 0) { |
|
|
|
|
|
|
|
|
$isGrantedAsUserCurrent = $userModule->getAuthorizationChecker()->isGrantedAsAdministrator($userCurrent); |
|
|
|
|
|
if(count($featuresArray) > 0 || (count($featuresAdminArray) > 0 && $isGrantedAsUserCurrent)) { |
|
|
$html = '<div class="block block-features">'; |
|
|
$html = '<div class="block block-features">'; |
|
|
$html .= '<h4><span class="glyphicon glyphicon-flash"></span> Évolutions</h4>'; |
|
|
$html .= '<h4><span class="glyphicon glyphicon-flash"></span> Évolutions</h4>'; |
|
|
$html .= '<ul>'; |
|
|
$html .= '<ul>'; |
|
|
foreach($featuresArray as $feature) { |
|
|
foreach($featuresArray as $feature) { |
|
|
$html .= '<li>'.$feature.'</li>'; |
|
|
$html .= '<li>'.$feature.'</li>'; |
|
|
} |
|
|
} |
|
|
if($userModule->getAuthorizationChecker()->isGrantedAsAdministrator($userCurrent)) { |
|
|
|
|
|
|
|
|
if($isGrantedAsUserCurrent) { |
|
|
foreach($featuresAdminArray as $feature) { |
|
|
foreach($featuresAdminArray as $feature) { |
|
|
$html .= '<li class="admin">'.$feature.'</li>'; |
|
|
$html .= '<li class="admin">'.$feature.'</li>'; |
|
|
} |
|
|
} |