1 |
6daefa8c
|
Petr Lukašík
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* Manage conversions in a database
|
5 |
|
|
*
|
6 |
|
|
* $Id: conversions.php,v 1.11 2005/10/18 03:45:15 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 conversions in the database
|
18 |
|
|
*/
|
19 |
|
|
function doDefault($msg = '') {
|
20 |
|
|
global $data, $conf, $misc, $database;
|
21 |
|
|
global $PHP_SELF, $lang;
|
22 |
|
|
|
23 |
|
|
$misc->printTrail('schema');
|
24 |
|
|
$misc->printTabs('schema', 'conversions');
|
25 |
|
|
$misc->printMsg($msg);
|
26 |
|
|
|
27 |
|
|
$conversions = $data->getconversions();
|
28 |
|
|
|
29 |
|
|
$columns = array(
|
30 |
|
|
'conversion' => array(
|
31 |
|
|
'title' => $lang['strname'],
|
32 |
|
|
'field' => 'conname',
|
33 |
|
|
),
|
34 |
|
|
'source_encoding' => array(
|
35 |
|
|
'title' => $lang['strsourceencoding'],
|
36 |
|
|
'field' => 'conforencoding',
|
37 |
|
|
),
|
38 |
|
|
'target_encoding' => array(
|
39 |
|
|
'title' => $lang['strtargetencoding'],
|
40 |
|
|
'field' => 'contoencoding',
|
41 |
|
|
),
|
42 |
|
|
'default' => array(
|
43 |
|
|
'title' => $lang['strdefault'],
|
44 |
|
|
'field' => 'condefault',
|
45 |
|
|
'type' => 'yesno',
|
46 |
|
|
),
|
47 |
|
|
'comment' => array(
|
48 |
|
|
'title' => $lang['strcomment'],
|
49 |
|
|
'field' => 'concomment',
|
50 |
|
|
),
|
51 |
|
|
);
|
52 |
|
|
|
53 |
|
|
$actions = array();
|
54 |
|
|
|
55 |
|
|
$misc->printTable($conversions, $columns, $actions, $lang['strnoconversions']);
|
56 |
|
|
}
|
57 |
|
|
|
58 |
|
|
/**
|
59 |
|
|
* Generate XML for the browser tree.
|
60 |
|
|
*/
|
61 |
|
|
function doTree() {
|
62 |
|
|
global $misc, $data;
|
63 |
|
|
|
64 |
|
|
$conversions = $data->getconversions();
|
65 |
|
|
|
66 |
|
|
$attrs = array(
|
67 |
|
|
'text' => field('conname'),
|
68 |
|
|
'icon' => 'conversions',
|
69 |
|
|
'toolTip'=> field('concomment')
|
70 |
|
|
);
|
71 |
|
|
|
72 |
|
|
$misc->printTreeXML($conversions, $attrs);
|
73 |
|
|
exit;
|
74 |
|
|
}
|
75 |
|
|
|
76 |
|
|
if ($action == 'tree') doTree();
|
77 |
|
|
|
78 |
|
|
$misc->printHeader($lang['strconversions']);
|
79 |
|
|
$misc->printBody();
|
80 |
|
|
|
81 |
|
|
switch ($action) {
|
82 |
|
|
default:
|
83 |
|
|
doDefault();
|
84 |
|
|
break;
|
85 |
|
|
}
|
86 |
|
|
|
87 |
|
|
$misc->printFooter();
|
88 |
|
|
|
89 |
|
|
?>
|