Conditions | 3 |
Paths | 4 |
Total Lines | 38 |
Code Lines | 25 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | #[Route('/manifest.json', name: 'pwa_manifest')] |
||
17 | public function manifest(ThemeHelper $themeHelper): Response |
||
18 | { |
||
19 | $theme = $themeHelper->getVisualTheme(); |
||
20 | |||
21 | $icon192 = $themeHelper->getThemeAssetUrl('images/pwa-icons/icon-192.png'); |
||
22 | $icon512 = $themeHelper->getThemeAssetUrl('images/pwa-icons/icon-512.png'); |
||
23 | |||
24 | $icons = []; |
||
25 | |||
26 | if (!empty($icon192)) { |
||
27 | $icons[] = [ |
||
28 | 'src' => $icon192, |
||
29 | 'sizes' => '192x192', |
||
30 | 'type' => 'image/png', |
||
31 | ]; |
||
32 | } |
||
33 | |||
34 | if (!empty($icon512)) { |
||
35 | $icons[] = [ |
||
36 | 'src' => $icon512, |
||
37 | 'sizes' => '512x512', |
||
38 | 'type' => 'image/png', |
||
39 | ]; |
||
40 | } |
||
41 | |||
42 | $data = [ |
||
43 | 'name' => 'Chamilo LMS', |
||
44 | 'short_name' => 'Chamilo', |
||
45 | 'start_url' => '/', |
||
46 | 'display' => 'standalone', |
||
47 | 'theme_color' => '#1b4fa0', |
||
48 | 'background_color' => '#ffffff', |
||
49 | 'orientation' => 'portrait-primary', |
||
50 | 'icons' => $icons, |
||
51 | ]; |
||
52 | |||
53 | return $this->json($data); |
||
54 | } |
||
56 |