Example #1
0
         $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');
     $json->add('callbackParams', $pommo->_baseUrl . 'admin/subscribers/groups_edit.php');
     $json->serve();
     break;
 case 'updateRule':