$my_rule->actions[] = $data;
if(!count($my_rule->actions) && !count($my_rule->matches)) {
- $philter->set_error("You cannot add an empty rule");
+ $philter->set_error(_i18n('filter_err_empty'));
return false;
}
}
function to_js() {
- $res = "filter[0] = { all: 1, block:1, name:'[ new rule ]', matches: [], actions: [] };\n";
+ $res = "filter[0] = { all: 1, block:1, name:'"._i18n('new_rule')."', matches: [], actions: [] };\n";
foreach($this->rules as $id=>$rule)
$res .= "filter[$id] = ".$rule->to_js().";\n";