10 years ago
Topic
I am working on plugin field called PDF Factory.
What i need is to have all fieldsvalues of any form having my field easily available.
All logic i do in onCCK_FieldPrepareForm and would not like to move to another function. I would like to avoid getting data from $_POST
At the moment after some searching i have almost nothing for this but $config variable passed to the function
This:
$config['storages']['#__content']->introtext
gives me only from introtext some fields
::cck::119::/cck::::pdf_file_html_1::testestest::/pdf_file_html_1::::pdf_file_js_1::alert.......
All fields are needed for me to take html from one and create pdf from this html using tcpdf library
If i cannot have all fields of a current form how to convert ::cck:: string into something more json-like.

I rather know no one will help.

Update:
i tried CCK_Rendering class but it is unavailable.

Update:
With my current knowledge, to get most from my plugin i will have to use $_POST variables too and onCCK_FieldPrepareStore where $_POST is accessible (from my memory) and write custom html and javascript to additional files at the same time creating pdf file. So both onCCK_FieldPrepareStore and onCCK_FieldPrepareForm will need to do the same (create pdf files and in a way accessible to get additional HTML and Javascript teksts) but through different paths.

Still getting all fields in a easy way would be useful for me.


Get a VIP membership
10 years ago
0
Level 1
I discovered accidentally that some field data can be found in the $_SESSION variable but i have to examine it further later and don't know yet whether it would be really useful for my needs. The best option is to save things on $_POST request though because it has all form data.
Update: $_SESSION is not updated as i have thought at the first glance so the data don't match to the current form. But $_SESSION can be used by plugin for storing some relevant data here if necessary.
10 years ago
0
Level 1
Another helpful information is this. In the main file of the plugin (that one where there some event functions defined) before the class is defined you can put some code f.e. to process _POST variables. Remember to place your code after the phrase defined( '_JEXEC' ) or die. Which won't allow processing any code for nonlogged users.

If find my recent discoveries helpful i'll be able to marked this topic resolved.

Ok the best i thinkk is to use onCCK_FieldPrepareStore function of the main file of the plugin which is processed as i understand duging POST requests. So there is access to $field file and $_POST variables at the same time so there is all is needed to do proper programming.

Get a Book for SEBLOD