Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions acp/usu.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ class usu
/** @var string */
protected $php_ext;

/** @var \phpbb\language\language */
protected $language;

var $u_action;
var $new_config = array();
var $dyn_select = array();
Expand All @@ -54,7 +57,7 @@ class usu

function main($id, $mode)
{
global $config, $db, $user, $template, $request;
global $config, $db, $user, $template, $request, $language;
global $phpbb_root_path, $phpbb_admin_path, $phpEx;
global $phpbb_container;

Expand All @@ -66,6 +69,7 @@ function main($id, $mode)
$this->user = $user;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $phpEx;
$this->language = $language;

$this->user->add_lang_ext('phpbbseo/usu', 'acp_usu');

Expand Down Expand Up @@ -137,7 +141,7 @@ function main($id, $mode)
case 'settings':

$display_vars['title'] = 'ACP_PHPBB_SEO_CLASS';
$this->user->lang['ACP_PHPBB_SEO_CLASS_EXPLAIN'] = sprintf($this->user->lang['ACP_PHPBB_SEO_CLASS_EXPLAIN'], $this->modrtype_lang['ulink'], $this->modrtype_lang['uforumlink'], '</p><hr/><p><b>' . $this->user->lang['ACP_PHPBB_SEO_MODE'] . ' : ' . $this->modrtype_lang['link'] . ' - ( ' . $this->modrtype_lang['forumlink'] . ' )</b></p><hr/><p>');
$this->language['ACP_PHPBB_SEO_CLASS_EXPLAIN'] = sprintf($this->language['ACP_PHPBB_SEO_CLASS_EXPLAIN'], $this->modrtype_lang['ulink'], $this->modrtype_lang['uforumlink'], '</p><hr/><p><b>' . $this->language['ACP_PHPBB_SEO_MODE'] . ' : ' . $this->modrtype_lang['link'] . ' - ( ' . $this->modrtype_lang['forumlink'] . ' )</b></p><hr/><p>');
$display_vars['vars'] = array();
$i = 2;
$display_vars['vars']['legend1'] = 'ACP_PHPBB_SEO_CLASS';
Expand Down Expand Up @@ -225,7 +229,7 @@ function main($id, $mode)
}

$display_vars['title'] = 'ACP_FORUM_URL';
$this->user->lang['ACP_FORUM_URL_EXPLAIN'] .= '</p><hr/><p><b>' . $this->user->lang['ACP_PHPBB_SEO_VERSION'] . ' : ' . $this->modrtype_lang['link'] . ' - ( ' . $this->modrtype_lang['forumlink'] . ' )</b></p><hr/><p>';
$this->language['ACP_FORUM_URL_EXPLAIN'] = $this->user->lang['ACP_FORUM_URL_EXPLAIN'] . '</p><hr/><p><b>' . $this->user->lang['ACP_PHPBB_SEO_VERSION'] . ' : ' . $this->modrtype_lang['link'] . ' - ( ' . $this->modrtype_lang['forumlink'] . ' )</b></p><hr/><p>';
$display_vars['vars'] = array();
$display_vars['vars']['legend1'] = 'ACP_FORUM_URL';

Expand Down Expand Up @@ -320,7 +324,7 @@ function main($id, $mode)
case 'server':

$display_vars['title'] = 'ACP_REWRITE_CONF';
$this->user->lang['ACP_REWRITE_CONF_EXPLAIN'] .= '</p><hr/><p><b>' . $this->user->lang['ACP_PHPBB_SEO_VERSION'] . ' : ' . $this->modrtype_lang['link'] . ' - ( ' . $this->modrtype_lang['forumlink'] . ' )</b></p><p>';
$this->language['ACP_REWRITE_CONF_EXPLAIN'] = $this->language['ACP_REWRITE_CONF_EXPLAIN'] . '</p><hr/><p><b>' . $this->user->lang['ACP_PHPBB_SEO_VERSION'] . ' : ' . $this->modrtype_lang['link'] . ' - ( ' . $this->modrtype_lang['forumlink'] . ' )</b></p><p>';
$display_vars['vars'] = array();
$display_vars['vars']['legend1'] = 'ACP_REWRITE_CONF';
if ($this->core->seo_path['phpbb_script'] && !$this->core->seo_opt['virtual_root'])
Expand All @@ -343,7 +347,7 @@ function main($id, $mode)
}

// Dirty yet simple templating
$this->user->lang['ACP_REWRITE_CONF_EXPLAIN'] .= $this->seo_server_conf();
$this->language['ACP_REWRITE_CONF_EXPLAIN'] = $this->language['ACP_REWRITE_CONF_EXPLAIN'] . $this->seo_server_conf();

$this->template->assign_vars(array(
'S_SEO_HTACCESS' => 1,
Expand Down Expand Up @@ -811,7 +815,7 @@ function main($id, $mode)
$this->tpl_name = 'acp_board';
$this->page_title = $display_vars['title'];

$l_title_explain = $this->user->lang[$display_vars['title'] . '_EXPLAIN'];
$l_title_explain = $this->language[$display_vars['title'] . '_EXPLAIN'];

if ($mode != 'extended')
{
Expand Down
1 change: 1 addition & 0 deletions config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ services:
- @user
- @request
- @dbal.conn
- @language
- %core.root_path%
- %core.php_ext%
tags:
Expand Down
8 changes: 6 additions & 2 deletions event/listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ class listener implements EventSubscriberInterface
/* @var \phpbb\db\driver\driver_interface */
private $db;

/** @var \phpbb\language\language */
private $language;

/**
* Current $phpbb_root_path
* @var string
Expand Down Expand Up @@ -77,7 +80,7 @@ class listener implements EventSubscriberInterface
* @param string $php_ext PHP file extension
*
*/
public function __construct(\phpbbseo\usu\core $core, \phpbb\config\config $config, \phpbb\auth\auth $auth, \phpbb\template\template $template, \phpbb\user $user, \phpbb\request\request $request, \phpbb\db\driver\driver_interface $db, $phpbb_root_path, $php_ext)
public function __construct(\phpbbseo\usu\core $core, \phpbb\config\config $config, \phpbb\auth\auth $auth, \phpbb\template\template $template, \phpbb\user $user, \phpbb\request\request $request, \phpbb\db\driver\driver_interface $db, \phpbb\language\language $language, $phpbb_root_path, $php_ext)
{
$this->core = $core;
$this->template = $template;
Expand All @@ -86,6 +89,7 @@ public function __construct(\phpbbseo\usu\core $core, \phpbb\config\config $conf
$this->auth = $auth;
$this->request = $request;
$this->db = $db;
$this->language = $language;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
}
Expand Down Expand Up @@ -558,7 +562,7 @@ public function core_page_footer($event)
$output = '<a href="http://www.phpbb-seo.com/" title="' . $this->core->seo_opt['copyrights']['title'] . '">' . $this->core->seo_opt['copyrights']['txt'] . '</a>';
}

$this->user->lang['TRANSLATION_INFO'] = (!empty($this->user->lang['TRANSLATION_INFO']) ? $this->user->lang['TRANSLATION_INFO'] . '<br>' : '') . $output;
$this->language->lang('TRANSLATION_INFO', (!empty($this->user->lang['TRANSLATION_INFO']) ? $this->user->lang['TRANSLATION_INFO'] . '<br>' : '') . $output);

$this->template->assign_vars(array(
'U_CANONICAL' => $this->core->get_canonical(),
Expand Down