Conditional Subforms

From ARK
Revision as of 12:50, 18 April 2009 by Andydufton (talk | contribs)

Jump to: navigation, search

We are currently implementing conditional subforms, to be implemented with the next release of ARK. This will mean all previous modtype specific subforms will now be handled using the op_condition settings. It will also allow more specific conditions to be placed on subforms to control if/when they are to be displayed (by attribute, by user permissions, etc).

This will involve the addition of a new op_condition to any subforms that will be using the new conditional options for subforms.

        'op_condition' => array(
			'func'=> 'chkFragPresence',
			'args'=> 'attr, classtype, id/nname'
		), //This array restricts the view depending on the presence of an attribute
			'func'=> 'chkModTypeCond',
			'args'=> '1'
		), //This array restricts the view depending on the modtype number (taken from mod_lut_modtype)
			'func'=> 'chkUserPerm',
			'args'=> array(
		), //This array restricts the view to an array of users based on user id (in this case 84, as taken from cor_tbl_users)
			'func'=> 'chkGroupPerm',
			'args'=> array(
		), //This array restricts the view to an array of groups based on group id (in this case 1, taken from cor_lvu_groups)

Changes to be made to all existing mod_settings:

-detfrm for Data Entry- replace 'col_type => single_col' with 'col_type => primary_col' -change all modtype specific subforms to use new conditional subform options

In addition, the validations_fuctions.php and global_functions.php will need to be updated (although we would suggest upgrading all your php when moving to a new instance of ARK anyway rather than attempting a piecemeal patching of this new functionality).