[239] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | /** This file is part of KCFinder project
|
---|
| 4 | *
|
---|
| 5 | * @desc Load language labels into JavaScript
|
---|
| 6 | * @package KCFinder
|
---|
| 7 | * @version 2.51
|
---|
| 8 | * @author Pavel Tzonkov <pavelc@users.sourceforge.net>
|
---|
| 9 | * @copyright 2010, 2011 KCFinder Project
|
---|
| 10 | * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
|
---|
| 11 | * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2
|
---|
| 12 | * @link http://kcfinder.sunhater.com
|
---|
| 13 | */
|
---|
| 14 |
|
---|
| 15 | require "core/autoload.php";
|
---|
| 16 | if (function_exists('set_magic_quotes_runtime'))
|
---|
| 17 | @set_magic_quotes_runtime(false);
|
---|
| 18 | $input = new input();
|
---|
| 19 | if (!isset($input->get['lng']) || ($input->get['lng'] == 'en')) {
|
---|
| 20 | header("Content-Type: text/javascript");
|
---|
| 21 | die;
|
---|
| 22 | }
|
---|
| 23 | $file = "lang/" . $input->get['lng'] . ".php";
|
---|
| 24 | $files = dir::content("lang", array(
|
---|
| 25 | 'types' => "file",
|
---|
| 26 | 'pattern' => '/^.*\.php$/'
|
---|
| 27 | ));
|
---|
| 28 | if (!in_array($file, $files)) {
|
---|
| 29 | header("Content-Type: text/javascript");
|
---|
| 30 | die;
|
---|
| 31 | }
|
---|
| 32 | $mtime = @filemtime($file);
|
---|
| 33 | if ($mtime) httpCache::checkMTime($mtime);
|
---|
| 34 | require $file;
|
---|
| 35 | header("Content-Type: text/javascript; charset={$lang['_charset']}");
|
---|
| 36 | foreach ($lang as $english => $native)
|
---|
| 37 | if (substr($english, 0, 1) != "_")
|
---|
| 38 | echo "browser.labels['" . text::jsValue($english) . "']=\"" . text::jsValue($native) . "\";";
|
---|
| 39 |
|
---|
| 40 | ?>
|
---|