Commit Graph

59 Commits

Author SHA1 Message Date
Aparup Banerjee 63e8936bb1 MDL-28135 general Updating all hardcoded "docs.moodle.org/en/Development:" type doc links to "docs.moodle.org/dev/" 2011-07-05 15:16:55 +08:00
David Mudrak dcfffe3072 MDL-24531 Extend filter manager API so that options can be passed to the filters
The only option passed at the moment is the original format in which the
user inserted the text. Other options can be added later if/when needed.
2010-10-07 08:57:20 +00:00
Petr Skoda c6947ba7a5 MDL-23899 migration to new locale aware asort 2010-09-05 13:00:47 +00:00
Dongsheng Cai 08e7c07b04 "MDL-23606, legacy_filter should return text even courseid is null, all text in user context will be empty" 2010-08-04 07:19:58 +00:00
Petr Skoda 35716b8682 MDL-22001 filter_text() and filter_string() now use context parameter instead of courseid, PAGE->context is used only as a fallback; moved comment stuff away from format_text() because it does not belong there; filterlib is not using courseid except for legacy filters; fixed coding style in filters;?improved php docs; fixed upgrade of filters (should be in plugins, not core) 2010-07-30 20:51:01 +00:00
Petr Skoda 78bfb562a0 MDL-21249 improved php docs and adding direct access prevention in core libs 2010-07-25 13:35:05 +00:00
Petr Skoda 2b54e7a2b7 fixed inline phpdocs return type 2010-07-05 07:48:37 +00:00
Petr Skoda 9207f7047a few comment typos 2010-05-22 19:08:27 +00:00
Petr Skoda 117bd74897 MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup 2009-11-01 11:31:16 +00:00
samhemelryk ba21c9d440 lib MDL-19236 added phpdocs and copyrights 2009-05-25 08:27:25 +00:00
tjhunt dc14c0767e filterlib: Fix typo 2009-05-09 14:21:11 +00:00
tjhunt a8320eeae9 filters: MDL-19000 don't do ORDER BY in subqueries (thanks Eloy)
Problem introduced by MDL-7336.
2009-04-29 03:12:31 +00:00
tjhunt 3bba572f0e filters: MDL-7336 was missing the table prefix from one column.
Probably does not matter, but I'm adding it in case.
2009-04-20 02:07:46 +00:00
tjhunt 9434fef401 filters: MDL-18879 filter data not deleted when a context is deleted
Missed when implementing MDL-7336

Also, fix minor issues with deleting filters
2009-04-17 02:49:07 +00:00
tjhunt 78ceb4d666 filters: MDL-7336 fix MySQL issues 2009-04-13 07:14:54 +00:00
tjhunt 604eb7be03 filters: MDL-7336 code to let people edit local filter config 2009-04-13 07:14:27 +00:00
tjhunt 0f74bb01ff filters: MDL-7336 settings page for setting the local enabled/disabled state 2009-04-13 07:12:41 +00:00
tjhunt a042675877 filters: MDL-7336 function to get the information the local settings page will need. 2009-04-13 07:07:03 +00:00
tjhunt 16eaf7ed35 filters: MDL-7336 tweak to improve SQL performance 2009-04-13 07:06:22 +00:00
tjhunt 34f07866ba filters: MDL-7336 backup and restore of local filter settings. 2009-04-13 07:06:02 +00:00
tjhunt 5b8fa09b00 filters: MDL-7336 Finish admin settings page. 2009-04-13 07:04:07 +00:00
tjhunt 456c8cc738 filters: MDL-7336 redo global settings page to use the new libs
Note: ->stringfilters update not done yet.
2009-04-13 07:03:32 +00:00
tjhunt ccc161f8f0 filters: MDL-7336 change weblib to use the new code
* Rename filter base class from filter_base to moodle_text_filter
* Remove unnecessary explicit constructors in moodle_text_filter
subclasses
* New filter_manager class, rather than static methods in filter_base
* Move some logic out of weblib, and into filter_manager
* Count filtering ops when $CFG->perfdebug on, via
performance_measuring_filter_manager
* Kill unused filter_string function. Petr said it should have been
private to weblib
2009-04-13 06:56:32 +00:00
tjhunt 1f8c468dbd filters: MDL-7336 rename get_active_filters -> filter_get_active_in_context and improve auto-sorting. 2009-04-13 06:54:34 +00:00
tjhunt 1bd09db947 filters: MDL-7336 implement get_active_filters 2009-04-13 06:53:53 +00:00
tjhunt 56881fdc93 filters: MDL-7336 functions for g/setting local filter_active overrides 2009-04-13 06:53:33 +00:00
tjhunt e1a9622fad filters: MDL-7336 functions for getting and setting filter_config 2009-04-13 06:52:56 +00:00
tjhunt c07e6d8da5 filters: MDL-7336 upgrade $CFG->textfilters into filter_active table. 2009-04-13 06:51:45 +00:00
tjhunt b810a4d3c9 filters: MDL-17684 Look for the filter name in filter_myfilter.php first.
This makes filters more plugginable, becuase with this lang file name, get_string will look for the filter name in filter/myfilter/lang/en_utf8/filter_myfilter.php.

To do this, there is a new function filter_get_name in filterlib that contains the logic.

