MDL-22015 fixed more string_manager encapsulation issues - string format conversion...
[moodle.git] / lib / editor / tinymce / plugins / dragmath / dragmath.php
1 <?php
3 define('NO_MOODLE_COOKIES', true);
5 require("../../../../../config.php");
7 $lang = required_param('elanguage', PARAM_SAFEDIR);
9 if (!get_string_manager()->translation_exists($lang, false)) {
10     $lang = 'en';
11 }
12 $SESSION->lang = $lang;
14 $langmapping = array('cs'=>'cz', 'pt_br'=>'pt-br');
16 // fix non-standard lang names
17 if (array_key_exists($lang, $langmapping)) {
18     $lang = $langmapping[$lang];
19 }
21 if (!file_exists("$CFG->dirroot/lib/dragmath/applet/lang/$lang.xml")) {
22     $lang = 'en';
23 }
25 @header('Content-Type: text/html; charset=utf-8');
26 ?>
27 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
28     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
29 <html>
30 <head>
31 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
32 <title><?php print_string('dragmath:dragmath_title', 'editor_tinymce')?></title>
33 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
34 <script type="text/javascript" src="js/dragmath.js"></script>
35 </head>
36 <body>
38 <applet 
39         name="dragmath" 
40         codebase="<?php echo $CFG->httpswwwroot.'/lib/dragmath/applet' ?>" 
41         code="Display/MainApplet.class" 
42         archive="DragMath.jar,lib/AbsoluteLayout.jar,lib/swing-layout-1.0.jar,lib/jdom.jar,lib/jep.jar" 
43         width="540" height="300"
44 >
45         <param name="language" value="<?php echo $lang; ?>" />
46         <param name="outputFormat" value="MoodleTex" />
47     <?php print_string('dragmath:dragmath_javaneeded', 'editor_tinymce', '<a href="http://www.java.com">Java.com</a>')?>
48 </applet>
49 <form name="form" action="">
50         <div>
51         <button type="button" onclick="return DragMathDialog.insert();"><?php print_string('common:insert', 'editor_tinymce'); ?></button>
52         <button type="button" onclick="return tinyMCEPopup.close();"><?php print_string('cancel'); ?></button>
53         </div>
54 </form>
56 </body>
57 </html>