File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ services:
1010 arguments :
1111 - ' %phpbbde.pastebin.geshilangs%'
1212 - ' %core.php_ext%'
13+ - ' @language'
1314 phpbbde.pastebin.functions.pastebin :
1415 class : phpbbde\pastebin\functions\pastebin
1516 arguments :
Original file line number Diff line number Diff line change @@ -34,15 +34,23 @@ class utility
3434 /** @var string */
3535 protected $ php_ext ;
3636
37+ /* @var \phpbb\language\language */
38+ public $ language ;
39+
3740 /**
3841 * Constructor
3942 * @param string $php_ext
43+ * @param \phpbb\language\language $language
4044 */
41- function __construct ($ geshi_dir , $ php_ext )
45+ function __construct (
46+ $ geshi_dir ,
47+ $ php_ext ,
48+ \phpbb \language \language $ language )
4249 {
4350 $ this ->geshi_dir = $ geshi_dir ;
4451 $ this ->geshi_list = $ this ->geshi_list ();
4552 $ this ->php_ext = $ php_ext ;
53+ $ this ->language = $ language ;
4654 }
4755
4856
@@ -86,14 +94,13 @@ function geshi_list()
8694 */
8795 function highlight_select ($ default = 'text ' )
8896 {
89- global $ user ;
9097 if (!in_array ($ default , $ this ->geshi_list ))
9198 {
9299 $ default = 'text ' ;
93100 }
94101
95102 $ output = '' ;
96- foreach ($ user ->lang ['PASTEBIN_LANGUAGES ' ] as $ code => $ name )
103+ foreach ($ this -> language ->lang ['PASTEBIN_LANGUAGES ' ] as $ code => $ name )
97104 {
98105 if (in_array ($ code , $ this ->geshi_list ))
99106 {
You can’t perform that action at this time.
0 commit comments