-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathtest.php
64 lines (57 loc) · 2.81 KB
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* MathType filter test page.
*
* @package filter_wiris
* @subpackage wiris
* @copyright WIRIS Europe (Maths for more S.L)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
function create_atto_compatibility_row($currenteditordata = null, $solutionlink = null) {
// Get Wiris plugin instance.
$wirisplugin = filter_wiris_pluginwrapper::get_wiris_plugin();
// Prepare test name.
$testname = get_string('wirispluginfilterfor', 'filter_wiris') . ' ' . $currenteditordata['plugin_name'] . ' versions';
// Get plugin version.
$pluginversion = '';
$versionfile = (strtolower($currenteditordata['plugin_name']) == 'tinymce' || strtolower($currenteditordata['plugin_name']) == 'tiny')
? $currenteditordata['plugin_path'] . '/../version.php'
: $currenteditordata['plugin_path'] . '/version.php';
if (file_exists($versionfile)) {
include($versionfile);
if (isset($plugin->version)) {
$pluginversion = $plugin->version;
}
}
// Get filter version.
$filterversion = isset($plugin->version) ? $plugin->version : '';
// Check compatibility.
if ($filterversion == $pluginversion) {
$reporttext = get_string('wirispluginfilterfor', 'filter_wiris') . ' ' . $currenteditordata['plugin_name'] . ' ' .
get_string('havesameversion', 'filter_wiris');
$condition = true;
} else {
$reporttext = get_string('wirispluginfilterfor', 'filter_wiris') . ' ' . $currenteditordata['plugin_name'] . ' ' .
get_string('versionsdontmatch', 'filter_wiris');
$reporttext .= "<br>" . get_string('wirisfilterversion', 'filter_wiris') . ' ' . $filterversion;
$reporttext .= "<br>" . get_string('wirispluginfor', 'filter_wiris') . ' ' . $currenteditordata['plugin_name'] .
' ' . get_string('version', 'filter_wiris') . ' = ' . $pluginversion;
$condition = false;
}
// Return the HTML output as a string.
return html_writer::tag('tr', wrs_createtablerow($testname, $reporttext, $solutionlink, $condition), ['class' => 'wrs_plugin wrs_filter']);
}