Forums | Mahara Community
Adding a button to the files section in MyGroups
08 November 2010, 6:10 AM
I am trying to add a new button to the files section of MyGroups. I have successfully added a button. When I press the button I am not sure how the pieform is form is processed. I can see that when I press the update button with the name "files_filebrowser_update" the function pieform_element_filebrowser_update is called in artefact/file/form/elements/filebrowser.php. My new button has a name files_filebrowser_change and I have included a function pieform_element_filebrowser_change in filebrowser.php but the new function is never called.
Does anyone know how to do this? Is there any documentation?
08 November 2010, 9:23 AM
The connection you might be missing is in pieform_element_filebrowser_doupdate(...) in artefact/file/form/elements/filebrowser.php. Take a look at the way that the pieform_element_filebrowser_delete(...) is called there and that might help.
There is some documentation on Pieforms here http://pieforms.sourceforge.net/doc/html/user/usage.html, but unfortunately I can't find anything on the filebrowser code specifically as it is one of the elements that has been developed within the Mahara project and not Pieforms itself.
However, because it is still a Pieform object, a lot of the functions within filebrowser.php are called in some way or another from the Pieform class in lib/pieforms/pieform.php and there is a bit more documentation to the functions there that might help with understanding how the filebrowser works a little easier. A bit of poking around with most filebrowser functions should take you somewhere back in that vicinity eventually. :)