7 * @link http://www.open-emr.org
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @copyright Copyright (c) 2018 Brady Miller <brady.g.miller@gmail.com>
10 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 require_once("../globals.php");
14 require_once("$srcdir/registry.inc.php");
15 require_once("language.inc.php");
17 use OpenEMR\Common\Csrf\CsrfUtils
;
18 use OpenEMR\Core\Header
;
20 // Generates a Javascript section to activate the specified tab.
21 function activate_lang_tab($linkid)
33 $s .= "\$('#$id')." . ($id == $linkid ?
'addClass' : 'removeClass') . "('active');\n";
39 //START OUT OUR PAGE....
43 <?php Header
::setupHeader(['knockout']); ?
>
46 <body
class="body_top">
47 <div id
="container_div" class="container">
49 <div
class="col-sm-12">
50 <div
class="clearfix">
51 <h2
class="title"><?php
echo xlt('Multi Language Tool'); ?
></h2
>
54 </div
><!--end of header div
-->
55 <div
class="container-fluid mb-3">
56 <form name
='translation' id
='translation' method
='get' action
='language.php' onsubmit
="return top.restoreSession()">
57 <input type
="hidden" name
="csrf_token_form" value
="<?php echo attr(CsrfUtils::collectCsrfToken()); ?>" />
58 <input type
='hidden' name
='m' value
='<?php echo attr($_GET['m
'] ?? ''); ?>' />
59 <input type
='hidden' name
='edit' value
='<?php echo attr($_GET['edit
'] ?? ''); ?>' />
60 <!-- <span
class="title"><?php
echo xlt('Multi Language Tool'); ?
></span
> -->
61 <ui
class="nav nav-pills">
62 <li
class="nav-item" id
="li-definition">
63 <a href
="?m=definition&csrf_token_form=<?php echo attr_url(CsrfUtils::collectCsrfToken()); ?>" onclick
="top.restoreSession()" class="nav-link font-weight-bold" id
="definition-link"><?php
echo xlt('Edit Definitions'); ?
></a
>
65 <li
class="nav-item" id
="li-language">
66 <a href
="?m=language&csrf_token_form=<?php echo attr_url(CsrfUtils::collectCsrfToken()); ?>" onclick
="top.restoreSession()" class="nav-link font-weight-bold" id
="language-link"><?php
echo xlt('Add Language'); ?
></a
>
68 <li
class="nav-item" id
="li-constant">
69 <a href
="?m=constant&csrf_token_form=<?php echo attr_url(CsrfUtils::collectCsrfToken()); ?>" onclick
="top.restoreSession()" class="nav-link font-weight-bold" id
="constant-link"><?php
echo xlt('Add Constant'); ?
></a
>
71 <li
class="nav-item" id
="li-manage">
72 <a href
="?m=manage&csrf_token_form=<?php echo attr_url(CsrfUtils::collectCsrfToken()); ?>" onclick
="top.restoreSession()" class="nav-link font-weight-bold" id
="manage-link"><?php
echo xlt('Manage Translations'); ?
></a
>
74 <li
class="nav-item" id
="li-csv">
75 <a href
="?m=csv&csrf_token_form=<?php echo attr_url(CsrfUtils::collectCsrfToken()); ?>" onclick
="top.restoreSession()" class="nav-link font-weight-bold" id
="csv-link"><?php
echo xlt('Load from CSV'); ?
></a
>
79 </div
><!--end of nav
-pills div
-->
81 <div
class="col-sm-12">
82 <div
class="jumbotron jumbotron-fluid py-3">
83 <div
class="col-sm-12 col-md-12 col-lg-12">
85 if (!empty($_GET['m'])) {
86 if (!CsrfUtils
::verifyCsrfToken($_GET["csrf_token_form"])) {
87 CsrfUtils
::csrfNotVerified();
90 // Set a variable, so below scripts can
91 // not be run on their own
92 $langModuleFlag = true;
96 require_once('lang_definition.php');
99 require_once('lang_constant.php');
102 require_once('lang_language.php');
105 require_once('lang_manage.php');
108 require_once('csv/load_csv_file.php');
111 require_once('csv/validate_csv.php');
115 // If m is parameter empty, To autoload Edit Definitions page content
116 echo('<script>$(function () {$("#definition-link").get(0).click();});</script>');
121 </div
><!--end of page content div
-->
123 <a href
="lang.info.html" class="text-decoration-none" target
="_blank"><?php
echo xlt('Info'); ?
></a
>