I am working on a website that needed some extra tables for document and they also use MaxiGallery.
When a document is deleted the extra table rows are not deleted cause its not standard modx. also the files and table rows from MaxiGallery are not removed.
I am trying to make a plugin that delete my cusom rows/tables and files. But I do not get this to work, I get the OnDocFormDelete to give me a alert so that part works (invoking the event) but now I need to know what file I am deleting and what template it is using. the plugin only needs to work on one template(id9).
When this works then I need the page id with this id I can select the right table rows en gallerie folders to delete.
I tryed this:
$e = &$modx->Event;
// Only on this event
if ($e->name == 'OnDocFormDelete')
{
echo "<script> alert('".$modx->documentObject['template']."')</script>";
}
and it give me the alert but its empty, when i use this on the OnWebPagePrerender I get the correct template id in my alert but $modx->documentObject[’template’] somehow does not exist when I want to delete a document.
could someone guide me in the right direction?
Thanks
Dimmy