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
OnDocPublished
OnDocUnPublished
OnLoadWebDocument
OnParseDocument
OnWebPageInit
OnWebPagePrerender
Cache Service Events
OnBeforeCacheUpdate
OnBeforeSaveWebPageCache
OnCacheUpdate
OnLoadWebPageCache
Web Access Service Events
OnBeforeWebLogin
OnBeforeWebLogout
OnWebAuthentication
OnWebChangePassword
OnWebCreateGroup
OnWebDeleteUser
OnWebLogin
OnWebLogout
OnWebSaveUser
Manager Access Events
OnBeforeManagerLogin
OnBeforeManagerLogout
OnManagerAuthentication
OnManagerChangePassword
OnManagerCreateGroup
OnManagerDeleteUser
OnManagerLogin
OnManagerLogout
OnManagerPageInit
OnManagerSaveUser
Parser Service Events
OnFileManagerUpload
OnPageNotFound
OnPageUnauthorized
OnSiteRefresh
Chunks
OnBeforeChunkFormDelete
OnBeforeChunkFormSave
OnChunkFormDelete
OnChunkFormPrerender
OnChunkFormRender
OnChunkFormSave
Documents
OnBeforeDocFormDelete
OnBeforeDocFormSave
OnCreateDocGroup
OnDocFormDelete
OnDocFormPrerender
OnDocFormRender
OnDocFormSave
Modules
OnBeforeModFormDelete
OnBeforeModFormSave
OnModFormDelete
OnModFormPrerender
OnModFormRender
OnModFormSave
Plugins
OnBeforePluginFormDelete
OnBeforePluginFormSave
OnPluginFormDelete
OnPluginFormPrerender
OnPluginFormRender
OnPluginFormSave
RichText Editor
OnRichTextEditorInit
OnRichTextEditorRegister
Snippets
OnBeforeSnipFormDelete
OnBeforeSnipFormSave
OnSnipFormDelete
OnSnipFormPrerender
OnSnipFormRender
OnSnipFormSave
System Settings
OnFriendlyURLSettingsRender
OnInterfaceSettingsRender
OnMiscSettingsRender
OnSiteSettingsRender
OnUserSettingsRender
Template Variables
OnBeforeTVFormDelete
OnBeforeTVFormSave
OnTVFormDelete
OnTVFormPrerender
OnTVFormRender
OnTVFormSave
Templates
OnBeforeTempFormDelete
OnBeforeTempFormSave
OnTempFormDelete
OnTempFormPrerender
OnTempFormRender
OnTempFormSave
Users
OnBeforeUserFormDelete
OnBeforeUserFormSave
OnUserFormDelete
OnUserFormPrerender
OnUserFormRender
OnUserFormSave
Web Users
OnBeforeWUsrFormDelete
OnBeforeWUsrFormSave
OnWUsrFormDelete
OnWUsrFormPrerender
OnWUsrFormRender
OnWUsrFormSave