Also, a new function filter_get_all_installed to replace the logic for getting all filters that was duplicated in three places.

filter_get_name no longer does such a nice fall-back if the name is missing, to encourage people to supply the right string. The fallback now looks like '[[filtername]] (filter/tidy)'.
2009-03-30 08:33:13 +00:00
stronk7 b9061f5768 MDL-18302 filterlib - fixed rebuild of nested ignoretags ; merged from 19_STABLE 2009-02-18 11:03:33 +00:00
stronk7 60ff6ada26 MDL-18165 filterlib - Use one exclusive separator, instead of "." (dot) to avoid saved tags to match with phrases being processed ; merged from 19_STABLE 2009-02-07 00:59:56 +00:00
skodak ce5a068b2f MDL-17738 fixed uninitialised setting 2008-12-28 18:42:35 +00:00
dongsheng 9e3f34d1c7 "FILTER/MDL-14582, filters 2.0, compatible with old filters" 2008-12-19 02:16:00 +00:00
stronk7 4ffc25ce55 Fix A tag regex searching. MDL-15842 ; merged from 19_STABLE 2008-07-26 22:13:39 +00:00
jmg324 6c4ed854f6 MDL-12302 stopping filter_save_ignore_tags ignoring empty tags 2008-06-06 09:15:33 +00:00
skodak 810944af7f we are going 100% unicode now - removed use of $CFG->unicodedb and current_charset(); MDL-7439 - part 2, only hotpot and wiki left 2006-11-11 17:23:20 +00:00
skodak 4090bcaee3 Activitynames filter case insensitive again for non-ascii languages MDL-6054 - I hope it will not be choking on invalid UTF-8 data; merged from MOODLE_17_STABLE 2006-10-17 19:46:35 +00:00
skodak 57f1b91497 fixed some incorrect strtolower() calls that were breaking non ascii languages MDL-6135 2006-10-07 20:47:54 +00:00
tjhunt 450a0a7db7 Merge from stable branch: Convert tabs to spaces in files where there were only a few rogue tabs. 2006-05-17 16:47:44 +00:00
martinlanghoff b76169a214 filterlib/filter_phrases() - try to escape magic characters used internally by the filter mechanism -- Bug#5236 / WR#422
This is an attempt to fix filter problems caused by glossary matches on %
(which also affect matches on * and #). Works for the sample cases I have,
but we may be breaking subtly in other places.
2006-04-25 22:47:42 +00:00
skodak d8eb52a2d0 fixed bug #2596 - filterlib is now adding popup javascript into html files 2006-03-03 23:25:27 +00:00
stronk7 413884c736 With the latest feature I introduced to filterlib (the ability
to specify a replacement phrase instead of printing the linked
phrase I introduced a bug about text being showed with the case
of the concept instead of the case of the text under case
insensitive filtering. Detected and solved now. Bug 3688.
(http://moodle.org/bugs/bug.php?op=show&bugid=3688)

Merged from MOODLE_15_STABLE
2005-07-05 16:43:48 +00:00
stronk7 0eddfc6625 Add a new attribute to the filterobject class.
Now it supports a replacementphrase to be passed
so, the original phrase will be replaced. Nothing happens
if empty. Part of bug 3605.
(http://moodle.org/bugs/bug.php?op=show&bugid=3605)

Merged from MOODLE_15_STABLE
2005-06-22 23:24:50 +00:00
stronk7 dc3b522580 Latest speed improvement for link filters (more noticeable under PHP4). Bug 3138.
(http://moodle.org/bugs/bug.php?op=show&bugid=3138)
2005-05-21 00:22:14 +00:00
stronk7 156f67fd22 Do you like speed? 10%-15% bump with this version! B-)
Moved some code to two new specialised functions that
are only executed when something has changed in the
text avoiding some (from 2800 downto 150 in my test course!)
regexp calls and arrays generation.

The existing bug about concept strings contained in other concept
strings (e.g: "Test Quiz" and "Test Quiz II") becoming double-linked
in now out too.

I hope this is the latest revision to filterlib for a looong time.
Tested under PHP 4.3.11 and PHP 5.0.4, it would be very interesting
to test it under other versions/OSs.
2005-05-09 00:28:53 +00:00
stronk7 ed9fdf3e8b Some wrong isset sentences were forcing to
be always casesensitive and fullmatch!

Changed from !isset() to empty() to evaluate true/false correctly.
2005-05-08 17:53:32 +00:00
stronk7 9e92e26590 Solved problem with arrays of linkobjects being processed
by preg_quoted() causing real problems under PHP5. Now such
calculatios are cached if possible (PHP5). See bug 3148.
(http://moodle.org/bugs/bug.php?op=show&bugid=3138)
2005-05-08 17:25:28 +00:00
stronk7 902c63b023 Reducing a bit the number of replacements performed by the filter. ;-) 2005-04-27 18:34:38 +00:00
stronk7 29f46cb6fb Now it works using static instead of $_REQUEST. Thanks to Martin!
Now I know a bit more of PHP :-)
2005-03-22 17:29:02 +00:00
stronk7 a06967fdb9 Added support for $CFG->filtermatchoneperpage, allowing a phrase
to be linked only once in the entire page.
2005-03-21 23:47:21 +00:00