Difference between revisions of "Conditional Subforms"

From ARK
Jump to: navigation, search
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
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).
+
As of v0.7 the option to configure conditional subforms has been implemented.  This means that all previous modtype specific subforms will now be handled using the op_condition settings.  It also allows for 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.
+
This involves the addition of a new op_condition to any subforms that will be using the new conditional options for subforms.
  
 
<pre>
 
<pre>
Line 7: Line 7:
 
array(
 
array(
 
'func'=> 'chkFragPresence',
 
'func'=> 'chkFragPresence',
'args'=> 'attr, classtype, id/nname'
+
'args'=> 'attr, classtype, id/nname'//the id/nname is option in args
 
), //This array restricts the view depending on the presence of an attribute
 
), //This array restricts the view depending on the presence of an attribute
 
array(
 
array(
 
'func'=> 'chkModTypeCond',
 
'func'=> 'chkModTypeCond',
 
'args'=> '1'
 
'args'=> '1'
), //This array restricts the view depending on the modtype number
+
), //This array restricts the view depending on the modtype number (taken from mod_lut_modtype)
 
array(
 
array(
 
'func'=> 'chkUserPerm',
 
'func'=> 'chkUserPerm',
Line 18: Line 18:
 
84
 
84
 
)
 
)
), //This array restricts the view to an array of users based on user id
+
), //This array restricts the view to an array of users based on user id (in this case 84, as taken from cor_tbl_users)
 
array(
 
array(
 
'func'=> 'chkGroupPerm',
 
'func'=> 'chkGroupPerm',
Line 24: Line 24:
 
1
 
1
 
)
 
)
), //This array restricts the view to an array of groups based on group id
+
), //This array restricts the view to an array of groups based on group id (in this case 1, taken from cor_lvu_groups)
 
),
 
),
 
</pre>
 
</pre>
Line 35: Line 35:
  
 
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).
 
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).
 +
 +
[[Category:Administrator]]

Latest revision as of 10:22, 24 February 2011

As of v0.7 the option to configure conditional subforms has been implemented. This means that all previous modtype specific subforms will now be handled using the op_condition settings. It also allows for more specific conditions to be placed on subforms to control if/when they are to be displayed (by attribute, by user permissions, etc).

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

        'op_condition' => array(
		array(
			'func'=> 'chkFragPresence',
			'args'=> 'attr, classtype, id/nname'//the id/nname is option in args
		), //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 (taken from mod_lut_modtype)
		array(
			'func'=> 'chkUserPerm',
			'args'=> array(
				84
			)
		), //This array restricts the view to an array of users based on user id (in this case 84, as taken from cor_tbl_users)
		array(
			'func'=> 'chkGroupPerm',
			'args'=> array(
				1
			)
		), //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).