Skip to content

Commit

Permalink
feat: core-mstile
Browse files Browse the repository at this point in the history
  • Loading branch information
theus77 committed Oct 10, 2023
1 parent 1a4fbb6 commit f39296d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function indexImagesAction(): Response
]);
}

public function icon(Request $request, int $width, int $height): Response
public function icon(Request $request, int $width, int $height, string $background = null): Response
{
if ($width !== $height) {
throw new NotFoundHttpException('File not found');
Expand All @@ -184,7 +184,7 @@ public function icon(Request $request, int $width, int $height): Response
EmsFields::ASSET_CONFIG_WIDTH => $width,
EmsFields::ASSET_CONFIG_HEIGHT => $height,
EmsFields::ASSET_CONFIG_QUALITY => 0,
EmsFields::ASSET_CONFIG_BACKGROUND => "ems-$this->themeColor",
EmsFields::ASSET_CONFIG_BACKGROUND => $background ?? "ems-$this->themeColor",
EmsFields::ASSET_CONFIG_RADIUS => $width / 6,
EmsFields::ASSET_CONFIG_BORDER_COLOR => '#000000FF',
]);
Expand Down
7 changes: 7 additions & 0 deletions EMS/core-bundle/src/Resources/config/routing/icons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
<requirement key="width">192|256|512</requirement>
<requirement key="height">192|256|512</requirement>
</route>
<route id="core-mstile" path="mstile-{width}x{height}.png"
controller="EMS\CoreBundle\Controller\ContentManagement\FileController::icon"
methods="GET|HEAD">
<requirement key="width">150</requirement>
<requirement key="height">150</requirement>
<default key="background">000000FF</default>
</route>
<route id="core-browserconfig" path="browserconfig.xml"
controller="EMS\CoreBundle\Controller\ContentManagement\FileController::browserConfig"
methods="GET|HEAD">
Expand Down
1 change: 1 addition & 0 deletions elasticms-admin/config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ security:
- { path: ^/favicon.ico$, role: PUBLIC_ACCESS }
- { path: ^/apple\-touch\-icon\.png$, role: PUBLIC_ACCESS }
- { path: ^/favicon\-(16|32|48|64|128|256)x(16|32|48|64|128|256)\.png$, role: PUBLIC_ACCESS }
- { path: ^/mstile\-(150)x(150)\.png$, role: PUBLIC_ACCESS }
- { path: ^/android\-chrome\-(192|256|512)x(192|256|512).png$, role: PUBLIC_ACCESS }
- { path: ^/browserconfig\.xml$, role: PUBLIC_ACCESS }
- { path: ^/site\.webmanifest, role: PUBLIC_ACCESS }
Expand Down
Binary file removed elasticms-admin/public/mstile-150x150.png
Binary file not shown.

0 comments on commit f39296d

Please sign in to comment.