mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-10 18:34:32 +02:00
Use language setting of users when logging in.
This commit is contained in:
parent
0dd20394cb
commit
0bfcec77fb
9 changed files with 97 additions and 8 deletions
|
@ -78,7 +78,8 @@ class AppExtension extends AbstractExtension
|
|||
new TwigFilter('bbCode', [$this, 'parseBBCode'], ['pre_escape' => 'html', 'is_safe' => ['html']]),
|
||||
new TwigFilter('moneyFormat', [$this, 'formatCurrency']),
|
||||
new TwigFilter('siFormat', [$this, 'siFormat']),
|
||||
new TwigFilter('amountFormat', [$this, 'amountFormat'])
|
||||
new TwigFilter('amountFormat', [$this, 'amountFormat']),
|
||||
new TwigFilter('loginPath', [$this, 'loginPath'])
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -104,6 +105,19 @@ class AppExtension extends AbstractExtension
|
|||
return $this->serializer->serialize($tree, 'json', ['skip_null_values' => true]);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function/filter generates an path
|
||||
* @param string $path
|
||||
* @return string
|
||||
*/
|
||||
public function loginPath(string $path) : string
|
||||
{
|
||||
$parts = explode("/" ,$path);
|
||||
//Remove the part with
|
||||
unset($parts[1]);
|
||||
return implode("/", $parts);
|
||||
}
|
||||
|
||||
public function generateEntityURL(DBElement $entity, string $method = 'info'): string
|
||||
{
|
||||
return $this->entityURLGenerator->getURL($entity, $method);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue