improved configuration for lang_custom table
[openemr.git] / interface / language / language.php
blob5c093d985f4c7b56de3294daf7024dc34e8e2cc7
1 <?php
2 //INCLUDES, DO ANY ACTIONS, THEN GET OUR DATA
3 include_once("../globals.php");
4 include_once("$srcdir/registry.inc");
5 include_once("$srcdir/sql.inc");
6 include_once("../../library/acl.inc");
7 require_once("language.inc.php");
8 require_once("$srcdir/formdata.inc.php");
10 // Check to see if the lang_custom table exists
11 $test_table = SqlStatement("show tables like 'lang_custom'");
12 if (SqlFetchArray($test_table)) {
13 $enable_custom_language_logging=true;
15 else {
16 $enable_custom_language_logging=false;
18 /* Note that the table mysql lang_custom is required for this function,
19 which can be accomplished with following script in mysql:
20 CREATE TABLE lang_custom (
21 lang_description varchar(100) NOT NULL default '',
22 lang_code char(2) NOT NULL default '',
23 constant_name varchar(255) NOT NULL default '',
24 definition mediumtext NOT NULL default ''
25 ) ENGINE=MyISAM ;
28 //START OUT OUR PAGE....
30 <html>
31 <head>
32 <?php html_header_show();?>
33 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
34 <script type="text/javascript" src="../../library/overlib_mini.js"></script>
35 <script type="text/javascript" src="../../library/calendar.js"></script>
36 </head>
38 <body class="body_top">
39 <form name='translation' id='translation' method='get' action='language.php' onsubmit="return top.restoreSession()">
40 <input type='hidden' name='m' value='<?php echo strip_escape_custom($_GET['m']); ?>' />
41 <input type='hidden' name='edit' value='<?php echo strip_escape_custom($_GET['edit']); ?>' />
42 <span class="title"><?php xl('Multi Language Tool','e') ?></span>
43 <table>
44 <tr>
45 <td class="small" colspan='4'>
46 <a href="?m=definition" onclick="top.restoreSession()"><?php xl('Edit definitions','e'); ?></a> |
47 <a href="?m=language" onclick="top.restoreSession()"><?php xl('Add Language','e'); ?></a> |
48 <a href="?m=constant" onclick="top.restoreSession()"><?php xl('Add Constant','e'); ?></a> |
49 <?php if ($enable_custom_language_logging) { ?>
50 <a href="?m=manage" onclick="top.restoreSession()"><?php xl('Manage Translations','e'); ?></a>
51 <?php } ?>
52 </td>
53 </tr>
54 </table>
55 </form>
57 <?php
58 switch ($_GET['m']):
59 case 'definition':
60 include_once('lang_definition.php');
61 break;
62 case 'constant':
63 include_once('lang_constant.php');
64 break;
65 case 'language':
66 include_once('lang_language.php');
67 break;
68 case 'manage':
69 include_once('lang_manage.php');
70 break;
71 endswitch;
74 <BR><A HREF="lang.info.html" TARGET="_blank"><?php xl('Info','e'); ?></A>
75 </body>
76 </html>