$json = new PommoJSON(false); // do not toggle escaping // EXAMINE CALL switch ($_REQUEST['call']) { case 'notice': foreach ($mailingIDS as $id) { $logger->AddMsg('<br /><br />###' . sprintf(Pommo::_T('Displaying notices for mailing %s'), PommoMailing::getSubject($id)) . ' ###<br /><br />'); $notices = PommoMailing::getNotices($id); $logger->AddMsg($notices); } break; case 'reload': Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/groups.php'); $mailing = current(PommoMailing::get(array('id' => $_REQUEST['mailings']))); // change group name to ID $groups = PommoGroup::getNames(); $gid = 'all'; foreach ($groups as $group) { if ($group['name'] == $mailing['group']) { $gid = $group['id']; } } PommoAPI::stateReset(array('mailing')); // if this is a plain text mailing, switch body + altbody. if ($mailing['ishtml'] == 'off') { $mailing['altbody'] = $mailing['body']; $mailing['body'] = null; } // Initialize page state with default values overriden by those held in $_REQUEST $state =& PommoAPI::stateInit('mailing', array('fromname' => $mailing['fromname'], 'fromemail' => $mailing['fromemail'], 'frombounce' => $mailing['frombounce'], 'list_charset' => $mailing['charset'], 'mailgroup' => $gid, 'subject' => $mailing['subject'], 'body' => $mailing['body'], 'altbody' => $mailing['altbody'])); Pommo::redirect($pommo->_baseUrl . 'admin/mailings/mailings_start.php');
if ($rule['logic'] == $logic && $rule['field_id'] == $_REQUEST['fieldID']) { $values[] = $field['type'] == 'date' ? PommoHelper::timeFromStr($rule['value']) : $rule['value']; } } } $firstVal = empty($values) ? false : array_shift($values); $logic = $logic ? PommoRules::getEnglish(array($logic)) : PommoRules::getEnglish(end(PommoRules::getLegal($group, array($field)))); $smarty->assign('type', $type); $smarty->assign('field', $field); $smarty->assign('logic', $logic); $smarty->assign('values', $values); $smarty->assign('firstVal', $firstVal); $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':