forked from coppermine-gallery/cpg1.6.x
-
Notifications
You must be signed in to change notification settings - Fork 1
/
getlang.php
61 lines (52 loc) · 1.64 KB
/
getlang.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2016 Coppermine Dev Team
v1.0 originally written by Gregory Demar
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3
as published by the Free Software Foundation.
********************************************
Coppermine version: 1.6.01
$HeadURL$
**********************************************/
define('IN_COPPERMINE', true);
define('ADMIN_PHP', true);
define('LANG_DIR', 'lang');
require('include/init.inc.php');
$dir = opendir(LANG_DIR);
$lang_files = array();
while ($file = readdir($dir)) {
if (is_file(LANG_DIR . '/' . $file)) {
$lang_files[] = $file;
}
}
closedir($dir);
asort($lang_files);
/*if (isset($_GET['get'])) {
$file_index = (int)$_GET['get'];*/
if ($superCage->get->keyExists('get')) {
$file_index = $superCage->get->getInt('get');
if (isset($lang_files[$file_index])) {
header("Content-type: application/php");
header("Content-Disposition: attachment; filename={$lang_files[$file_index]}");
fpassthru(fopen(LANG_DIR . '/' . $lang_files[$file_index], 'r'));
exit;
}
}
pageheader('Language files');
starttable('100%', 'Language files');
$folder_icon = cpg_fetch_icon('folder', 0);
foreach ($lang_files as $index => $file) {
echo <<<EOT
<tr>
<td class="tableb">
{$folder_icon} <a href="{$CPG_PHP_SELF}?get=$index">$file</a>
</td>
</tr>
EOT;
}
endtable();
pagefooter();
//EOF