$smarty->display('ajax/rule.field.tpl');
Pommo::kill();
} elseif ($_REQUEST['ruleType'] == 'group') {
$match = Pommo_Groups::getNames($_REQUEST['fieldID']);
$key = key($match);
$smarty->assign('match_name', $match[$key]);
$smarty->assign('match_id', $key);
$smarty->display('ajax/rule.group.tpl');
Pommo::kill();
}
break;
case 'addRule':
switch ($_REQUEST['logic']) {
case 'is_in':
case 'not_in':
Pommo_Rules::addGroupRule($state['group'], $_REQUEST['field'], $_REQUEST['logic']);
break;
case 'true':
case 'false':
Pommo_Rules::addBoolRule($state['group'], $_REQUEST['field'], $_REQUEST['logic']);
break;
case 'is':
case 'not':
case 'less':
case 'greater':
$values = array_unique($_REQUEST['match']);
$type = $_REQUEST['type'] == 'or' ? 'or' : 'and';
Pommo_Rules::addFieldRule($state['group'], $_REQUEST['field'], $_REQUEST['logic'], $values, $type);
break;
}
$json->add('callbackFunction', 'redirect');