Skip to content

Commit f772398

Browse files
committed
Put array into utility instead of lang files
1 parent 937e155 commit f772398

File tree

3 files changed

+89
-173
lines changed

3 files changed

+89
-173
lines changed

functions/utility.php

Lines changed: 89 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class utility
2828
protected $php_ext;
2929

3030
/* @var \phpbb\language\language */
31-
public $language;
31+
protected $language;
3232

3333
/**
3434
* Constructor
@@ -87,13 +87,100 @@ function geshi_list()
8787
*/
8888
function highlight_select($default = 'text')
8989
{
90+
// Programming languages
91+
// these are used by geshi
92+
$programming_langs = array(
93+
'text' => 'Text',
94+
'php' => 'PHP',
95+
'sql' => 'SQL',
96+
'html4strict' => 'HTML',
97+
'css' => 'CSS',
98+
'javascript' => 'Javascript',
99+
'xml' => 'XML',
100+
'diff' => 'Diff',
101+
'robots' => 'robots.txt',
102+
103+
/**
104+
* Wenn eine weitere Sprache aktiviert werden soll, muss die Datei in den includes/geshi/ Ordner
105+
* kopiert werden, und der Eintrag der Sprachdatei wieder nach aktiviert werden.
106+
*/
107+
108+
/*
109+
'actionscript' => 'ActionScript',
110+
'ada' => 'Ada',
111+
'apache' => 'Apache',
112+
'applescript' => 'AppleScript',
113+
'asm' => 'x86 Assembler',
114+
'autoit' => 'AutoIt',
115+
'bash' => 'Bash',
116+
'blitzbasic' => 'BlitzBasic',
117+
'bnf' => 'BNF',
118+
'c_mac' => 'C (Mac)',
119+
'caddcl' => 'CAD DCL',
120+
'cadlisp' => 'CAD Lisp',
121+
'cfdg' => 'CFDG',
122+
'cfm' => 'ColdFusion',
123+
'cpp-qt' => 'C++ (QT)',
124+
'css-gen.cfg' => 'C#',
125+
'c_mac' => 'C (Mac)',
126+
'd' => 'D',
127+
'delphi' => 'Delphi',
128+
'div' => 'DIV',
129+
'dos' => 'DOS',
130+
'eiffel' => 'Eiffel',
131+
'fortran' => 'Fortran',
132+
'freebasic' => 'FreeBasic',
133+
'gml' => 'GML',
134+
'groovy' => 'Groovy',
135+
'idl' => 'Uno Idl',
136+
'ini' => 'INI',
137+
'inno' => 'Inno',
138+
'io' => 'Io',
139+
'java5' => 'Java(TM) 2 Platform Standard Edition 5.0',
140+
'latex' => 'LaTeX',
141+
'lisp' => 'Lisp',
142+
'lua' => 'Lua',
143+
'matlab' => 'Matlab M',
144+
'mirc' => 'mIRC Scripting',
145+
'mpasm' => 'Microchip Assembler',
146+
'mysql' => 'MySQL',
147+
'nsis' => 'NSIS',
148+
'objc' => 'Objective C',
149+
'ocaml-brief' => 'OCaml',
150+
'ocaml' => 'OCaml',
151+
'oobas' => 'OpenOffice.org Basic',
152+
'oracle8' => 'Oracle 8 SQL',
153+
'pascal' => 'Pascal',
154+
'php-brief' => 'PHP (brief)',
155+
'ruby' => 'Ruby',
156+
'sas' => 'SAS',
157+
'scheme' => 'Scheme',
158+
'sdlbasic' => 'sdlBasic',
159+
'smalltalk' => 'Smalltalk',
160+
'tcl' => 'TCL',
161+
'thinbasic' => 'thinBasic',
162+
'tsql' => 'T-SQL',
163+
'plsql' => 'PL/SQL',
164+
'python' => 'Python',
165+
'qbasic' => 'QBasic/QuickBASIC',
166+
'rails' => 'Rails',
167+
'reg' => 'Microsoft Registry',
168+
'vbnet' => 'vb.net',
169+
'vhdl' => 'VHDL',
170+
'visualfoxpro' => 'Visual Fox Pro',
171+
'winbatch' => 'Winbatch',
172+
'xpp' => 'X++',
173+
'z80' => 'ZiLOG Z80 Assembler',
174+
*/
175+
);
176+
90177
if (!in_array($default, $this->geshi_list))
91178
{
92179
$default = 'text';
93180
}
94181

95182
$output = '';
96-
foreach ($this->language->lang['PASTEBIN_LANGUAGES'] as $code => $name)
183+
foreach ($programming_langs as $code => $name)
97184
{
98185
if (in_array($code, $this->geshi_list))
99186
{

language/de/pastebin.php

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -102,89 +102,3 @@
102102
'PASTEBIN_SNIPPET_PRUNABLE_EXPLAIN' => 'Wenn diese Option deaktiviert ist, wird der Eintrag nicht in die monatlich automatisch zu löschenden Einträge aufgenommen.',
103103
'PASTEBIN_SNIPPET_SUBMITTED' => 'Dein Eintrag wurde erfolgreich erstellt.',
104104
));
105-
106-
// these are used by geshi
107-
$lang['PASTEBIN_LANGUAGES'] = array(
108-
'text' => 'Text',
109-
'php' => 'PHP',
110-
'sql' => 'SQL',
111-
'html4strict' => 'HTML',
112-
'css' => 'CSS',
113-
'javascript' => 'Javascript',
114-
'xml' => 'XML',
115-
'diff' => 'Diff',
116-
'robots' => 'robots.txt',
117-
118-
/**
119-
* Wenn eine weitere Sprache aktiviert werden soll, muss die Datei in den includes/geshi/ Ordner
120-
* kopiert werden, und der Eintrag der Sprachdatei wieder nach aktiviert werden.
121-
*/
122-
123-
/*
124-
'actionscript' => 'ActionScript',
125-
'ada' => 'Ada',
126-
'apache' => 'Apache',
127-
'applescript' => 'AppleScript',
128-
'asm' => 'x86 Assembler',
129-
'autoit' => 'AutoIt',
130-
'bash' => 'Bash',
131-
'blitzbasic' => 'BlitzBasic',
132-
'bnf' => 'BNF',
133-
'c_mac' => 'C (Mac)',
134-
'caddcl' => 'CAD DCL',
135-
'cadlisp' => 'CAD Lisp',
136-
'cfdg' => 'CFDG',
137-
'cfm' => 'ColdFusion',
138-
'cpp-qt' => 'C++ (QT)',
139-
'css-gen.cfg' => 'C#',
140-
'c_mac' => 'C (Mac)',
141-
'd' => 'D',
142-
'delphi' => 'Delphi',
143-
'div' => 'DIV',
144-
'dos' => 'DOS',
145-
'eiffel' => 'Eiffel',
146-
'fortran' => 'Fortran',
147-
'freebasic' => 'FreeBasic',
148-
'gml' => 'GML',
149-
'groovy' => 'Groovy',
150-
'idl' => 'Uno Idl',
151-
'ini' => 'INI',
152-
'inno' => 'Inno',
153-
'io' => 'Io',
154-
'java5' => 'Java(TM) 2 Platform Standard Edition 5.0',
155-
'latex' => 'LaTeX',
156-
'lisp' => 'Lisp',
157-
'lua' => 'Lua',
158-
'matlab' => 'Matlab M',
159-
'mirc' => 'mIRC Scripting',
160-
'mpasm' => 'Microchip Assembler',
161-
'mysql' => 'MySQL',
162-
'nsis' => 'NSIS',
163-
'objc' => 'Objective C',
164-
'ocaml-brief' => 'OCaml',
165-
'ocaml' => 'OCaml',
166-
'oobas' => 'OpenOffice.org Basic',
167-
'oracle8' => 'Oracle 8 SQL',
168-
'pascal' => 'Pascal',
169-
'php-brief' => 'PHP (brief)',
170-
'ruby' => 'Ruby',
171-
'sas' => 'SAS',
172-
'scheme' => 'Scheme',
173-
'sdlbasic' => 'sdlBasic',
174-
'smalltalk' => 'Smalltalk',
175-
'tcl' => 'TCL',
176-
'thinbasic' => 'thinBasic',
177-
'tsql' => 'T-SQL',
178-
'plsql' => 'PL/SQL',
179-
'python' => 'Python',
180-
'qbasic' => 'QBasic/QuickBASIC',
181-
'rails' => 'Rails',
182-
'reg' => 'Microsoft Registry',
183-
'vbnet' => 'vb.net',
184-
'vhdl' => 'VHDL',
185-
'visualfoxpro' => 'Visual Fox Pro',
186-
'winbatch' => 'Winbatch',
187-
'xpp' => 'X++',
188-
'z80' => 'ZiLOG Z80 Assembler',
189-
*/
190-
);

language/en/pastebin.php

Lines changed: 0 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -101,88 +101,3 @@
101101
'PASTEBIN_SNIPPET_PRUNABLE_EXPLAIN' => 'If this option is disabled, the entry will not be entered in the monthly list of prunable entries.',
102102
'PASTEBIN_SNIPPET_SUBMITTED' => 'Your entry was sucessfully created.',
103103
));
104-
105-
// these are used by geshi
106-
$lang['PASTEBIN_LANGUAGES'] = array(
107-
'text' => 'Text',
108-
'php' => 'PHP',
109-
'sql' => 'SQL',
110-
'html4strict' => 'HTML',
111-
'css' => 'CSS',
112-
'javascript' => 'Javascript',
113-
'xml' => 'XML',
114-
'diff' => 'Diff',
115-
'robots' => 'robots.txt',
116-
117-
/**
118-
* You can activate further languages by uncommenting any of these lines.
119-
*/
120-
121-
/*
122-
'actionscript' => 'ActionScript',
123-
'ada' => 'Ada',
124-
'apache' => 'Apache',
125-
'applescript' => 'AppleScript',
126-
'asm' => 'x86 Assembler',
127-
'autoit' => 'AutoIt',
128-
'bash' => 'Bash',
129-
'blitzbasic' => 'BlitzBasic',
130-
'bnf' => 'BNF',
131-
'c_mac' => 'C (Mac)',
132-
'caddcl' => 'CAD DCL',
133-
'cadlisp' => 'CAD Lisp',
134-
'cfdg' => 'CFDG',
135-
'cfm' => 'ColdFusion',
136-
'cpp-qt' => 'C++ (QT)',
137-
'css-gen.cfg' => 'C#',
138-
'c_mac' => 'C (Mac)',
139-
'd' => 'D',
140-
'delphi' => 'Delphi',
141-
'div' => 'DIV',
142-
'dos' => 'DOS',
143-
'eiffel' => 'Eiffel',
144-
'fortran' => 'Fortran',
145-
'freebasic' => 'FreeBasic',
146-
'gml' => 'GML',
147-
'groovy' => 'Groovy',
148-
'idl' => 'Uno Idl',
149-
'ini' => 'INI',
150-
'inno' => 'Inno',
151-
'io' => 'Io',
152-
'java5' => 'Java(TM) 2 Platform Standard Edition 5.0',
153-
'latex' => 'LaTeX',
154-
'lisp' => 'Lisp',
155-
'lua' => 'Lua',
156-
'matlab' => 'Matlab M',
157-
'mirc' => 'mIRC Scripting',
158-
'mpasm' => 'Microchip Assembler',
159-
'mysql' => 'MySQL',
160-
'nsis' => 'NSIS',
161-
'objc' => 'Objective C',
162-
'ocaml-brief' => 'OCaml',
163-
'ocaml' => 'OCaml',
164-
'oobas' => 'OpenOffice.org Basic',
165-
'oracle8' => 'Oracle 8 SQL',
166-
'pascal' => 'Pascal',
167-
'php-brief' => 'PHP (brief)',
168-
'ruby' => 'Ruby',
169-
'sas' => 'SAS',
170-
'scheme' => 'Scheme',
171-
'sdlbasic' => 'sdlBasic',
172-
'smalltalk' => 'Smalltalk',
173-
'tcl' => 'TCL',
174-
'thinbasic' => 'thinBasic',
175-
'tsql' => 'T-SQL',
176-
'plsql' => 'PL/SQL',
177-
'python' => 'Python',
178-
'qbasic' => 'QBasic/QuickBASIC',
179-
'rails' => 'Rails',
180-
'reg' => 'Microsoft Registry',
181-
'vbnet' => 'vb.net',
182-
'vhdl' => 'VHDL',
183-
'visualfoxpro' => 'Visual Fox Pro',
184-
'winbatch' => 'Winbatch',
185-
'xpp' => 'X++',
186-
'z80' => 'ZiLOG Z80 Assembler',
187-
*/
188-
);

0 commit comments

Comments
 (0)