vanyog / moodle-filter_multilangsecond Goto Github PK
View Code? Open in Web Editor NEWA more flexible version of Moodle multilang filter.
A more flexible version of Moodle multilang filter.
I had a heavily nested html enclosed by
$search0 = '/(?:<([a-z]+)[^>]*?lang=".*?".*?>.*?<\/\1>).*<\1[^>]*?lang=".*?".*?>.*?<\/\1>/is';
Hi,
I have enabled your multilang filter for content and headings and am processing both the Moodle core multilang syntax as well as your new simplified syntax.
In one of our custom plugins, we are sending strings like
SommersemesterSummer term 2013
through format_string().
As a result, we see that the space between the closing span and "2013" is missing!
If I do the same with the Moodle core multilang filter, the space is still there as it should be.
For your information:
If I send
2013 SommersemesterSummer term
through format_string() with your filter, the space is there in the resulting string as it should be.
Could you please have a look at this?
Thanks,
Alex
Hi Vanyo,
There seems to be a bug in your recently released 2014032300 version of the multilangsecond code. The bug only becomes obvious in Moodle when you have debugging set to Developer Mode . Here is my test string:
<p>{mlang en}English{mlang}{mlang fr}French{mlang}</p>
When the filter code is executed, I end up with is the following PHP notice:
Notice: Undefined index: en in /moodle/filter/multilangsecond/filter.php on line 106.
Notice: Undefined index: fr in /moodle/filter/multilangsecond/filter.php on line 106
This is what is causing the error in line 106:
$rawlanglist[$ri][$index]
When I do a var_dump($rawlanglist[1]) I see:
array(2) {
[0]=>string(2) "en"
[1]=>string(2) "fr"
}
As you can see, $rawlanglist is a single dimension array and none of the array indexes are named 'en' or 'fr'.
Hope this helps you figure out the solution.
Best regards,
Michael
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.