1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-01 17:38:38 +00:00

Make wallabag_url a Twig global

This commit is contained in:
Yassine Guedidi 2025-01-11 02:09:07 +01:00
parent 09dcee3fc6
commit b921abf173
4 changed files with 3 additions and 15 deletions

View file

@ -60,6 +60,7 @@ twig:
form_themes: form_themes:
- "@SpiriitFormFilter/Form/form_div_layout.html.twig" - "@SpiriitFormFilter/Form/form_div_layout.html.twig"
globals: globals:
wallabag_url: '%domain_name%'
registration_enabled: '%fosuser_registration%' registration_enabled: '%fosuser_registration%'
# Doctrine Configuration # Doctrine Configuration

View file

@ -103,8 +103,6 @@ class DeveloperController extends AbstractController
*/ */
public function howtoFirstAppAction() public function howtoFirstAppAction()
{ {
return $this->render('Developer/howto_app.html.twig', [ return $this->render('Developer/howto_app.html.twig');
'wallabag_url' => $this->getParameter('domain_name'),
]);
} }
} }

View file

@ -257,7 +257,6 @@ class ConfigController extends AbstractController
'username' => $user->getUsername(), 'username' => $user->getUsername(),
'token' => $config->getFeedToken(), 'token' => $config->getFeedToken(),
], ],
'wallabag_url' => $this->getParameter('domain_name'),
'enabled_users' => $userRepository->getSumEnabledUsers(), 'enabled_users' => $userRepository->getSumEnabledUsers(),
]); ]);
} }

View file

@ -50,27 +50,18 @@ class AuthCodeMailer implements AuthCodeMailerInterface
*/ */
private $supportUrl; private $supportUrl;
/**
* Url for the wallabag instance (only used for image in the HTML email template).
*
* @var string
*/
private $wallabagUrl;
/** /**
* @param string $senderEmail * @param string $senderEmail
* @param string $senderName * @param string $senderName
* @param string $supportUrl wallabag support url * @param string $supportUrl wallabag support url
* @param string $wallabagUrl wallabag instance url
*/ */
public function __construct(MailerInterface $mailer, Environment $twig, $senderEmail, $senderName, $supportUrl, $wallabagUrl) public function __construct(MailerInterface $mailer, Environment $twig, $senderEmail, $senderName, $supportUrl)
{ {
$this->mailer = $mailer; $this->mailer = $mailer;
$this->twig = $twig; $this->twig = $twig;
$this->senderEmail = $senderEmail; $this->senderEmail = $senderEmail;
$this->senderName = $senderName; $this->senderName = $senderName;
$this->supportUrl = $supportUrl; $this->supportUrl = $supportUrl;
$this->wallabagUrl = $wallabagUrl;
} }
/** /**
@ -85,7 +76,6 @@ class AuthCodeMailer implements AuthCodeMailerInterface
'user' => $user->getName(), 'user' => $user->getName(),
'code' => $user->getEmailAuthCode(), 'code' => $user->getEmailAuthCode(),
'support_url' => $this->supportUrl, 'support_url' => $this->supportUrl,
'wallabag_url' => $this->wallabagUrl,
]); ]);
$bodyText = $template->renderBlock('body_text', [ $bodyText = $template->renderBlock('body_text', [
'user' => $user->getName(), 'user' => $user->getName(),