1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* Manage languages in a database
|
5
|
*
|
6
|
* $Id: languages.php,v 1.9 2005/10/18 03:45:16 chriskl Exp $
|
7
|
*/
|
8
|
|
9
|
// Include application functions
|
10
|
include_once('./libraries/lib.inc.php');
|
11
|
|
12
|
$action = (isset($_REQUEST['action'])) ? $_REQUEST['action'] : '';
|
13
|
if (!isset($msg)) $msg = '';
|
14
|
$PHP_SELF = $_SERVER['PHP_SELF'];
|
15
|
|
16
|
/**
|
17
|
* Show default list of languages in the database
|
18
|
*/
|
19
|
function doDefault($msg = '') {
|
20
|
global $data, $misc, $database;
|
21
|
global $PHP_SELF, $lang;
|
22
|
|
23
|
$misc->printTrail('database');
|
24
|
$misc->printTabs('database','languages');
|
25
|
$misc->printMsg($msg);
|
26
|
|
27
|
$languages = $data->getLanguages();
|
28
|
|
29
|
$columns = array(
|
30
|
'language' => array(
|
31
|
'title' => $lang['strname'],
|
32
|
'field' => 'lanname',
|
33
|
),
|
34
|
'trusted' => array(
|
35
|
'title' => $lang['strtrusted'],
|
36
|
'field' => 'lanpltrusted',
|
37
|
'type' => 'yesno',
|
38
|
),
|
39
|
'function' => array(
|
40
|
'title' => $lang['strfunction'],
|
41
|
'field' => 'lanplcallf',
|
42
|
),
|
43
|
);
|
44
|
|
45
|
$actions = array();
|
46
|
|
47
|
$misc->printTable($languages, $columns, $actions, $lang['strnolanguages']);
|
48
|
}
|
49
|
|
50
|
/**
|
51
|
* Generate XML for the browser tree.
|
52
|
*/
|
53
|
function doTree() {
|
54
|
global $misc, $data;
|
55
|
|
56
|
$languages = $data->getLanguages();
|
57
|
|
58
|
$attrs = array(
|
59
|
'text' => field('lanname'),
|
60
|
'icon' => 'languages'
|
61
|
);
|
62
|
|
63
|
$misc->printTreeXML($languages, $attrs);
|
64
|
exit;
|
65
|
}
|
66
|
|
67
|
if ($action == 'tree') doTree();
|
68
|
|
69
|
$misc->printHeader($lang['strlanguages']);
|
70
|
$misc->printBody();
|
71
|
|
72
|
switch ($action) {
|
73
|
default:
|
74
|
doDefault();
|
75
|
break;
|
76
|
}
|
77
|
|
78
|
$misc->printFooter();
|
79
|
|
80
|
?>
|