OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Can I Access POSTED Form Variables?

OCS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, michael

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page. While these are OJS-specific, the OCS codebase is similar enough to OJS they should be of help. There is also an [url=http://pkp.sfu.ca/ocs_documentation[/url]OCS Documentation[/url] page with some more general documentation that might also be of interest.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a technical support question, try the OCS Technical Support subforum.

Can I Access POSTED Form Variables?

Postby BVBAccelerate » Wed Mar 16, 2011 9:24 am

Hello,

I'm trying to develop a payment plugin. I was wondering if I there was any way I could access the POST variables that are passed through the payment form.

I know that this uses the MVC architecture and that the arguments are passed in the URL, but I was wondering if there were any default capabilities for me to access form variables that I don't want put into the URL.

Thanks in advance!


EDIT:: Also, I've set up my plugin with the appropriate files to create the tables and records for email templates, but I can't figure out how to install my plugin so it does this properly. I can upload the files directly and have the plugin work but the tables and data are not inserted into the database using the schema.xml, data.xml, and emailTemplates.xml files.

On our site I browse to Home > User > Conference Site Management > Plugin Management > Install A New Plugin and it just says it needs to be a compressed .tar.gz file. I did this in Linux and uploaded the file through this interface, and it said Version.xml not found in the plugin directory. I know it is in there, do I need to have any special structure in the .tar.gz file to get it to work?

All of the documentation I've read on this only tells me general guidelines for how to write a plugin, but does not provide information I need to bring it to completion so it can be shared.
BVBAccelerate
 
Posts: 33
Joined: Mon Apr 19, 2010 2:01 pm

Re: Can I Access POSTED Form Variables?

Postby mcrider » Tue Mar 22, 2011 10:52 am

Hi BVBAccelerate,

Accessing form data is usually done through a form class--See for example SettingsForm.inc.php in plugins/generic/webFeed/. The form class is called from your handler (e.g. your main payment plugin class) and form values are read in after the readInputData() method of the form is called--You can then operate on that data in the execute() method of the form class. There are loads more examples of using form classes throughout the code.

As for installing plugins that have tables to install, take a look at this postthat describes the two ways you can install plugins.

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: Can I Access POSTED Form Variables?

Postby BVBAccelerate » Thu Sep 22, 2011 9:42 am

Hey, I know it's been a while but I finally looked into what you were talking about (it was at plugins/generic/announcementFeed for anyone else reading this post) and how they extended the form class for the specific needs of that plugin. I was able to get what I wanted without having to extend the class, I just imported the form class using 'import('form.Form');' and I was able to read all of the form data using the readUserVars() function. I just passed into that function an array with values being the names of the fields on the form that was posted.

Thanks for pointing me in the right direction!
BVBAccelerate
 
Posts: 33
Joined: Mon Apr 19, 2010 2:01 pm


Return to OCS Development

Who is online

Users browsing this forum: Exabot [Bot] and 2 guests