I'm using the excellent Solidres Booking System (www.solidres.com) and investigating the possibility to integrate Phoca PDF in its content-type (in particular Tourist Experiences, which can be booked on the platform).
But you PDF SYSTEM PLUGIN is strictly linked to joomla articles: is there a possibility to create a blank plugin, or override a view which can manage the pdf content, without modify the component core files?
I think a generic system to integrate PDF Component in external components would be very useful
Thanks
mf
Generate pdf for other component/content-type (not only articles)
-
- Phoca Newbie
- Posts: 5
- Joined: 13 Aug 2012, 18:22
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Generate pdf for other component/content-type (not only articles)
Hi, the plugin needs to be directly written for each extension. In Phoca PDF there are following plugins:
- content plugin - for articles
- VirtueMart plugin for invoices, delivery note and receipt - not more supported and maintained
- restaurant menu plugin for Phoca Restaurant Menu component
- cart plugin for displaying Invoices, Delivery Notes, Receipts in Phoca Cart
Jan
- content plugin - for articles
- VirtueMart plugin for invoices, delivery note and receipt - not more supported and maintained
- restaurant menu plugin for Phoca Restaurant Menu component
- cart plugin for displaying Invoices, Delivery Notes, Receipts in Phoca Cart
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 7
- Joined: 27 Oct 2011, 11:25
Re: Generate pdf for other component/content-type (not only articles)
Hi Jan!!
Thank you very much for PhocaPDF!! It's a really nice framework to allow pdf export in Joomla!!
I'm currently developing a PhocaPDF plugin for JEvents and I have noticed there is something missing in your code which will help with this task.
Right now plugin methods are called from file "administrator/components/com_phocapdf/helpers/phocapdfrender.php". The first event you trigger is onBeforeCreatePDF[COMPONENT] and it's great. But after this, the second trigger: onBeforeDisplayPDF[COMPONENT] is only triggered for your plugins and you do not have a trigger for other third party components.
From my tests I have added this code in the switch:
and it works fine.
Is this something you might consider? I'm aware this is not needed but it will be nice to have it for a better architecture and modularity ;)
Also I will be more than happy to write down all the steps I followed to create this plugin and add it to your PhocaPDF documentation if you just let me know how to send them to you ;)
Thank you very much for the component in any case ;)
Best!!
Carlos
Thank you very much for PhocaPDF!! It's a really nice framework to allow pdf export in Joomla!!
I'm currently developing a PhocaPDF plugin for JEvents and I have noticed there is something missing in your code which will help with this task.
Right now plugin methods are called from file "administrator/components/com_phocapdf/helpers/phocapdfrender.php". The first event you trigger is onBeforeCreatePDF[COMPONENT] and it's great. But after this, the second trigger: onBeforeDisplayPDF[COMPONENT] is only triggered for your plugins and you do not have a trigger for other third party components.
From my tests I have added this code in the switch:
Code: Select all
default:
if (JPluginhelper::isEnabled('phocapdf',strtolower($t))){
$results = $dispatcher->trigger('onBeforeDisplayPDF' . $t, array (&$pdf, &$content, &$document, $staticData));
}
Is this something you might consider? I'm aware this is not needed but it will be nice to have it for a better architecture and modularity ;)
Also I will be more than happy to write down all the steps I followed to create this plugin and add it to your PhocaPDF documentation if you just let me know how to send them to you ;)
Thank you very much for the component in any case ;)
Best!!
Carlos
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Generate pdf for other component/content-type (not only articles)
Hi, thank you very much for your info, yes, I can implement it in next version and yes, will be great to get more info about the plugin you have created.
Thank you, Jan
Thank you, Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 7
- Joined: 27 Oct 2011, 11:25
Re: Generate pdf for other component/content-type (not only articles)
Great!!
I have found what I think it is a bug in the current release.
On file /administrator/components/com_phocapdf/views/phocapdfplugin/tmpl/default.php at line 69 you check for the template file to exists:
But you load the template in the phocapdfplugin view ;). So I think it should be:
Best!!
I have found what I think it is a bug in the current release.
On file /administrator/components/com_phocapdf/views/phocapdfplugin/tmpl/default.php at line 69 you check for the template file to exists:
Code: Select all
if (JFile::exists(JPATH_COMPONENT_ADMINISTRATOR.'/views/phocapdfplugins/tmpl/default_'.$this->item->element.'.php')) {
Code: Select all
if (JFile::exists(JPATH_COMPONENT_ADMINISTRATOR.'/views/phocapdfplugin/tmpl/default_'.$this->item->element.'.php')) {
-
- Phoca Newbie
- Posts: 7
- Joined: 27 Oct 2011, 11:25
Re: Generate pdf for other component/content-type (not only articles)
Also I have developed a method to check if image link exists before adding it to the pdf. Would you like to use it in your helpers?
-
- Phoca Newbie
- Posts: 7
- Joined: 27 Oct 2011, 11:25
Re: Generate pdf for other component/content-type (not only articles)
Please forget this request. I just noticed you actually trigger the event on the first switch so my proposal is useless and will make pdf content to be duplicated :(carcam wrote: ↑18 Apr 2018, 17:37 Hi Jan!!
Thank you very much for PhocaPDF!! It's a really nice framework to allow pdf export in Joomla!!
I'm currently developing a PhocaPDF plugin for JEvents and I have noticed there is something missing in your code which will help with this task.
Right now plugin methods are called from file "administrator/components/com_phocapdf/helpers/phocapdfrender.php". The first event you trigger is onBeforeCreatePDF[COMPONENT] and it's great. But after this, the second trigger: onBeforeDisplayPDF[COMPONENT] is only triggered for your plugins and you do not have a trigger for other third party components.
From my tests I have added this code in the switch:
and it works fine.Code: Select all
default: if (JPluginhelper::isEnabled('phocapdf',strtolower($t))){ $results = $dispatcher->trigger('onBeforeDisplayPDF' . $t, array (&$pdf, &$content, &$document, $staticData)); }
Is this something you might consider? I'm aware this is not needed but it will be nice to have it for a better architecture and modularity ;)
Also I will be more than happy to write down all the steps I followed to create this plugin and add it to your PhocaPDF documentation if you just let me know how to send them to you ;)
Thank you very much for the component in any case ;)
Best!!
Carlos
-
- Phoca Newbie
- Posts: 7
- Joined: 27 Oct 2011, 11:25
Re: Generate pdf for other component/content-type (not only articles)
Actually, is there a way I can submit a pull request so that you can see my code changes and approve or not them? I think that will be easier for you and I will feel usefull contributing to your extension ;)
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Generate pdf for other component/content-type (not only articles)
Hi, which components, plugins are affected by your changes, I will prepare updated code on Github so you can mark the changes there.
Jan
Jan
If you find Phoca extensions useful, please support the project