Example #1
0
         $smarty->display('admin/subscribers/ajax/rule.field.tpl');
         Pommo::kill();
     } elseif ($_REQUEST['ruleType'] == 'group') {
         $match = PommoGroup::getNames($_REQUEST['fieldID']);
         $key = key($match);
         $smarty->assign('match_name', $match[$key]);
         $smarty->assign('match_id', $key);
         $smarty->display('admin/subscribers/ajax/rule.group.tpl');
         Pommo::kill();
     }
     break;
 case 'addRule':
     switch ($_REQUEST['logic']) {
         case 'is_in':
         case 'not_in':
             PommoRules::addGroupRule($state['group'], $_REQUEST['field'], $_REQUEST['logic']);
             break;
         case 'true':
         case 'false':
             PommoRules::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';
             PommoRules::addFieldRule($state['group'], $_REQUEST['field'], $_REQUEST['logic'], $values, $type);
             break;
     }
     $json->add('callbackFunction', 'redirect');