Okay, I’ve been working on turning the frontend editing hack into a legitimate module. Here is what I have so far. As far as I can tell everything is working fine. Editing a TV through the frontend will not lock the document, I should probably fix that down the road but I will probably just wait for an improved locking system.
The installation is a bit involved. Once we get an installer system worked out it should be very simple though. Here are the installation instructions...
1. Copy the QuickEditModule folder into the /assets/modules/ folder.
2. Run the SQL code below to create a new
3. Overwrite your document.parser.class.inc.php file as mentioned below
4. Copy the contents QuickEdit.module.php to a new module called QuickEdit
5. Check
Enable parameter sharing on the
Configuration tab
6. Copy the
Parameters string from the module comments to the Parameters field
7. Copy the contents QuickEdit.plugin.php to a new plugin called QuickEdit
8. Check OnParseDocument and OnWebPagePrerender on the
System Events tab
9. Edit the QuickEdit module again and add a dependency to the QuickEdit plugin
10. Edit the QuickEdit plugin again and choose QuickEdit from the
Import module shared parameters list on the
Configuration tab
There is still a hack required to the document.parser.class.inc.php file. The hack adds a OnParseDocument event that will be included in the next release. If you have Pre 3.1 installed you can just copy the document.parser.class.inc.php file below over your existing file. Otherwise look for my HACK comments.
I’ve also included a manager login snippet I wrote a while ago which compliments the frontend editing nicely.
Give it a try and let me know how it works. This is the first module I’ve actually written so if I’m way off on anything, please let me know. If you have any problems or questions feel free to PM or
email me.
SQL to add the OnParseDocument event (you may have to change the table prefix from the default modx_):
INSERT INTO `modx_system_eventnames` ( `id` , `name` , `service` , `groupname` )
VALUES ('', 'OnParseDocument', '5', '');
UPDATE:
I updated the ManagerLogin snippet. I had it using PHP_SELF instead of REQUEST_URI in the form action. Doh!