[pmwiki-users] Attempting a generic Discussion feature

Laura Langland-Shula lauraesmith at yahoo.com
Tue Sep 26 21:11:16 CDT 2006


I've noticed a couple of people having trouble implementing Discussion tabs in the monobook skin, in part because the tabs don't recognize when the Discussion tab is active. I have been attempting my own generic recipe by cloning the 'browse' and 'edit' actions--
* copying the 'browse' action and HandleBrowse function to a 'discuss' action that reads from a 'discussion:' field in the flatfile rather than the 'text:' field
* copying the 'edit' action and HandleEdit function(s) to a 'talk' action that edits the 'discussion:' field in the flatfile

By just working with actions, functions, and the flatfile, any skin should know when the new actions are active, and any skin should be able to see the new actions when Site.PageActions is edited. This is working swimmingly. The monobook skin automatically knows when to hilight the active tabs (this also beneficially prevents recursive Discussing: adding discussion to a discussion page). However, I am having trouble with the internals of HandleEdit, getting it to actually edit the discussion: field. I have copied over the code that seems relevant [$EditFunctions = array(blah...), $EditFields = array('text'), the ReplaceOnSave() and PostPage() and PreviewPage() functions, etc.] and changed all the likely-looking 'edit's to 'talk's and 'text's to 'discussion's. But on testing, using the talk tab doesn't do anything to the flatfile at all. If I manually edit a flatfile to add a discussion: field, HandleDiscuss displays it correctly. I haven't cloned or tweaked the functions
 that handle history tracking or attribute setting. I've done basic PHP before but nothing this involved. My testbed wiki is at http://www.ucolick.org/~laura/pmwiki/ and the code is "mirrored" at http://www.ucolick.org/~laura/pmwiki/discactions.txt.

Thanks for any pointers!
-Laura





More information about the pmwiki-users mailing list