831 |
florian |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
////////////////////////////////////////////////////////////////////////////////
|
|
|
4 |
// //
|
|
|
5 |
// Copyright (C) 2006 Phorum Development Team //
|
|
|
6 |
// http://www.phorum.org //
|
|
|
7 |
// //
|
|
|
8 |
// This program is free software. You can redistribute it and/or modify //
|
|
|
9 |
// it under the terms of either the current Phorum License (viewable at //
|
|
|
10 |
// phorum.org) or the Phorum License that was distributed with this file //
|
|
|
11 |
// //
|
|
|
12 |
// This program is distributed in the hope that it will be useful, //
|
|
|
13 |
// but WITHOUT ANY WARRANTY, without even the implied warranty of //
|
|
|
14 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. //
|
|
|
15 |
// //
|
|
|
16 |
// You should have received a copy of the Phorum License //
|
|
|
17 |
// along with this program. //
|
|
|
18 |
////////////////////////////////////////////////////////////////////////////////
|
|
|
19 |
|
|
|
20 |
// Check if the files for all configured languages
|
|
|
21 |
// are available in the installation.
|
|
|
22 |
|
|
|
23 |
$phorum_check = "Language support";
|
|
|
24 |
|
|
|
25 |
function phorum_check_language() {
|
|
|
26 |
$PHORUM = $GLOBALS["PHORUM"];
|
|
|
27 |
|
|
|
28 |
$checked = array();
|
|
|
29 |
|
|
|
30 |
// Check for the default language file.
|
|
|
31 |
if (! file_exists("./include/lang/{$PHORUM["default_language"]}.php")) return array(
|
|
|
32 |
PHORUM_SANITY_WARN,
|
|
|
33 |
"Your default language is set to
|
|
|
34 |
\"".htmlspecialchars($PHORUM["default_language"])."\",
|
|
|
35 |
but the language file \"include/lang/".
|
|
|
36 |
htmlspecialchars($PHORUM["default_language"].".php")."\" is
|
|
|
37 |
not available on your system (anymore?).",
|
|
|
38 |
"Install the specified language file to make this default
|
|
|
39 |
language work or change the Default Language setting
|
|
|
40 |
under General Settings."
|
|
|
41 |
);
|
|
|
42 |
$checked[$PHORUM["default_language"]] = true;
|
|
|
43 |
|
|
|
44 |
// Check for the forum specific language file(s).
|
|
|
45 |
$forums = phorum_db_get_forums();
|
|
|
46 |
foreach ($forums as $id => $forum) {
|
|
|
47 |
if (!empty($forum["language"]) && !$checked[$forum["language"]] &&
|
|
|
48 |
!file_exists("./include/lang/{$forum["language"]}.php")) {
|
|
|
49 |
return array(
|
|
|
50 |
PHORUM_SANITY_WARN,
|
|
|
51 |
"The language for forum \"".
|
|
|
52 |
htmlspecialchars($forum["name"])."\" is set to
|
|
|
53 |
\"".htmlspecialchars($forum["language"])."\",
|
|
|
54 |
but the language file \"include/lang/".
|
|
|
55 |
htmlspecialchars($forum["language"].".php")."\" is
|
|
|
56 |
not available on your system (anymore?).",
|
|
|
57 |
"Install the specified language file to make this language
|
|
|
58 |
work or change the language setting for the forum."
|
|
|
59 |
);
|
|
|
60 |
}
|
|
|
61 |
$checked[$forum["language"]] = true;
|
|
|
62 |
}
|
|
|
63 |
|
|
|
64 |
// All checks are OK.
|
|
|
65 |
return array(PHORUM_SANITY_OK, NULL);
|
|
|
66 |
}
|
|
|
67 |
?>
|