-
Notifications
You must be signed in to change notification settings - Fork 33
/
articles.php
44 lines (37 loc) · 1.24 KB
/
articles.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
use src\Models\Stats\CacheStats;
use src\Utils\I18n\I18n;
//prepare the templates and include all neccessary
require_once(__DIR__.'/lib/common.inc.php');
// get the article name to display
if (isset($_REQUEST['page']) &&
mb_ereg_match('^[A-Za-z0-9_]+$', $_REQUEST['page'])
) {
$article = $_REQUEST['page'];
} else {
$article = '';
}
if (!file_exists(__DIR__.'/src/Views/articles/' . $article . '.tpl.php')) {
// article doesn't exists
tpl_errorMsg('Article "'.$article.'"', tr('page_not_found'));
} else {
// set article inside the articles-directory
switch ($_REQUEST['page']) {
case 'stat':
tpl_set_var('cachetype_chart_data', CacheStats::getChartDataCacheTypes());
tpl_set_var('cachesfound_chart_data', CacheStats::getChartDataCachesFound());
break;
case 's102':
$view->loadJQueryUI();
break;
default:
break;
}
if (file_exists(__DIR__.'/src/Views/articles/' . $article . '.inc.php')) {
require_once __DIR__.'/src/Views/articles/' . $article . '.inc.php';
}
$tplname = 'articles/' . $article;
}
tpl_set_var('language4js', I18n::getCurrentLang());
// make the template and send it out
tpl_BuildTemplate();