1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-09-01 04:22:11 +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

@@ -17,6 +17,7 @@ use phpbb\config\config;
use phpbb\path_helper;
use phpbb\textformatter\s9e\renderer;
use phpbb\user;
use phpbb\auth\auth;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
@@ -39,17 +40,22 @@ class helper
/** @var user */
protected $user;
/** @var auth */
protected $auth;
/**
* Constructor
*
* @param auth $auth Auth object
* @param config $config Config object
* @param ContainerInterface $container Service container object
* @param path_helper $path_helper Path helper object
* @param renderer $renderer TextFormatter renderer object
* @param user $user User object
*/
public function __construct(config $config, ContainerInterface $container, path_helper $path_helper, renderer $renderer, user $user)
public function __construct(auth $auth, config $config, ContainerInterface $container, path_helper $path_helper, renderer $renderer, user $user)
{
$this->auth = $auth;
$this->config = $config;
$this->container = $container;
$this->path_helper = $path_helper;
@@ -120,6 +126,8 @@ class helper
$this->renderer->set_smilies_path($this->get_board_url() . '/' . $this->config['smilies_path']);
$this->renderer->configure_user($this->user, $this->config, $this->auth);
$content = generate_text_for_display($content, $uid, $bitfield, $options);
// Remove "Select all" link and mouse events