MDL-22015 fixed more string_manager encapsulation issues - string format conversion...
[moodle.git] / lib / editor / tinymce / plugins / dragmath / dragmath.php
CommitLineData
bd479c7c 1<?php
2
e3d84fb0 3define('NO_MOODLE_COOKIES', true);
4
170b4f9b 5require("../../../../../config.php");
bd479c7c 6
e3d84fb0 7$lang = required_param('elanguage', PARAM_SAFEDIR);
bd479c7c 8
15a17d35
PS
9if (!get_string_manager()->translation_exists($lang, false)) {
10 $lang = 'en';
e3d84fb0 11}
15a17d35 12$SESSION->lang = $lang;
e3d84fb0 13
e3d84fb0 14$langmapping = array('cs'=>'cz', 'pt_br'=>'pt-br');
bd479c7c 15
e3d84fb0 16// fix non-standard lang names
17if (array_key_exists($lang, $langmapping)) {
18 $lang = $langmapping[$lang];
19}
20
21if (!file_exists("$CFG->dirroot/lib/dragmath/applet/lang/$lang.xml")) {
22 $lang = 'en';
23}
24
25@header('Content-Type: text/html; charset=utf-8');
bd479c7c 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" />
e3d84fb0 32<title><?php print_string('dragmath:dragmath_title', 'editor_tinymce')?></title>
bd479c7c 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>
37
38<applet
39 name="dragmath"
40 codebase="<?php echo $CFG->httpswwwroot.'/lib/dragmath/applet' ?>"
41 code="Display/MainApplet.class"
aef0bc48 42 archive="DragMath.jar,lib/AbsoluteLayout.jar,lib/swing-layout-1.0.jar,lib/jdom.jar,lib/jep.jar"
170b4f9b 43 width="540" height="300"
bd479c7c 44>
e3d84fb0 45 <param name="language" value="<?php echo $lang; ?>" />
a262db82 46 <param name="outputFormat" value="MoodleTex" />
e3d84fb0 47 <?php print_string('dragmath:dragmath_javaneeded', 'editor_tinymce', '<a href="http://www.java.com">Java.com</a>')?>
27c718a9 48</applet>
170b4f9b 49<form name="form" action="">
bd479c7c 50 <div>
e3d84fb0 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>
bd479c7c 53 </div>
54</form>
55
56</body>
57</html>