Skip to content

Commit

Permalink
7.4.0 stable version
Browse files Browse the repository at this point in the history
  • Loading branch information
mcagigas-at-wiris authored Jul 12, 2018
1 parent 0de889a commit 98ef69e
Show file tree
Hide file tree
Showing 16 changed files with 69 additions and 60 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.0.1389
7.4.0.1390
13 changes: 5 additions & 8 deletions classes/configurationupdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ public function updateConfiguration(&$configuration) {

com_wiris_system_CallWrapper::getInstance()->stop();

// configuration.ini wrapper
// Configuration.ini wrapper.

// Connection properties
// Connection properties.

if (get_config('filter_wiris', 'imageservicehost')) {
$configuration['wirisimageservicehost'] = get_config('filter_wiris', 'imageservicehost');
Expand All @@ -111,11 +111,7 @@ public function updateConfiguration(&$configuration) {
$configuration['wirispluginperformance'] = 'false';
}

// Window Properties

if (!get_config('filter_wiris', 'editormodalwindow')) {
$configuration['wiriseditormodalwindow'] = 'false';
}
// Window Properties.

if (get_config('filter_wiris', 'editormodalwindowfullscreen')) {
$configuration['wiriseditormodalwindowfullscreen'] = 'true';
Expand Down Expand Up @@ -156,7 +152,8 @@ public function updateConfiguration(&$configuration) {
// Cas.
$this->wascasenabled = $this->eval_parameter($configuration['wiriscasenabled']);
if (isset($CFG->filter_wiris_cas_enable)) {
$wiriscasenabled = ($this->wascasenabled && $this->eval_parameter($CFG->filter_wiris_cas_enable) && $filterenabled) ? "true" : "false";
$wiriscasenabled = ($this->wascasenabled &&
$this->eval_parameter($CFG->filter_wiris_cas_enable) && $filterenabled) ? "true" : "false";
$configuration['wiriscasenabled'] = $wiriscasenabled;
} else {
$configuration['wiriscasenabled'] = false;
Expand Down
3 changes: 2 additions & 1 deletion classes/pluginwrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ private function init() {
$this->instance = com_wiris_plugin_api_PluginBuilder::newInstance();
$this->instance->addConfigurationUpdater($this->moodleConfig);
$this->instance->addConfigurationUpdater(new com_wiris_plugin_web_PhpConfigurationUpdater());
$this->instance->addConfigurationUpdater(new filter_wiris_pluginwrapperconfigurationupdater(self::$pluginwrapperconfig));
$newpluginwrapperconfiguration = new filter_wiris_pluginwrapperconfigurationupdater(self::$pluginwrapperconfig);
$this->instance->addConfigurationUpdater($newpluginwrapperconfiguration);

// Class to manage file cache.
$cachefile = new moodlefilecache('filter_wiris', 'images');
Expand Down
4 changes: 0 additions & 4 deletions configuration.ini.dist
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@

#wiriseditorsetsize = false

## Specifies if editor should be opened on a modal window or in a pop-up window. true by default.

#wiriseditormodalwindow = true

## Specifies if the modal window should be opened in full-screen mode. false by default.

#wiriseditormodalwindowfullscreen = false
Expand Down
7 changes: 2 additions & 5 deletions filtersettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
'https',
array('http' => 'http', 'https' => 'https')));

// Image properties
// Image properties.

$settings->add(new admin_setting_heading('filter_wiris/imagesettings',
get_string('imagesettings', 'filter_wiris'),
Expand All @@ -117,15 +117,12 @@
get_string('pluginperformance', 'filter_wiris'),
get_string('pluginperformance_help', 'filter_wiris'), '1'));

// Window properties
// Window properties.

$settings->add(new admin_setting_heading('filter_wiris/windowsettings',
get_string('windowsettings', 'filter_wiris'),
get_string('windowsettings_text', 'filter_wiris')));

$settings->add(new admin_setting_configcheckbox('filter_wiris/editormodalwindow',
get_string('editormodalwindow', 'filter_wiris'),
get_string('editormodalwindow_help', 'filter_wiris'), '1'));

$settings->add(new admin_setting_configcheckbox('filter_wiris/editormodalwindowfullscreen',
get_string('editormodalwindowfullscreen', 'filter_wiris'),
Expand Down
19 changes: 12 additions & 7 deletions info.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ function wrs_getstatus($condition) {

function wrs_createtablerow($testname, $reporttext, $solutionlink, $condition) {
$output = html_writer::tag('td', $testname, array('class' => 'wrs_plugin wrs_filter'));
$output .= html_writer::tag('td', wrs_assert($condition, $reporttext, $solutionlink), array('class' => 'wrs_plugin wrs_filter'));
$output .= html_writer::tag('td', wrs_assert($condition, $reporttext, $solutionlink),
array('class' => 'wrs_plugin wrs_filter'));
$output .= html_writer::tag('td', wrs_getstatus($condition), array('class' => 'wrs_plugin wrs_filter'));
return $output;
}
Expand Down Expand Up @@ -132,7 +133,7 @@ function check_if_wiris_button_are_in_tinymce_toolbar() {
}


// Page prologue
// Page prologue.
$PAGE->set_context(context_system::instance());
$PAGE->set_title(get_string('title', 'filter_wiris'));
$PAGE->set_url('/filter/wiris/info.php', array());
Expand Down Expand Up @@ -200,7 +201,7 @@ function check_if_wiris_button_are_in_tinymce_toolbar() {
$output .= html_writer::end_tag('tr');
echo $output;

// MathType filter enabled
// MathType filter enabled.
$output = '';
$output .= html_writer::start_tag('tr', array('class' => 'wrs_plugin wrs_filter'));
$testname = get_string('pluginname', 'filter_wiris');
Expand All @@ -219,7 +220,8 @@ function check_if_wiris_button_are_in_tinymce_toolbar() {

$output = '';
$testname = get_string('lookingforwirisplugin', 'filter_wiris') . $currenteditordata['plugin_name'];
$reporttext = get_string('wirispluginfor', 'filter_wiris') . $currenteditordata['plugin_name'] . get_string('mustbeinstalled', 'filter_wiris');
$reporttext = get_string('wirispluginfor', 'filter_wiris') . $currenteditordata['plugin_name'] .
get_string('mustbeinstalled', 'filter_wiris');
$solutionlink = 'http://www.wiris.com/plugins/moodle/download';
$wirisplugin = $currenteditordata['plugin_path'] . '/core';
$condition = file_exists($wirisplugin);
Expand Down Expand Up @@ -255,12 +257,15 @@ function check_if_wiris_button_are_in_tinymce_toolbar() {
}

if ($filterversion == $pluginversion) {
$reporttext = get_string('wirispluginfilterfor', 'filter_wiris'). $currenteditordata['plugin_name'] . get_string('havesameversion', 'filter_wiris');
$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 = 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;
$reporttext .= "<br>" . get_string('wirispluginfor', 'filter_wiris') . $currenteditordata['plugin_name'] . ' ' .
get_string('version', 'filter_wiris'). ' = ' . $pluginversion;
$condition = false;
}

Expand Down
2 changes: 1 addition & 1 deletion integration/lib/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.0.1389
7.4.0.1390
10 changes: 10 additions & 0 deletions integration/lib/com/wiris/util/type/Arrays.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ static function fromCSV($s) {
}
return $words;
}
static function toIntArray($array) {
$result = new _hx_array(array());
$it = $array->iterator();
while($it->hasNext()) {
$value = Std::parseInt($it->next());
$result->push($value);
unset($value);
}
return $result;
}
static function contains($array, $element) {
return com_wiris_util_type_Arrays::indexOfElement($array, $element) >= 0;
}
Expand Down
2 changes: 1 addition & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function wrs_filterapplettojnlp($text) {
$srcstart = strpos($appletcode, ' src="') + strlen(' src="');
$srcend = strpos($appletcode, '.png"', $srcstart);
$src = substr($appletcode, $srcstart, $srcend - $srcstart + 4);
// Quick fix to obtain the algorithm language
// Quick fix to obtain the algorithm language.
$langstart = strpos($appletcode, ' lang="') + strlen(' lang="');
$langend = strpos($appletcode, ' version="', $langstart);
$lang = substr($appletcode, $langstart, $langend - $langstart - 1);
Expand Down
7 changes: 2 additions & 5 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
'https',
array('http' => 'http', 'https' => 'https')));

// Image properties
// Image properties.

$settings->add(new admin_setting_heading('filter_wiris/imagesettings',
get_string('imagesettings', 'filter_wiris'),
Expand All @@ -117,15 +117,12 @@
get_string('pluginperformance', 'filter_wiris'),
get_string('pluginperformance_help', 'filter_wiris'), '1'));

// Window properties
// Window properties.

$settings->add(new admin_setting_heading('filter_wiris/windowsettings',
get_string('windowsettings', 'filter_wiris'),
get_string('windowsettings_text', 'filter_wiris')));

$settings->add(new admin_setting_configcheckbox('filter_wiris/editormodalwindow',
get_string('editormodalwindow', 'filter_wiris'),
get_string('editormodalwindow_help', 'filter_wiris'), '1'));

$settings->add(new admin_setting_configcheckbox('filter_wiris/editormodalwindowfullscreen',
get_string('editormodalwindowfullscreen', 'filter_wiris'),
Expand Down
27 changes: 14 additions & 13 deletions tests/filter_performance_png_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,22 @@ protected function setUp() {
// Png format.
$testsiteprotocol = strrpos($CFG->wwwroot, 'https') !== false ? 'https' : 'http';

$this->minuspngbase64uri = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACUAAAANCAYAAAAuYadYAAAACXBIWXMAAA7EAAAOxAGVKw4bA';
$this->minuspngbase64uri .= 'AAABGJhU0UAAAAMyZLetQAAAJxJREFUeNpjYEAFakBcC8QXGGgHrIF4DRB/AuJfULui8WlYDMRpQPyfho46CMSRQMwD5Ws';
$this->minuspngbase64uri .= 'B8VGoGF5AS0dhA/JAfGmwOQoEfgw2R1lCo3DQOIoDiE9CMwDFjvpPBCYEBIF4AxC7MRBpIa2BEtRBKsRqoLWjNIB4NhBzk';
$this->minuspngbase64uri .= 'aKJlo4SB+JVQMxCqkZaOmoLNKRIcgypiZUcD/+nk13UAwALiDAoXaNIwQAAAF10RVh0TWF0aE1MADxtYXRoIHhtbG5zPSJ';
$this->minuspngbase64uri .= 'odHRwOi8vd3d3LnczLm9yZy8xOTk4L01hdGgvTWF0aE1MIj48bW4+MTwvbW4+PG1vPi08L21vPjxtbj4yPC9tbj48L21hdG';
$this->minuspngbase64uri .= 'g+Ja9qWgAAAABJRU5ErkJggg==';

// Special chars alt
$this->minuspngbase64uri = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACUAAAANCAYAAAAuYadYAAAACXBIWXMAAA7EAAAOxAGVKw4b';
$this->minuspngbase64uri .= 'AAAABGJhU0UAAAAMyZLetQAAAJxJREFUeNpjYEAFakBcC8QXGGgHrIF4DRB/AuJfULui8WlYDMRpQPyfho46CMSRQMwD5';
$this->minuspngbase64uri .= 'WsB8VGoGF5AS0dhA/JAfGmwOQoEfgw2R1lCo3DQOIoDiE9CMwDFjvpPBCYEBIF4AxC7MRBpIa2BEtRBKsRqoLWjNIB4Nh';
$this->minuspngbase64uri .= 'BzkaKJlo4SB+JVQMxCqkZaOmoLNKRIcgypiZUcD/+nk13UAwALiDAoXaNIwQAAAF10RVh0TWF0aE1MADxtYXRoIHhtbG5';
$this->minuspngbase64uri .= 'zPSJodHRwOi8vd3d3LnczLm9yZy8xOTk4L01hdGgvTWF0aE1MIj48bW4+MTwvbW4+PG1vPi08L21vPjxtbj4yPC9tbj48';
$this->minuspngbase64uri .= 'L21hdGg+Ja9qWgAAAABJRU5ErkJggg==';

// Special chars alt.
$this->specialcharsalt = '{"result":{"text":"1 minus 2"},"status":"ok"}';

$this->pluspngbase64uri = 'iVBORw0KGgoAAAANSUhEUgAAACUAAAANCAYAAAAuYadYAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAABGJhU0UAAAAMyZLetQAAA';
$this->pluspngbase64uri .= 'J1JREFUeNpjYEAFakBcC8QXGGgHrIF4DRB/AuJfULui8WlYDMRpQPyfho46CMSRQMwD5WsB8VGoGF5AjqMo8Yg8EF8abI4Cg';
$this->pluspngbase64uri .= 'R+DzVGW0CgcNI7iAOKT0AxAsQX/icCEgCAQbwBiN1r5mlQ9SlAHqdAyKkjRowHEs4GYi9bpg1g94kC8CohZ6JFoidWzBRpSJ';
$this->pluspngbase64uri .= 'BlMamIlx/H/6WQX9QAAJxI4ILfeWLsAAABddEVYdE1hdGhNTAA8bWF0aCB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMTk5O';
$this->pluspngbase64uri .= 'C9NYXRoL01hdGhNTCI+PG1uPjE8L21uPjxtbz4rPC9tbz48bW4+MjwvbW4+PC9tYXRoPshlGCAAAAAASUVORK5CYII=';
$this->pluspngbase64uri = 'iVBORw0KGgoAAAANSUhEUgAAACUAAAANCAYAAAAuYadYAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAABGJhU0UAAAAMyZLetQA';
$this->pluspngbase64uri .= 'AAJ1JREFUeNpjYEAFakBcC8QXGGgHrIF4DRB/AuJfULui8WlYDMRpQPyfho46CMSRQMwD5WsB8VGoGF5AjqMo8Yg8EF8ab';
$this->pluspngbase64uri .= 'I4CgR+DzVGW0CgcNI7iAOKT0AxAsQX/icCEgCAQbwBiN1r5mlQ9SlAHqdAyKkjRowHEs4GYi9bpg1g94kC8CohZ6JFoidW';
$this->pluspngbase64uri .= 'zBRpSJBlMamIlx/H/6WQX9QAAJxI4ILfeWLsAAABddEVYdE1hdGhNTAA8bWF0aCB4bWxucz0iaHR0cDovL3d3dy53My5vc';
$this->pluspngbase64uri .= 'mcvMTk5OC9NYXRoL01hdGhNTCI+PG1uPjE8L21uPjxtbz4rPC9tbz48bW4+MjwvbW4+PC9tYXRoPshlGCAAAAAASUVORK';
$this->pluspngbase64uri .= '5CYII=';

$this->imagepng = '<img src="' . $testsiteprotocol. '://www.example.com/moodle/filter/wiris/integration/showimage.php';
$this->imagepng .= '?formula=cd345a63d1346d7a11b5e73bb97e5bb7&refererquery=?course=1/category=0"';
Expand Down
23 changes: 14 additions & 9 deletions tests/filter_performance_svg_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,30 @@ protected function setUp() {
$this->safexml = '«math xmlns=¨http://www.w3.org/1998/Math/MathML¨»«mn»1«/mn»«mo»+«/mo»«mn»2«/mn»«/math»';
$this->xml = '<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>1</mn><mo>+</mo><mn>2</mn></math>';

// Image: print("asd");//
$this->specialcharsimagesafexml = '«math xmlns=¨http://www.w3.org/1998/Math/MathML¨»«mi»p«/mi»«mi»r«/mi»«mi»i«/mi»';
$this->specialcharsimagesafexml .= '«mi»n«/mi»«mi»t«/mi»«mo»(«/mo»«mo»§#34;«/mo»«mi»a«/mi»«mi»s«/mi»«mi»d«/mi»«mo»§#34;';
// Image: print "asd".
$this->specialcharsimagesafexml = '«math xmlns=¨http://www.w3.org/1998/Math/MathML¨»«mi»p«/mi»«mi»r';
$this->specialcharsimagesafexml .= '«/mi»«mi»i«/mi»«mi»n«/mi»«mi»t«/mi»«mo»';
$this->specialcharsimagesafexml .= '(«/mo»«mo»§#34;«/mo»«mi»a«/mi»«mi»s«/mi»«mi»d«/mi»«mo»§#34;';
$this->specialcharsimagesafexml .= '«/mo»«mo»)«/mo»«mo»;«/mo»«mo»/«/mo»«mo»/«/mo»«/math»';

// Special image svg
// Special image svg.
$this->imagesvgspecialchars = 'data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2F';
$this->imagesvgspecialchars .= 'svg%22%20xmlns%3Awrs%3D%22http%3A%2F%2Fwww.wiris.com%2Fxml%2Fcvs-extension%22%20height';
$this->imagesvgspecialchars .= '%3D%2221%22%20width%3D%22117%22%20wrs%3Abaseline%3D%2216%22%3E%3C!--MathML%3A%20%3Cmat';

// Special chars alt
$this->specialcharsalt = '{"result":{"text":"p r i n t left parenthesis \" a s d \" right parenthesis semicolon divided by divided by"},"status":"ok"}';
// Special chars alt.
$this->specialcharsalt = '';
$this->specialcharsalt .= '{"result":{"text":"p r i n t left parenthesis \" a s d \" right';
$this->specialcharsalt .= ' parenthesis semicolon divided by divided by"},"status":"ok"}';

// Simple images of "1+2".

// Svg performance.
$this->imagesvgperformance = 'data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3';
$this->imagesvgperformance .= 'Awrs%3D%22http%3A%2F%2Fwww.wiris.com%2Fxml%2Fcvs-extension%22%20height%3D%2220';
$this->imagesvgperformance .= '%22%20width%3D%2234%22%20wrs%3Abaseline%3D%2216%22%3E%3C!--MathML%3A%20%3Cmath%20xmlns%3D%22http%3A%2F%2Fww';
$this->imagesvgperformance = 'data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2F';
$this->imagesvgperformance .= 'www.w3.org%2F2000%2Fsvg%22%20xmlns%3Awrs%3D%22http%3A%2F%2F';
$this->imagesvgperformance .= 'www.wiris.com%2Fxml%2Fcvs-extension%22%20height%3D%2220';
$this->imagesvgperformance .= '%22%20width%3D%2234%22%20wrs%3Abaseline%3D%2216%22%3E%3C!';
$this->imagesvgperformance .= '--MathML%3A%20%3Cmath%20xmlns%3D%22http%3A%2F%2Fww';
$this->imagesvgperformance .= 'w.w3.org%2F1998%2FMath%2FMathML%22%3E%3Cmn%3E1%3C%2Fmn%3E%3Cmo%3E%2B%3C%2';

$this->svg = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:wrs="http://www.wiris.com/xml/cvs-extension" height="20"';
Expand Down
2 changes: 1 addition & 1 deletion tests/filter_without_performance_png_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected function setUp() {
$this->imagepng .= ' data-mathml=\'«math ';
$this->imagepng .= 'xmlns=¨http://www.w3.org/1998/Math/MathML¨»«mn»1«/mn»«mo»+«/mo»«mn»2«/mn»«/math»\'/>';

// Special chars alt
// Special chars alt.
$this->specialcharsalt = '{"result":{"text":"1 plus 2"},"status":"ok"}';

// Svg format.
Expand Down
2 changes: 1 addition & 1 deletion tests/filter_without_performance_svg_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected function setUp() {
$testsiteprotocol = strrpos($CFG->wwwroot, 'https') !== false ? 'https' : 'http';
// Simple image "1+2".

// Special chars alt
// Special chars alt.
$this->specialcharsalt = '{"result":{"text":"1 plus 2"},"status":"ok"}';

// Svg format.
Expand Down
2 changes: 1 addition & 1 deletion thirdpartylibs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<library>
<location>integration</location>
<name>MathType integration engine</name>
<version>7.3.0.1389</version>
<version>7.4.0.1390</version>
<license>GPL</license>
<licenseversion>3.0+</licenseversion>
</library>
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2018060400;
$plugin->release = '7.3.0.1389';
$plugin->version = 2018071200;
$plugin->release = '7.4.0.1390';
$plugin->requires = 2011120511;
$plugin->maturity = MATURITY_STABLE;
$plugin->component = 'filter_wiris';
Expand Down

0 comments on commit 98ef69e

Please sign in to comment.