Documentation

Edit rows configuration parameters

Parameter

Rel

Description

showadd

1.0.0

Should the module shows the 'new row' link? Values: true/false. Optional, default: false

showmodify

1.0.0

Should the module shows the ' modify row' link into each row? Values: true/false. Optional, default: false

showdelete

1.0.0

Should the module shows the delete row' link into each row? Values: true/false. Optional, default: false

modifyallow

1.0.0

It specifies the custom function to call to check if the module should show the 'modify row' link. The 'showmodify' key tell to Yap 'ok you check the modyallow function and if it allows you show the 'modify row' link. This function allows to enable/disable the modify function per row basis. The custom function must accept 1 parameter (the value of the row key) and it must return true (to show the link) or false. Optional, default:true.

deleteallow

1.0.0

As modifyallow applied to the delete function

addallow

1.0.0

As modifyallow applied to the add link

table

1.0.0

database table name to apply the editing function (this function don't use the information from selectquery parameter).

keyfield

1.1.0

Name of the unique key to use to identify the row

fieldtorequest

1.0.0

array holding the name of the field to ask into modify/add row. If empty, all field from the table are requested

fieldvalidator

1.0.0

Array, indexed by field name, containing the callbacks function to perform the validation for each field filled from the form. If one field does not have its callback function, the field is assumed correct. The function has two parameters: an array holding all the requested field (indexed by field name), and the name of the field to check; it must return true (if the value is correct) or false to reject the value.

customaddrow

1.1.0

Custom page to call when 'add new row' link is selected.

custommodifyrow

1.1.0

Custom page to call when the link 'modify row' is selected.

Yap pass the id of the requested row to the called page through the post parameter 'id'.

customdeleterow

1.1.0

Custom page to call to delete the selected row.

Yap pass the id of the requested row to the called page through the post parameter 'id'.

fields

1.1.0

New associative array that contains information about the field to request.

The array's indexes are the name of the fields required to be shown.

Each field item is another associative array. It has the following indexes:

default

1.1.0

Default value for the field

classname

1.1.0

Each type of input box is created as PHP class. Yap sets its own default class, but you may extend that class and here set your class name.

fieldvalidator

1.1.0

As the above 'fieldvalidator' this parameter set the callback function to perform the validation for each field filled from the form. If one field does not have its callback function, the field is assumed correct. The function has two parameters: an array holding all the requested field (indexed by field name), and the name of the field to check; it must return true (if the value is correct) or false to reject the value.

custom

1.1.0

Custom information used by the class specified in classname.

Note: this parameter give a new way to set information about field to request, so it override the old parameters 'fieldvalidator' and 'fieldtorequest'.