1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[ticket/16366] Make viewtopic lang vars available in feed pages

We call add_lang('viewtopic') in feed controller and configure_user(...)
in generate_content() in order to make viewtopic language constants
avaliable for message parser when it is called from feed controller

PHPBB3-16366
This commit is contained in:
ansavin
2020-05-12 21:43:40 +03:00
committed by Marc Alexander
parent 05a58e8942
commit b3199265a2
4 changed files with 22 additions and 3 deletions

View File

@@ -25,6 +25,7 @@ use phpbb\feed\helper as feed_helper;
use phpbb\controller\helper as controller_helper;
use phpbb\symfony_request;
use phpbb\user;
use phpbb\language\language;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
@@ -87,6 +88,11 @@ class feed
*/
protected $php_ext;
/**
* @var language
*/
protected $language;
/**
* Constructor
*
@@ -100,9 +106,10 @@ class feed
* @param user $user
* @param auth $auth
* @param dispatcher_interface $phpbb_dispatcher
* @param language $language
* @param string $php_ext
*/
public function __construct(Environment $twig, symfony_request $request, controller_helper $controller_helper, config $config, driver_interface $db, ContainerInterface $container, feed_helper $feed_helper, user $user, auth $auth, dispatcher_interface $phpbb_dispatcher, $php_ext)
public function __construct(Environment $twig, symfony_request $request, controller_helper $controller_helper, config $config, driver_interface $db, ContainerInterface $container, feed_helper $feed_helper, user $user, auth $auth, dispatcher_interface $phpbb_dispatcher, language $language, $php_ext)
{
$this->request = $request;
$this->controller_helper = $controller_helper;
@@ -114,6 +121,7 @@ class feed
$this->auth = $auth;
$this->php_ext = $php_ext;
$this->template = $twig;
$this->language = $language;
$this->phpbb_dispatcher = $phpbb_dispatcher;
}
@@ -296,6 +304,7 @@ class feed
{
$feed_updated_time = 0;
$item_vars = array();
$this->language->add_lang('viewtopic');
$board_url = $this->feed_helper->get_board_url();