Browse Source

fix #9: apply a patch to correctly generate an image path

pull/32/head
Simon Vieille 11 months ago
parent
commit
0495046d02
Signed by: deblan GPG Key ID: 03383D15A1D31745
2 changed files with 1 additions and 6 deletions
  1. +0
    -5
      lib/Controller/CssController.php
  2. +1
    -1
      templates/css/stylesheet.php

+ 0
- 5
lib/Controller/CssController.php View File

@ -51,10 +51,6 @@ class CssController extends Controller
*/
public function stylesheet()
{
$requestUri = $this->request->server['REQUEST_URI'];
$assetsRoot = str_replace('/index.php', '', $requestUri);
$assetsRoot = preg_replace('#apps/side_menu/.*#s', 'apps/side_menu', $assetsRoot);
$parameters = [
'vars' => [
'background-color' => $this->config->getAppValue('side_menu', 'background-color', '#333333'),
@ -63,7 +59,6 @@ class CssController extends Controller
'opener' => $this->config->getAppValue('side_menu', 'opener', 'side-menu-opener'),
],
'display-logo' => (bool) $this->config->getAppValue('side_menu', 'display-logo', 1),
'assetsRoot' => $assetsRoot,
];
$response = new TemplateResponse('side_menu', 'css/stylesheet', $parameters, 'blank');


+ 1
- 1
templates/css/stylesheet.php View File

@ -1,7 +1,7 @@
:root {
<?php foreach ($_['vars'] as $key => $value): ?>
<?php if ($key === 'opener'): ?>
--side-menu-<?php echo $key ?>: url('<?php echo $_['assetsRoot'] ?>/img/<?php echo $value ?>.svg');
--side-menu-<?php echo $key ?>: url('<?php print_unescaped(image_path('side_menu', $value.'.svg')); ?>');
<?php else: ?>
--side-menu-<?php echo $key ?>: <?php echo $value ?>;
<?php endif; ?>


Loading…
Cancel
Save