We need to firm up the code in MA. There are a lot of verbose statements and arrays in the module.metaboxes.rule.php file
Can we simplify stuff like:
$rule_fields['rules_if']['label'] = 'IF condition';
$rule_fields['rules_if']['name'] = 'rule_if';
$rule_fields['rules_if']['id'] = 'rule_if';
$rule_fields['rules_if']['position'] = 'conditions';
$rule_fields['rules_if']['priority'] = 10;
$rule_fields['rules_if']['nature'] = "dropdown";
$rule_fields['rules_if']['class'] = "rules_dropdown";
$rule_fields['rules_if']['show'] = true;
$rule_fields['rules_if']['tooltip'] = "This condition allows us to set the primary criteria for lead sorting or points awarding.";
$rules_if_options = array(
'page_views_general'=>'Visitor views any page',
'page_views_category_specific'=>'Visitor views category specific page',
'page_conversions_general'=>'Visitor converts on any page',
'page_conversions_category_specific'=>'Visitor converts on category specific page',
//'sessions_recorded'=>'Total site browsing sessions equals',
'rules_executed'=>'Total number of successful rule matches is at least'
);
to
$automation['rules_if'] =
array('label' => 'IF condition',
'name' => 'rule_if',
'id' => 'rules_if',
'position' => 'conditions',
'priority' => 10,
'type' => 'dropdown',
'class' => 'rules_dropdown',
'show' => true,
'tooltip' => "This condition allows us to set the primary criteria for lead sorting or points awarding.";
'options' = array(
'page_views_general'=>'Visitor views any page',
'page_views_category_specific'=>'Visitor views category specific page',
'page_conversions_general'=>'Visitor converts on any page',
'page_conversions_category_specific'=>'Visitor converts on category specific page',
//'sessions_recorded'=>'Total site browsing sessions equals',
'rules_executed'=>'Total number of successful rule matches is at least'
),
);
and remove duplicate/unnessary array keys? looks like we are using ids and classes and a name etc. Couldn't they just be 'id' and we can make the other fields with them?
We can, feel free it should still work. I can't remember why I built it that way. I like the breadrcumb visuals but can understand how it comes off redundant. Have at it any way you want.
Hey Hudson,
We need to firm up the code in MA. There are a lot of verbose statements and arrays in the module.metaboxes.rule.php file
Can we simplify stuff like:
to
and remove duplicate/unnessary array keys? looks like we are using ids and classes and a name etc. Couldn't they just be 'id' and we can make the other fields with them?
Want to double check before I rework the code