Quote from: Ambush at Aug 21, 2006, 07:24 PM
..However, the events that the documentation covers seem to only cover filters during pageserves. Now, while itâ€™s possible to hook in HTMLPurifier at that point in time, the library is not fast, and it would be better if it was used on form submission. (or, if you have a caching system that I donâ€™t know about, that works too). Any pointers?
You can use the OnDocFormSave event to itercept document saving and alter the posted data. Look for a example here Re: Is it possible to change values when a document is saved in the manager?
Also, you can see all the available events by creating a new plugin and viewing "System Events" tab. I know the documentation isnâ€™t very well detailed at this stage, but there is a reason for this too. The developing pace of this project has been extremely fast and the documentation has not just followed the same pace. There is also a total rewrite going on behind the scenes currently and you can imagine that thereâ€™s not alot of extra energy to write a documentation at this time knowing that it will be outdated in the near future. But with the next release, there will be (along with other documentation) extensive developers documentation built straight from the source, so itâ€™s all being worked on. The future version is using XPDO
ORM layer (also built by MODx core team member) and that will give you some idea where this project is going..
I donâ€™t know what would be the best event/events to implement the HTMLPurifier plugin, but I know that OnDocFormSave is not the best, because at this point none of the chunks/snippets/etc have not returned their output. I guess OnCacheUpdate could be one place to "purify" cached pages. OnParseDocument would be done at every page render, but as you say, it might be too much overhead.. So maybe someone with more knowledge on inner workings can give you a better answer.
Anyways.. hereâ€™s a list of sytem events from 0.9.2.1, some new are coming in 0.9.5 and Ryan even said
that new event for this purpose could be squeezed in if needed
(altought, I think that there is allready enought events to choose from..)
Template Service Events
Cache Service Events
Web Access Service Events
Manager Access Events
Parser Service Events