Merge pull request #596 from MrPetovan/task/add-advancedcontentfilter-addon
[advancedcontentfilter] Fix various error messages
This commit is contained in:
commit
d998331039
2 changed files with 17 additions and 14 deletions
|
@ -118,21 +118,23 @@ function advancedcontentfilter_prepare_body_content_filter(App $a, &$hook_data)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($rules as $rule) {
|
if ($rules) {
|
||||||
try {
|
foreach($rules as $rule) {
|
||||||
$serializedParsedExpression = new ExpressionLanguage\SerializedParsedExpression(
|
try {
|
||||||
$rule['expression'],
|
$serializedParsedExpression = new ExpressionLanguage\SerializedParsedExpression(
|
||||||
$rule['serialized']
|
$rule['expression'],
|
||||||
);
|
$rule['serialized']
|
||||||
|
);
|
||||||
|
|
||||||
$found = (bool) $expressionLanguage->evaluate($serializedParsedExpression, $vars);
|
$found = (bool) $expressionLanguage->evaluate($serializedParsedExpression, $vars);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$found = false;
|
$found = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($found) {
|
if ($found) {
|
||||||
$hook_data['filter_reasons'][] = L10n::t('Filtered by rule: %s', $rule['name']);
|
$hook_data['filter_reasons'][] = L10n::t('Filtered by rule: %s', $rule['name']);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -199,6 +201,7 @@ function advancedcontentfilter_content(App $a)
|
||||||
} else {
|
} else {
|
||||||
$t = get_markup_template('settings.tpl', 'addon/advancedcontentfilter/');
|
$t = get_markup_template('settings.tpl', 'addon/advancedcontentfilter/');
|
||||||
return replace_macros($t, [
|
return replace_macros($t, [
|
||||||
|
'$current_theme' => $a->getCurrentTheme(),
|
||||||
'$backtosettings' => L10n::t('Back to Addon Settings'),
|
'$backtosettings' => L10n::t('Back to Addon Settings'),
|
||||||
'$title' => L10n::t('Advanced Content Filter'),
|
'$title' => L10n::t('Advanced Content Filter'),
|
||||||
'$add_a_rule' => L10n::t('Add a Rule'),
|
'$add_a_rule' => L10n::t('Add a Rule'),
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
{{if current_theme() == 'frio'}}
|
{{if $current_theme == 'frio'}}
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="{{$close}}" @click="showModal = false"><span aria-hidden="true">×</span></button>
|
<button type="button" class="close" data-dismiss="modal" aria-label="{{$close}}" @click="showModal = false"><span aria-hidden="true">×</span></button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<h3 v-if="rule.id">{{$edit_the_rule}} "{{ rule.name }}"</h3>
|
<h3 v-if="rule.id">{{$edit_the_rule}} "{{ rule.name }}"</h3>
|
||||||
|
|
Loading…
Reference in a new issue