Completed
Pull Request — master (#107)
by Marc
01:59
created

GlobalsExtension::getModsVars()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 98
Code Lines 70

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 98
c 0
b 0
f 0
rs 8.3352
cc 1
eloc 70
nc 1
nop 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/**
3
 *
4
 * @copyright (c) 2013 phpBB Group
5
 * @license http://opensource.org/licenses/gpl-3.0.php GNU General Public License v3
6
 * @author MichaelC
7
 *
8
 */
9
10
namespace AppBundle\Twig;
11
12
class GlobalsExtension extends \Twig_Extension implements \Twig_Extension_GlobalsInterface
13
{
14
	public function getGlobals()
15
	{
16
		// @TODO Generate URLs for routes
17
		$pathVars = $this->getPathVars();
18
		$menuVars = $this->getMenuVars();
19
20
		$aboutVars 			= $this->getAboutVars();
21
		$developmentVars 	= $this->getDevelopmentVars();
22
		$modVars 			= $this->getModsVars();
23
		$styleVars 			= $this->getStyleVars();
24
		$supportVars 		= $this->getSupportVars();
25
		$extensionVars		= $this->getExtensionVars();
26
27
		$forumVars 	= $this->getForumVars();
28
		$peopleVars = $this->getPeopleVars();
29
		$miscVars 	= $this->getMiscVars();
30
		$legacyVars = $this->getLegacyVars();
31
32
		$variables = array_merge(
33
			$pathVars,
34
			$menuVars,
35
			$aboutVars,
36
			$developmentVars,
37
			$modVars,
38
			$styleVars,
39
			$supportVars,
40
			$forumVars,
41
			$peopleVars,
42
			$miscVars,
43
			$extensionVars,
44
			$legacyVars
45
		);
46
47
		return $variables;
48
	}
49
50
51
	public function getName()
52
	{
53
		return 'phpbb_extension_globals';
54
	}
55
56
	private function getPathVars()
57
	{
58
		$pathVars = array(
59
			'home_path'			=> '/',
60
61
			'about_path'		=> '/about/',
62
			'ABOUT'				=> '/about/',
63
			//'ABOUT_INDEX_SUB'	=> '/about/',
64
65
			'advertise_path'	=> '/about/advertise/',
66
			'ABOUT_ADVERTISE'	=> '/about/advertise/',
67
68
			'release_path'		=> '/about/release/',
69
70
			'demo_path'			=> '/demo/',
71
			'DEMO'				=> '/demo/',
72
73
			'downloads_path'	=> '/downloads/',
74
			'downloads_path_32x' => '/downloads/3.2/',
75
			'downloads_path_31x' => '/downloads/3.1/',
76
			'downloads_path_30x' => '/downloads/3.0/',
77
78
			//'DOWNLOADS_SUB'		=> '/downloads/',
79
			'DOWNLOADS'			=> '/downloads/',
80
			'DOWNLOADS_HEADER'	=> '/downloads/?from=header',
81
82
			'cdb_path'			=> '/customise/db/',
83
			'CUSTOMISE'			=> '/customise/db/',
84
85
			'support_path'		=> '/support/',
86
			'SUPPORT'			=> '/support/',
87
88
			'development_path'	=> '/development/', // Usage = 3
89
			// 'DEV_INDEX_SUB'		=> '/development/',
90
			'DEVELOPMENT'		=> '/development/',
91
			
92
			'GSOC'			=> '/development/gsoc/',
93
			'gsoc_path'		=> '/development/gsoc/',
94
95
			'community_path'	=> '/community/',
96
			'COMMUNITY'			=> '/community',
97
98
			'contact_path'		=> '/about/contact/',
99
			'ABOUT_CONTACT'		=> '/about/contact/',
100
101
			'get_involved_path'		=> '/get-involved/', // Usage = 2
102
			// 'ABOUT_GETINVOLVED_SUB'	=> '/get-involved/',
103
			'DEV_GI_SUB'			=> '/development/get-involved/',
104
			'GET_INVOLVED'			=> '/get-involved/',
105
106
			'customise_path'	=> '/customise/',
107
108
			'mods_db_path'		=> '/customise/db/modifications-1',
109
			// 'MODS_DB_SUB'		=> '/customise/db/modifications-1',
110
111
			'mods_path'			=> '/mods/',
112
			'MODS'				=> '/mods/',
113
114
			'shop_path'			=> '/shop/',
115
			'SHOP'				=> '/shop/',
116
117
			'blog_link'			=> '//blog.phpbb.com/',
118
			'BLOG'				=> '//blog.phpbb.com/',
119
120
			'feeds_rss_path'	=> '/feeds/rss/',
121
			'FEEDS_RSS'			=> '/feeds/rss/',
122
123
			'kb_path'			=> '/support/docs/en/3.1/kb/',
124
			'KB'				=> '/support/docs/en/3.1/kb/',
125
			//'KB'				=> '/knowledgebase/',
126
127
			'showcase_path'		=> '/showcase/',
128
			'SHOWCASE'			=> '/showcase/',
129
130
			'documentation_path'=> '/support/docs/',
131
			'DOCUMENTATION'		=> '/support/docs/',
132
133
			'ideas_path'		=> '/ideas/',
134
			'IDEAS'				=> '/ideas/',
135
136
			'extensions_path'	=> '/extensions/',
137
138
			'styles_path'		=> '/styles/',
139
		);
140
141
		return $pathVars;
142
	}
143
144
	private function getMenuVars()
145
	{
146
		$menuVars = array(
147
			// 'ABOUT_FEATURES_SUB'				=> '/about/features/',
148
			// 'ABOUT_HISTORY_SUB'				=> '/about/history/',
149
150
			// 'ABOUT_TEAM_SUB'					=> '/about/team/',
151
			//'ABOUT_CONTACT_SUB'				=> '/about/contact/',
152
			// 'ABOUT_ADVERTISE_SUB'				=> '/about/advertise/',
153
154
			'DOWNLOADS_UPDATE_SUB'			=> '/downloads/#update',
155
156
			// 'MODS_SUB'						=> '/mods/',
157
			// 'DEV_WIKI_SUB'					=> '//wiki.phpbb.com/',
158
			// 'STYLES_SUB'						=> '/styles/',
159
			// 'STYLES_DEMO_SUB'					=> '/styles/demo/3.0/',
160
161
			// 'DOCUMENTATION_SUB'				=> '/support/documentation/3.0/',
162
			// 'KB_SUB'							=> '/kb/',
163
			// 'SUPPORT_IRC_SUB'					=> '/support/irc/',
164
			'SUPPORT_TUTORIALS_SUB'			=> '/support/tutorials/3.0/',
165
			// 'SUPPORT_FORUMS_SUB'				=> '/support/forums/',
166
			// 'SUPPORT_INTL_SUB'				=> '/support/intl/',
167
168
			'BUGS_SUB'						=> '/bugs/',
169
			'BUGS_PHPBB_SUB'					=> 'http://tracker.phpbb.com/',
170
			'SECURITY_SUB'					=> '/security/',
171
			'DEV_HOME_SUB'					=> '//area51.phpbb.com/',
172
173
			'ABOUT_INDEX_SUB'					=> '/about/',
174
			'SUPPORT_INDEX_SUB'				=> '/support/',
175
176
			'CDB_MOD_SUPPORT'					=> '/customise/db/support/modifications-1', // TODO: remove (used in support_forums.html)
177
			'CDB_STYLE_SUPPORT'				=> '/customise/db/support/styles-2', // TODO: remove
178
			'CDB_CONVERTOR_SUPPORT'			=> '/customise/db/support/converter/', // TODO: remove (used in support_forums.html)
179
			'CDB_TRANSLATION_SUPPORT'			=> '/customise/db/support/translation/', // TODO: remove
180
		);
181
182
		return $menuVars;
183
	}
184
185
	private function getAboutVars()
186
	{
187
		$aboutVars = array(
188
			'ABOUT_HISTORY'		=> '/about/history/',
189
			'ABOUT_LOGOS'		=> '/about/logos/',
190
			'ABOUT_MAP'			=> '/about/map/',
191
			'ABOUT_TEAM'		=> '/about/team/',
192
			'ABOUT_FEATURES'	=> '/about/features/',
193
			'ABOUT_COMPARE'		=> '/about/features/compare.php',
194
			'about_launch'		=> '/about/launch/',
195
		);
196
197
		return $aboutVars;
198
	}
199
200
	private function getDevelopmentVars()
201
	{
202
		$developmentVars = array(
203
			'BUGS'				=> '/bugs/',
204
			'BUGS_PHPBB'			=> 'http://tracker.phpbb.com/',
205
			'BUGS_WEBSITE'		=> '/bugs/website/',
206
			'INCIDENTS'			=> '/incidents/',
207
			'SECURITY'			=> 'https://tracker.phpbb.com/secure/BrowseProjects.jspa#10020',
208
			'SECURITY_MODS'		=> 'https://tracker.phpbb.com/browse/EXTSEC/',
209
			'BUGS_30X'			=> 'http://tracker.phpbb.com/',
210
			'BUGS_DOCS'			=> '/bugs/docs/',
211
			'BUGS_MODTOOLS'		=> '/bugs/modteamtools/',
212
			'BUGS_SUPPORTTOOLS'	=> '/bugs/supportteamtools/',
213
			'CODE_DOCS_30X'		=> '//area51.phpbb.com/docs/code/',
214
			'GIT_REPOSITORY'		=> 'https://github.com/phpbb',
215
			'GIT_REPOSITORY_3_0'	=> 'https://github.com/phpbb/phpbb3',
216
			'CODING_GUIDELINES'	=> '//area51.phpbb.com/docs/30x/coding-guidelines.html',
217
218
			'DEV_BOARD'			=> '//area51.phpbb.com/phpBB/',
219
			'DEV_HOME'			=> '//area51.phpbb.com/',
220
			'DEV_PROSILVER'		=> '/development/prosilver/',
221
			'GSOC'			=> '/development/gsoc/'
222
			'DEV_GSOC_IDEAS'	=> '/development/gsoc/ideas/',
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')'
Loading history...
223
			'DEV_GSOC_2012'		=> 'https://wiki.phpbb.com/GSoC/2012/Ideas',
224
			'DEV_GSOC_2013'		=> 'https://wiki.phpbb.com/GSoC/2013/Ideas',
225
			'DEV_GSOC_2014'		=> 'https://wiki.phpbb.com/GSoC/2014/Ideas',
226
			'DEV_QA'				=> '/development/qa/',
227
			//'DEV_QA_CONTACT'		=> '/community/ucp.php?i=pm&amp;mode=compose&amp;u=' . DEV_QA_CONTACT_ID),
228
			'DEV_QA_TOOL'			=> '/development/qa/release/new',
229
			'DEV_QA_30X_BUGLIST'	=> '/bugs/phpbb3/qa.php',
230
			'DEV_WIKI'			=> 'https://wiki.phpbb.com/',
231
232
			'dev_github_phpbb_master' => 'https://github.com/phpbb/phpbb/tree/master',
233
			'dev_github_phpbb_32x' => 'https://github.com/phpbb/phpbb/tree/3.2.x',
234
			'dev_github_phpbb_31x' => 'https://github.com/phpbb/phpbb/tree/3.1.x',
235
			'dev_github_phpbb_30x' => 'https://github.com/phpbb/phpbb/tree/3.0.x',
236
		);
237
238
		return $developmentVars;
239
	}
240
241
	private function getModsVars()
242
	{
243
		$modVars = array(
244
			'MODS_AUTOMOD'		=> '/mods/automod/',
245
			'MODS_GENERATOR'		=> '/mods/utilities/generator/',
246
			'MODS_CHECKIST'		=> '/mods/validator/checklist.php',
247
			'MODS_DB'				=> '/customise/db/modifications-1',
248
			'MODS_FAQ'			=> '/mods/faq/',
249
			'MODS_VOLUNTEER'		=> '/mods/volunteer/',
250
			'MODS_DOCUMENTATION'	=> '/mods/documentation/',
251
			'MODS_MODX'			=> '/mods/modx/',
252
			'MODS_MODX_UPD'		=> '/mods/modx/update/',
253
			'MODS_VALIDATOR'		=> '/mods/validator/',
254
			'MODS_GLOSSARY'		=> '/mods/glossary/',
255
			'MODS_MISSION'		=> '/mods/mission/',
256
			'MODS_MPV'			=> '/mods/mpv/',
257
			'MODS_JR'				=> '/mods/junior-validators/',
258
259
			'MODS_DATABASE_RULES'		=> '/mods/rules-and-policies/',
260
			'MODS_DEVELOPMENT_RULES'	=> '/mods/rules-and-policies/development/',
261
			'MODS_WRITERS_RULES'		=> '/mods/rules-and-policies/writers/',
262
			'MODS_AUTOMOD_SVN'		=> 'https://github.com/phpbb/automod',
263
			'MODS_UMIL'				=> '/mods/umil/',
264
			'MODS_TRACKER'			=> '/bugs/modteamtools/',
265
			'MODS_TEAM_OVERVIEW'		=> '/mods/team-overview/',
266
			'MODS_TEAM_OVERVIEW_JR'	=> '/mods/team-overview/?p=jr',
267
268
			'MODS_TEAM_OVERVIEW_MODERATOR'	=> '/mods/team-overview/?p=moderator',
269
			'MODS_TEAM_OVERVIEW_VALIDATOR'	=> '/mods/team-overview/?p=validator',
270
271
			'MODS_AUTHOR_INTRO'					=> '/mods/author-introduction/',
272
			'MODS_RULES_AND_POLICIES' 			=> '/mods/rules-and-policies/',
273
			'MODS_RULES_MOD_DEVELOPMENT_FORUM'	=> '/mods/rules-and-policies/development/',
274
			'MODS_RULES_MOD_WRITERS_FORUM'		=> '/mods/rules-and-policies/writers/',
275
276
			// Tools pages
277
			'MODS_UMIL_CREATOR'			=> '/mods/umil/create.php',
278
279
			'MODS_MODX_TOOLS'				=> '/mods/modx-tools/',
280
			'MODS_MODX_GENERATOR'			=> '/mods/modx-tools/generator/',
281
			// 'MODS_MODX_CONVERTOR'		=> '/mods/modx-tools/convertor/',
282
			'MODS_MODX_CREATOR'			=> '/mods/modx-tools/creator/',
283
			'MODS_MODX_CREATOR_OFFLINE'	=> '/mods/modx-tools/creator/download/',
284
			'MODS_QUICKINSTALL'			=> '/mods/quickinstall/',
285
286
			// MODs finding
287
			'MODS_REQ_MOD_TOPIC'		=> '/community/viewtopic.php?t=587938',
288
			'MODS_DB_SEARCH'			=> '/customise/db/search/',
289
290
			// MODs faq
291
			'MODS_KB'					=> '/support/docs/en/3.0/kb/modifications/',
292
			'MODS_KB_20X'				=> '/support/docs/en/3.0/kb/modifications/',
293
			//'MODS_DB_MYLIST'			=> '/customise/db/author/' . $user->data['username_clean'] . '/contributions/',
294
			//'MODS_DB_CREATE'			=> '/customise/db/author/' . $user->data['username_clean'] . '/create/',
295
296
			'MODS_POLICY'			=> '/mods/rules-and-policies/',
297
			'MODS_3_POLICY'		=> '/mods/rules-and-policies/db/general/',
298
			'MODS_POLICY_DENY'	=> '/mods/rules-and-policies/db/insta-deny/',
299
			'MODS_POLICY_REPACK'	=> '/mods/rules-and-policies/db/repack/',
300
301
			'MODS_CONVENTION'				=> '/mods/convention/',
302
			'MODS_CONVENTION_JULY_2006'	=> '/mods/convention/2006-07/',
303
			'MODS_CONVENTION_JULY_2007'	=> '/mods/convention/2007-07/',
304
			'MODS_CONVENTION_AUGUST_2008'	=> '/mods/convention/2008-08/',
305
306
			'MODX_FEATURES'			=> '/mods/modx/features/',
307
			'MODX_FAQ'				=> '/mods/modx/faq/',
308
			'MODX_UTILITIES'			=> '/mods/modx/utilities/',
309
			'MODX_CONVERTOR'			=> '/mods/utilities/convertor/',
310
			'MODX_CREATOR'			=> '/mods/modx-tools/creator/',
311
			'MODX_CREATOR_DOWNLOAD'	=> '/mods/modx-tools/creator/download/',
312
			'MODX_GENERATOR'			=> '/mods/modx-tools/generator/',
313
			'MODX_SPEC'				=> '/mods/modx/spec/',
314
315
			//'MODX_VERSION'			=> MODX_VERSION,
316
317
			// Bridges
318
			'BRIDGES_DB'				=> '/customise/db/bridges-24',
319
			'BRIDGES_POLICIES'	=> '/mods/bridges/',
320
321
			// installing mods
322
			'MODS_FINDING'		=> '/mods/finding/',
323
			'MODS_OPENING'		=> '/mods/opening/',
324
			'MODS_INSTALLING'		=> '/mods/installing/',
325
			'MODS_SUPPORT'		=> '/mods/support/',
326
327
			// writing mods
328
			'MODS_INTRODUCTION'	=> '/mods/introduction/index.php',
329
			'MODS_GUIDELINES'		=> '//area51.phpbb.com/docs/30x/coding-guidelines.html', // Links to phpBB SVN, but the MOD team may use their own guidelines later.
330
			'MODS_TECHNIQUES'		=> '/mods/documentation/',
331
			'MODS_APPLICATIONS'	=> '/mods/utilities/',
332
			'MODS_CREATING'		=> '/mods/modx/',
333
			'MODS_PACKAGING'		=> '/mods/packaging/',
334
			'MODS_CHECKLIST'		=> '/mods/validator/checklist.php',
335
		);
336
337
		return $modVars;
338
	}
339
340
	private function getStyleVars()
341
	{
342
		$styleVars = array(
343
			// To be removed
344
			'STYLES'						  => '/styles/',
345
			'STYLES_DB'					   => '/customise/db/styles-2',
346
347
			// Main pages
348
			'styles_create'				   => '/styles/create/',
349
			'styles_changes'				  => '/styles/changes/',
350
			'styles_installing'			   => '/styles/installing/',
351
			'styles_ssp'					  => '/styles/ssp/',
352
			'styles_ssp_30x'				  => '/styles/ssp/3.0/',
353
			'styles_support'				  => '/styles/support/',
354
			'styles_team_overview'			=> '/styles/team-overview/',
355
			'styles_junior_validators'		=> '/styles/junior-validators/',
356
			'styles_demo'					 => '/styles/demo/',
357
358
			// Demo pages (handled by Titania)
359
			'styles_demo_31x'				 => '/customise/db/style/prosilver/demo/3.1', // TODO: needs to be up and running
360
			'styles_demo_30x'				 => '/customise/db/style/prosilver/demo/3.0',
361
362
			// Styles CDB
363
			'styles_db_path'				  => '/customise/db/styles-2',
364
			'styles_gdk_31x_commercial_fonts' => '/customise/db/style/prosilver_gdk_31x_commercial_fonts/',
365
			'styles_gdk_31x_free_fonts'	   => '/customise/db/style/prosilver_gdk_31x_free_fonts/',
366
			'styles_gdk_30x_commercial_fonts' => '/customise/db/style/prosilver_gdk_commercial_fonts/',
367
			'styles_gdk_30x_free_fonts'	   => '/customise/db/style/prosilver_gdk_free_fonts/',
368
			'styles_gdk_20x'				  => '/customise/db/style/phpbb_subsilver_gdk/',
369
370
			// Documentation resources
371
			'styles_wiki'					 => 'https://wiki.phpbb.com/Category:Styles',
372
			'styles_kb'					   => '/support/docs/en/3.1/kb/styles/',
373
			'styles_kb_31x'				   => '/support/docs/en/3.1/kb/styles/',
374
			'styles_kb_30x'				   => '/support/docs/en/3.0/kb/styles/',
375
			'styles_kb_30x_install'		   => '/support/docs/en/3.0/kb/article/how-to-install-styles-on-phpbb3/',
376
			'styles_kb_30x_create'			=> '/support/docs/en/3.0/kb/article/how-to-create-a-style-basics/',
377
			'styles_docs_31x'				 => '/support/docs/en/3.1/ug/adminguide/customise_styles/',
378
			'styles_docs_30x'				 => '/support/docs/en/3.0/ug/adminguide/styles/',
379
380
			'styles_team_members'			 => '/community/memberlist.php?mode=group&g=7332',
381
			'styles_jv_team_members'		  => '/community/memberlist.php?mode=group&g=228778',
382
383
			// Other
384
			'styles_db_my_styles'			 => '/customise/db/author/USERNAME/contributions', // TODO: this dynamic link needs the current username (used on SSP pages)
385
		);
386
387
		return $styleVars;
388
	}
389
390
	private function getSupportVars()
391
	{
392
		$supportVars = array(
393
394
			'DOCUMENTATION_3_0'	=> '/support/docs/en/3.0/ug/',
395
			'QUICK_START_3_0'		=> '/support/docs/en/3.0/ug/quickstart/',
396
			'SUPPORT_FORUMS'		=> '/support/forums/',
397
398
			'SUPPORT_IRC'				=> '/support/irc/',
399
			'SUPPORT_TUTORIALS'		=> '/support/tutorials/',
400
			'SUPPORT_TUTORIALS_2_0'	=> '/support/tutorials/2.0/',
401
			'SUPPORT_TUTORIALS_3_0'	=> '/support/tutorials/3.0/',
402
			'SUPPORT_INTL'			=> '/support/intl/',
403
			//'SUPPORT_INTL_CONTACT'	=> '/community/ucp.php?i=pm&amp;mode=compose&amp;u=' . INTL_CONTACT_ID,
404
			'SUPPORT_SRT'				=> '/support/srt/',
405
			'SUPPORT_SRT_FEEDBACK'	=> '/community/viewtopic.php?f=64&amp;t=1455965',
406
			'SUPPORT_SRT_TOPIC'		=> '/community/viewtopic.php?f=46&amp;t=543515',
407
			'SUPPORT_STK'				=> '/support/stk/',
408
			'SUPPORT_STK_INSTALL'		=> '/support/stk/index.php?mode=instal',
409
			'SUPPORT_STK_SCREENS'		=> '/support/stk/screenshots.php',
410
			'SUPPORT_CODE_CHANGES'	=> '//area51.phpbb.com/code-changes/',
411
412
			'SUPPORT_DOCS'			=> '/support/docs/',
413
			'SUPPORT_DOCS_UG'			=> '/support/docs/en/3.1/ug/',
414
			'SUPPORT_DOCS_KB'			=> '/support/docs/en/3.1/kb/',
415
			'SUPPORT_DOCS_FLASH'		=> '/support/docs/flash/',
416
		);
417
418
		return $supportVars;
419
	}
420
421
	private function getExtensionVars()
422
	{
423
		$extensionVars = array(
424
			'extensions_cdb'						=> '/customise/db/extensions-36',
425
			'extensions_quickinstall'				=> '/mods/quickinstall/', //replace later
426
			'extensions_phpbb_cgs'					=> '//area51.phpbb.com/docs/31x/coding-guidelines.html',
427
428
			'extensions_rules'						=> '/extensions/rules-and-policies/',
429
			'extensions_recognised_devs'			=> '/extensions/recognised-developer/',
430
			'extensions_offical_exts'				=> '/extensions/official-extensions/',
431
			'extensions_offical_exts_team'			=> '/extensions/official-extensions/team/',
432
			'extensions_junior_validators'			=> '/extensions/junior-validators/',
433
434
			'extensions_epv'						=> '/extensions/epv/',
435
			'extensions_epv_repo'					=> 'https://github.com/phpbb/epv',
436
			'extensions_epv_bugs'					=> 'https://tracker.phpbb.com/browse/EXTTOOLS',
437
			'extensions_epv_instructions'			=> '/community/viewtopic.php?f=461&t=2239116',
438
			'extensions_installing'					=> '/extensions/installing/',
439
			'extensions_writing'					=> '/extensions/writing/',
440
			'extensions_team_overview'				=> '/extensions/team-overview/',
441
			'extensions_validation_policy'			=> '/extensions/rules-and-policies/validation-policy',
442
			'extensions_instadeny'					=> '/extensions/rules-and-policies/validation-policy#insta-deny',
443
			'extensions_repack'						=> '/extensions/rules-and-policies/validation-policy#repack',
444
			'extensions_rules_dev'					=> '/extensions/rules-and-policies/development-rules',
445
			'extensions_rules_writer'				=> '/extensions/rules-and-policies/writers-rules',
446
447
			'extensions_docs_31'					=> 'https://area51.phpbb.com/docs/dev/31x/extensions/',
448
			'extensions_docs_32'					=> 'https://area51.phpbb.com/docs/dev/32x/extensions/',
449
			'extensions_docs_basics'				=> 'https://area51.phpbb.com/docs/dev/31x/extensions/tutorial_basics.html',
450
			'extensions_docs_key_concepts'			=> 'https://area51.phpbb.com/docs/dev/31x/extensions/tutorial_key_concepts.html',
451
			'extensions_docs_modules'				=> 'https://area51.phpbb.com/docs/dev/31x/extensions/tutorial_modules.html',
452
453
			'extensions_security_tracker'			=> 'https://tracker.phpbb.com/browse/EXTSEC',
454
455
			'extension_quickstart_zip'				=> '/store/quickstart_extension_1.0.0.zip',
456
			'extension_skeleton'					=> 'https://www.phpbb.com/customise/db/official_tool/ext_skeleton/',
457
458
			// Team members
459
			'extension_team_members'				=> '/community/memberlist.php?mode=group&g=7331',
460
			'extension_dev_team_members'			=> '/community/memberlist.php?mode=group&g=228787',
461
			'extension_jv_team_members'				=> '/community/memberlist.php?mode=group&g=228685',
462
		);
463
464
		return $extensionVars;
465
	}
466
467
	private function getForumVars()
468
	{
469
		$forumVars = array(
470
			'FORUM_30X_SUPPORT'	=> '/community/viewforum.php?f=46',
471
			'FORUM_PHPBBDISC'		=> '/community/viewforum.php?f=64',
472
			'FORUM_SEARCH_EVENTS'	=> '/community/search.php?keywords=%5BEVENT%5D&amp;terms=all&amp;fid%5B%5D=64&amp;sc=1&amp;sf=titleonly&amp;sr=topics&amp;sk=t&amp;sd=d&amp;st=0&amp;ch=300&amp;t=0&amp;submit=Search',
473
474
			// Related community topics
475
			'styles_ssp_31x_feedback'		 => '/community/viewforum.php?f=481&t=66666', // TODO: create topic
476
			'styles_ssp_30x_feedback'		 => '/community/viewtopic.php?f=74&p=12931323', // TODO: move topic to 3.0 styles?
477
478
			// Styles Forum
479
			'FORUM_STYLES'				=> '/community/viewforum.php?f=77',
480
			'FORUM_STYLES_SUPPORT_30X'	=> '/community/viewforum.php?f=74',
481
			'FORUM_STYLES_SUPPORT_20X'	=> '/community/viewforum.php?f=23',
482
			'FORUM_STYLES_DEV_30X'		=> '/community/viewforum.php?f=185',
483
			'FORUM_STYLES_30X'			=> '/community/viewforum.php?f=80',
484
485
			'forum_styles_31x'		 => '/community/viewforum.php?f=471',
486
			'forum_styles_31x_support' => '/community/viewforum.php?f=481',
487
			'forum_styles_31x_dev'	 => '/community/viewforum.php?f=476',
488
			'forum_styles_30x'		 => '/community/viewforum.php?f=80',
489
			'forum_styles_30x_support' => '/community/viewforum.php?f=74',
490
			'forum_styles_30x_dev'	 => '/community/viewforum.php?f=185',
491
			'forum_styles_20x'		 => '/community/viewforum.php?f=77',
492
			'forum_styles_20x_support' => '/community/viewforum.php?f=74',
493
			'forum_styles_20x_dev'	 => '/community/viewforum.php?f=23',
494
495
			// Modification Forums
496
			'FORUM_MODS'					=> '/community/viewforum.php?f=78',
497
			'FORUM_MODS_OLYMPUS'				=> '/community/viewforum.php?f=81',
498
			'FORUM_MODS_30X'				=> '/community/viewforum.php?f=81',
499
			'MODS_DEVELOPMENT_FORUM_30X'	=> '/community/viewforum.php?f=70',
500
			'MODS_DATABASE_RELEASES_30X'	=> '/community/viewforum.php?f=69',
501
			'MODS_REQUESTS_FORUM_30X'		=> '/community/viewforum.php?f=72',
502
			'MODS_WRITERS_FORUM_30X'		=> '/community/viewforum.php?f=71',
503
504
			'forum_extensions_31x'			=> '/community/viewforum.php?f=451',
505
			'forum_extensions_req'			=> '/community/viewforum.php?f=496',
506
			'forum_extensions_31x_dev'		=> '/community/viewforum.php?f=456',
507
			'forum_extensions_31x_writers'	=> '/community/viewforum.php?f=461',
508
			'extensions_writers_discussion'		 => '/community/viewforum.php?f=461',
509
510
			'FORUM_SUPPORT'				=> '/community/viewforum.php?f=46',
511
			'FORUM_STYLES_CAT'			=> '/community/viewforum.php?f=80',
512
			'FORUM_MODS_CAT'			=> '/community/viewforum.php?f=81',
513
514
			'FORUM_EVENTS'				=> '/community/viewforum.php?f=105',
515
			'FORUM_GENDISC'				=> '/community/viewforum.php?f=6',
516
517
			'U_FORUM_SUPPORT_SUB'				=> '/community/viewforum.php?f=551',
518
			'U_FORUM_STYLES_SUB'				=> '/community/viewforum.php?f=471',
519
			'U_FORUM_MODS_SUB'					=> '/community/viewforum.php?f=81',
520
			'U_FORUM_EXT_SUB'					=> '/community/viewforum.php?f=451',
521
			'U_FORUM_PHPBBDISC_SUB'				=> '/community/viewforum.php?f=64',
522
			'U_FORUM_EVENTS_SUB'				=> '/community/viewforum.php?f=105',
523
			'U_FORUM_GENDISC_SUB'				=> '/community/viewforum.php?f=6',
524
			'U_FORUM_PRIVATE_SUB'				=> '/community/viewforum.php?f=53',
525
		);
526
527
		return $forumVars;
528
	}
529
530
	private function getPeopleVars()
531
	{
532
		$peopleVars = array(
533
			'SUPPORT_TL_NAME'		=> 'Noxwizard',
534
			'SUPPORT_TL_CONTACT'	=> '/community/memberlist.php?mode=viewprofile&u=192443',
535
			'SUPPORT_DOCS_NAME'		=> 'stevemaury',
536
			'SUPPORT_DOCS_CONTACT'	=> '/community/memberlist.php?mode=viewprofile&u=280664',
537
			'styles_tl_name'		=> 'Raimon',
538
			'styles_tl_contact'		=> '/community/memberlist.php?mode=viewprofile&u=253197',
539
			'WEBSITE_TL_NAME'		=> 'MichaelC',
540
			'WEBSITE_TL_CONTACT'	=> '/community/memberlist.php?mode=viewprofile&u=1175315',
541
			'ext_dev_tl_name'		=> 'VSE',
542
			'ext_dev_tl_contact'	=> '/community/memberlist.php?mode=viewprofile&u=868795',
543
			'ext_tl_name'			=> 'DavidIQ',
544
			'ext_tl_contact'		=> '/community/memberlist.php?mode=viewprofile&u=159755',
545
		);
546
547
		return $peopleVars;
548
	}
549
550
	private function getMiscVars()
551
	{
552
		$miscVars = array(
553
			'package_version'		=> '3.2.0',
554
			'package_release_date'	=> '2017-01-07',
555
			'PACKAGE_VERSION'		=> '3.2.0',
556
			'PACKAGE_ANNOUNCE_URL'	=> '/community/viewtopic.php?f=14&t=2399606',
557
			'PACKAGE_RELEASE_DATE'	=> '2017-01-07',
558
559
			'bot'					=> false, // @TODO Set this to true for bots // Usage = 1
560
			'is_on_team'			=> false, // @TODO Set this up to use sessions management and see if they are on the team
561
562
			'ROOT_PATH'			=> '/',
563
			'THEME_PATH'			=> '/theme',
564
			'FAVICON_PATH'		=> '/assets/images/images/favicons',
565
			'YEAR'				=> date('Y'),
566
			'ON_TEAM'				=> false,
567
568
			'HOME'				=> '/',
569
570
			'CONTACT'				=> '/contact/',
571
572
			// Old KB - Remove after the conversion
573
			'KB_PHPBB_TEAM'		=> '/community/memberlist.php?mode=leaders',
574
575
			'LONDONVASION_POST'	=> '/community/viewtopic.php?f=14&amp;t=1058455',
576
			'LONDONVASION'		=> '/londonvasion/',
577
			'LIBERTYVASION'		=> '/libertyvasion/',
578
			'CHANGELOG'			=> '/support/documents.php?mode=changelog&amp;version=3',
579
			'INSTALL_DOCUMENT'	=> '/support/documents.php?mode=install&amp;version=3',
580
			'LICENSE'				=> '/downloads/license/',
581
			'OFFICIAL_TOOLS'				=> '/customise/db/official_tools-23',
582
583
			'SHOWCASE_SUGGEST'		=> '/showcase/suggest/',
584
585
			'languages_path'				=> '/languages/',
586
			'LANGUAGES_SUB'					=> '/languages/',
587
588
			'ABOUT_ADMIN'			=> '/about/team/adm/',
589
			'ABOUT_ADMIN_USERS'	=> '/about/team/adm/users.php',
590
			'ABOUT_ADMIN_TEAMS'	=> '/about/team/adm/teams.php',
591
			'ABOUT_ADMIN_LOG'		=> '/about/team/adm/log.php',
592
593
			// about history
594
			'NO_PHPBB2_2'				=> '/community/viewtopic.php?t=256072',
595
			'PHPBBCOM_NEW_WEBSITE'	=> '/community/viewtopic.php?t=543015',
596
			'FIRST_RC_30X'			=> '/community/viewtopic.php?t=615945',
597
598
			// URLS to mailing list
599
			'LISTS_SUBSCRIBE'		=> 'http://lists.phpbb.com/mailman/subscribe/phpbb-announce', // Usage = 1
600
601
			// Languages
602
			'LANGUAGES_HOWTO'	=>	'/community/viewtopic.php?f=66&amp;t=1858645',
603
604
			'COMMUNITY'			=> '/community/',
605
			'RULES'				=> '/rules/',
606
			'MODS_RULES'			=> '/mods/rules/',
607
			'GOOGLECSE'			=> '/search/',
608
			'community_search'	=> '/community/search.php',
609
			'ADVERTISE'			=> '/about/advertise/',
610
			'LANGUAGES_30X'		=> '/languages/',
611
			'LANGUAGES_20X'		=> '/languages/?type=20x',
612
613
			'HOSTING'					=> '/hosting/',
614
			'HOSTING_FROM_DOWNLOADS'	=> '/hosting/?from=downloads',
615
616
			// retired 2.0.x
617
			'RETIRED_2X'			=> '/community/viewtopic.php?f=14&amp;t=1385785',
618
619
			// URLs to news feeds
620
			'FEEDS_DEFAULT'		=> '/feeds/',
621
			'FEEDS_ATOM'			=> '/feeds/atom/',
622
623
			// Social Media sites
624
			'FACEBOOK'			=> 'http://www.facebook.com/phpBB',
625
			'TWITTER'				=> 'http://www.twitter.com/phpbb',
626
			// phpBB Demo
627
			'DEMO_30X'			=> 'http://try-phpbb.com/30x',
628
			'demo_31x'			=> 'http://try-phpbb.com/31x',
629
			'latest_demo'		=> 'http://try-phpbb.com/31x',
630
631
			'MANAGEMENT_TEAM'	=> '/community/memberlist.php?mode=group&g=13330',
632
		);
633
634
		return $miscVars;
635
	}
636
637
	public function getLegacyVars()
638
	{
639
		$legacyVars = array(
640
			'U_ABOUT'							=> '/about/',
641
			'U_ABOUT_FEATURES_SUB'				=> '/about/features/',
642
			'U_ABOUT_HISTORY_SUB'				=> '/about/history/',
643
			'U_ABOUT_GETINVOLVED_SUB'			=> '/get-involved/',
644
			'U_ABOUT_TEAM_SUB'					=> '/about/team/',
645
			'U_ABOUT_CONTACT_SUB'				=> '/about/contact/',
646
			'U_ABOUT_ADVERTISE_SUB'				=> '/about/advertise/',
647
			'U_ABOUT_LAUNCH_SUB'				=> '/about/launch/',
648
649
			'U_DOWNLOADS_HEADER'				=> '/downloads/?from=header',
650
			'U_DOWNLOADS_SUB'					=> '/downloads/',
651
			'U_DOWNLOADS_UPDATE_SUB'			=> '/downloads/#update',
652
			'U_STYLES_DB_SUB'					=> '/customise/db/styles-2',
653
			'U_LANGUAGES_SUB'					=> '/languages/',
654
655
			'U_CUSTOMISE'						=> '/customise/',
656
			'U_CDB_SUB'							=> '/customise/db/',
657
			'U_EXT_SUB'							=> '/extensions/',
658
			'U_EXT_DB_SUB'						=> '/customise/db/extensions-36',
659
			'U_MODS_SUB'						=> '/mods/',
660
			'U_MODS_DB_SUB'						=> '/customise/db/modifications-1',
661
			'U_STYLES_SUB'						=> '/styles/',
662
			'U_STYLES_DEMO_SUB'					=> '/styles/demo/3.0/',
663
664
			'U_SUPPORT_DOCS_SUB'				=> '/support/docs/',
665
			'U_SUPPORT_KB_SUB'					=> '/support/docs/en/3.1/kb/',
666
			'U_SUPPORT_IRC_SUB'					=> '/support/irc/',
667
			'U_SUPPORT_TUTORIALS_SUB'			=> '/support/tutorials/3.0/',
668
			'U_SUPPORT_FORUMS_SUB'				=> '/community/viewforum.php?f=551',
669
			'U_SUPPORT_INTL_SUB'				=> '/support/intl/',
670
671
			'U_DEVELOPMENT'						=> '/development/',
672
			'U_DEV_WIKI_SUB'					=> 'https://wiki.phpbb.com/',
673
			'U_DEV_GI_SUB'						=> '/development/get-involved/',
674
			'U_BUGS_SUB'						=> '/bugs/',
675
			'U_BUGS_PHPBB_SUB'					=> 'http://tracker.phpbb.com/',
676
			'U_SECURITY_SUB'					=> '/security/',
677
			'U_DEV_HOME_SUB'					=> '//area51.phpbb.com/',
678
679
			'U_IDEAS'							=> '/ideas',
680
681
			'U_FORUM_INDEX_SUB'					=> '/community/',
682
			'U_ABOUT_INDEX_SUB'					=> '/about/',
683
			'U_CUSTOMISE_INDEX_SUB'				=> '/customise/',
684
			'U_SUPPORT_INDEX_SUB'				=> '/support/',
685
			'U_DEV_INDEX_SUB'					=> '/development/',
686
687
			'U_CDB_MOD_SUPPORT'					=> '/customise/db/support/modifications-1', // TODO: remove (used in support_forums.html)
688
			'U_CDB_STYLE_SUPPORT'				=> '/customise/db/support/styles-2', // TODO: remove
689
			'U_CDB_CONVERTOR_SUPPORT'			=> '/customise/db/support/converter/', // TODO: remove (used in support_forums.html)
690
			'U_CDB_TRANSLATION_SUPPORT'			=> '/customise/db/support/translation/', // TODO: remove
691
692
			'U_DEMO'							=> '/demo/',
693
			'U_SHOWCASE'						=> '/showcase/',
694
			'U_DOWNLOADS'						=> '/downloads/',
695
			'U_OFFICIAL_TOOLS'					=> '/customise/db/official_tools-23',
696
			'U_SUPPORT'							=> '/support/',
697
			'U_BLOG'							=> '//blog.phpbb.com/',
698
			'U_COMMUNITY'						=> '/community/',
699
			'U_DEV_BOARD'						=> '//area51.phpbb.com/phpBB/',
700
			'U_HOSTING'							=> '/hosting/',
701
		);
702
703
		return $legacyVars;
704
	}
705
}
706