Fabrik User Manual 0



Yüklə 1,97 Mb.
Pdf görüntüsü
səhifə7/24
tarix17.09.2018
ölçüsü1,97 Mb.
#69275
1   2   3   4   5   6   7   8   9   10   ...   24

• Condition - PHP code which should return true or false. If it returns false then
the email is not sent. This option can be useful when you only want to send out
the email if the user has selected a particular option in your form. Place holders
can be used, so a simple example of a condition might be:
◦ return '{tablename___elementname}' = 1;
Note for all these options: to access data submitted by the form you can enter the
placeholder "{tablename___elementname}" which will be replaced with the data
submitted in that form element.
Receipt Submission Plug-in
The receipt plug-in sends an email to the user filling in the form, notifying him that the
form submission has been received.
Note for all these options: to access data submitted by the form you can enter the
placeholder "{tablename___elementname}" which will be replaced with the data
submitted in that form element.
• Send confirmation receipt to - The full name of the element that has
collected the user's email address. By full name we mean it should be in the
format tablename___elementname
22


• Receipt title - the title of the email receipt
• Message to send ... - the text to send to the recipient.
Redirect Submission Plug-in
The redirect plug-in allows you to decide where the browser should be redirected to at
the end of the form submission. If no redirect plug-in is entered then the form will
automatically redirect itself to the previous page.
• Jump page - The URL to redirect to once the form has successfully been
submitted
• Append jump url with data - If yes selected the the form's data is appended
to the jump page url
• Thanks message when form submitted - Text to display. Use placeholders to
display data collected by the form. If your jump page option is left empty then
this text is shown on its own page. If your jump page points to a URL on your
site then the thanks message appears as a system message. If your jump page
points to a URL outside of your site then the thanks message is ignored.
• Use as search data - If 'yes' selected then the form's data is used for filtering
the form's tables data.
• Condition - PHP code which should return true or false. If it returns false then
the redirect is not applied. Place holders can be used, so a simple example of a
condition might be:
◦ return '{tablename___elementname}' = 1;
23


Run PHP
Sometimes you are going to need to run some specific code that is not provided for by
one of the other form submission plug-ins. At this point the highly flexible Run PHP plug-
in is a godsend.
• Process scripts - State where in the form submission process you would like
the script to be executed.
• PHP File - Select the PHP file you would like to run. These files are located in
/components/com_fabrik/plugins/forms/fabrik/php/scripts. The Joomla
framework is available to these scripts, so for example you can access the
Joomla database with :
◦ $db =& JFactory::getDBO();
• PHP code to execute on from submission - If no script is selected then the
code entered here will be run instead.
24


Run JS
Similar to the Run PHP plug-in, the Run JS plug-in allows you to attach an instance of a
javascript class to your form.
The JavaScript files need to be stored in components/com_fabrik/plugins/form/fabrikjs/
scripts.
Each file should contain a class with the same name as its filename, so if for example our
file name was dostuff.js then its class should be created as below:
var dostuff = new Class({
initialize: function(form)
{
this.form = form; //the form js object
}
});
The JavaScript object that controls the form initiates the form plug-in, passing itself into
the required initialize method.
When the form performs various actions, its JavaScript object calls a corresponding
method in all of the form JS plug-ins attached to it.
There is an example.js file in the plug-in which contains a list of each of these possible
methods. For reference it has been included below:
//class name needs to be the same as the file name
var example = new Class({
initialize: function(form)
{
this.form = form; //the form js object
},
//run when submit button is pressed
onSubmit: function()
{
alert('onSubmit');
//return false if you want the form to stop submission
},
//run once the form has sucessfully submitted data via ajax
25


onAjaxSubmitComplete: function(){
alert('complete');
},
onDoElementFX: function(){
alert('onDoElementFX');
},
//run at the start of saving a group to the db
// when you move from one group to another on
//multipage forms
saveGroupsToDb: function(){
alert('saveGroupsToDb');
},
//run once the ajax call has completed when moving from one group to
another
//on multipage forms
onCompleteSaveGroupsToDb: function(){
alert('onCompleteSaveGroupsToDb');
},
//run each time you move from one group to another on
//multipage forms
onChangePage: function(){
alert('onChangePage');
},
//run if the form has ajax validaton
//run at start of element validaton that occurs on that elements onblur
event
onStartElementValidation: function(){
alert('onStartElementValidation');
},
//run when above element validation's ajax call is completed
onCompleteElementValidation: function(){
alert('onCompleteElementValidation');
},
//called when a repeatable group is deleted
onDeleteGroup: function(){
alert('onDeleteGroup');
},
//called when a repeat group is duplicated
onDuplicateGroup: function(){
alert('onDuplicateGroup');
},
//called when the form gets updated
onUpdate: function(){
alert('onUpdate');
},
//called when the form is reset
onReset: function(){
}
});
26


Yüklə 1,97 Mb.

Dostları ilə paylaş:
1   2   3   4   5   6   7   8   9   10   ...   24




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə