Another feature request:
It would be very helpful if the module invoked the relevant system events when saving each element. When altering a document or its TVs, invoke the onBeforeDocFormSave event and the onDocFormSave event (both of them, at the appropriate time in the script). When altering a chunk, invoke the OnBeforeChunkFormSave and the OnChunkFormSave events, and so on.
http://wiki.modxcms.com/index.php/System_Events
If these aren’t invoked, other snippets, plugins, or modules that depend on these events will be bypassed. This will essentially break the functionality of those other pieces of code. I’m working on a plugin that requires the faithful execution of these events to ensure data accuracy, so this is of particular concern to me.
For examples of how this is done in the MODx manager, refer to the scripts in manager/processors. For example, when updating a document, here’s how MODx invokes the two events:
// invoke OnBeforeDocFormSave event
$modx->invokeEvent("OnBeforeDocFormSave", array (
"mode" => "upd",
"id" => $id
));
(The mode is "upd" for "update," as opposed to "new.") And:
// invoke OnDocFormSave event
$modx->invokeEvent("OnDocFormSave", array (
"mode" => "upd",
"id" => $id
));
Thanks!