Conditional Subforms

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

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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

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


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).