Page 1 of 1

Building a Plugin for ChronoForms

Posted: 09 Jun 2009, 06:59
by GreyHead
Hi Jan,

I've been looking at building a plugin to make PhocaPDF available for ChronoForms form output. I've started tracking through the code and it's not completely obvious what needs to be done.

I can see that the Content Plugin re-writes the pdf link from an article page and adds &format=phocapdf to the url.

I can see that there are a couple of new events in the plugin and that you have a listener inside the switch in files.phocapdf/phocapdf.php - I assume that I'll need to add a new case here.

What I am not clear about is if I send html output from chronoforms with format=phocapdf is that enough or is there some other pre-processing of the output that needs to be done?

Bob

Re: Building a Plugin for ChronoForms

Posted: 11 Jun 2009, 00:58
by Jan
What I am not clear about is if I send html output from chronoforms with format=phocapdf is that enough or is there some other pre-processing of the output that needs to be done?

Hi, this depends on you which content will be sent.

Usually components have specific file for displaying the content in PDF, so e.g. content component has these files in article view:

view.html.php (prepared data for html output)
view.pdf.php (prepared data for pdf output), so for chronoform component you need to create such file where you define html output for pdf document. This html output will be then displayed in PDF.

Re: Building a Plugin for ChronoForms

Posted: 20 Jun 2009, 16:58
by GreyHead
Hi Jan,

Sorry, I forgot to subscribe and missed your reply until I came back again.

For better or worse, ChronoForms doesn't have views that can readily be adapted. Most often the form data is stored into a database table and/or emailed off to the admin. However there are some users who want 'printable' or pdf copies of the results usually to record some more formal 'form'.

I've been successful in saving from a ChronoForms form to a Joomla article and creating a pdf with phocapdf from the article link but that still seems a long route round.

I'm off on holiday for a couple of weeks and will take another look when I'm back.

Best wishes

Bob

Re: Building a Plugin for ChronoForms

Posted: 23 Jun 2009, 22:47
by Jan
Ok