Skip to content
Snippets Groups Projects
Commit 321542e4 authored by François Agneray's avatar François Agneray
Browse files

Fixed bug checmin images pour badges

parent d058dc55
No related branches found
No related tags found
No related merge requests found
......@@ -40,11 +40,20 @@ final class DashboardGenerateBadgeAction
// Parametres par defaut
$width = 890;
$height = 600;
$imagefile = './public/images/badge_' . $role . '.png';
$fontroboto = './config/Roboto-Black.ttf';
$fontrobotolight = './config/Roboto-Light.ttf';
$fontTopSecret = './config/top_secret.ttf';
$fontarial = './config/arial.ttf';
$pwd = getcwd();
if(!strpos($pwd, 'public')) {
$imagefile = './public/images/badge_' . $role . '.png';
$fontroboto = './config/Roboto-Black.ttf';
$fontrobotolight = './config/Roboto-Light.ttf';
$fontTopSecret = './config/top_secret.ttf';
$fontarial = './config/arial.ttf';
} else {
$imagefile = '../public/images/badge_' . $role . '.png';
$fontroboto = '../config/Roboto-Black.ttf';
$fontrobotolight = '../config/Roboto-Light.ttf';
$fontTopSecret = '../config/top_secret.ttf';
$fontarial = '../config/arial.ttf';
}
// Création de l'image badge
$image = imagecreatefrompng($imagefile);
......
......@@ -78,11 +78,20 @@ final class DashboardGenerateBadgeListAction
// Parametres par defaut
$width = 890;
$height = 600;
$imagefile = './public/images/badge_' . $role . '.png';
$fontroboto = './config/Roboto-Black.ttf';
$fontrobotolight = './config/Roboto-Light.ttf';
$fontTopSecret = './config/top_secret.ttf';
$fontarial = './config/arial.ttf';
$pwd = getcwd();
if(!strpos($pwd, 'public')) {
$imagefile = './public/images/badge_' . $role . '.png';
$fontroboto = './config/Roboto-Black.ttf';
$fontrobotolight = './config/Roboto-Light.ttf';
$fontTopSecret = './config/top_secret.ttf';
$fontarial = './config/arial.ttf';
} else {
$imagefile = '../public/images/badge_' . $role . '.png';
$fontroboto = '../config/Roboto-Black.ttf';
$fontrobotolight = '../config/Roboto-Light.ttf';
$fontTopSecret = '../config/top_secret.ttf';
$fontarial = '../config/arial.ttf';
}
// Création de l'image badge
$image = imagecreatefrompng($imagefile);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment