diff --git a/include/text.php b/include/text.php index 6c0916749..5e189d58f 100644 --- a/include/text.php +++ b/include/text.php @@ -1411,27 +1411,13 @@ function prepare_body(array &$item, $attach = false, $is_preview = false) function apply_content_filter($html, array $reasons) { if (count($reasons)) { - $rnd = random_string(8); - - if (count($reasons) > 1) { - $content_filter_html = ' -

'; - } elseif (count($reasons) == 1) { - $reason = array_pop($reasons); - $content_filter_html .= '

' . htmlspecialchars($reason) . '

'; - } - - $content_filter_html .= ''; + $tpl = get_markup_template('wall/content_filter.tpl'); + $html = replace_macros($tpl, [ + '$reasons' => $reasons, + '$rnd' => random_string(8), + '$openclose' => L10n::t('Click to open/close'), + '$html' => $html + ]); } return $html; diff --git a/view/templates/wall/content_filter.tpl b/view/templates/wall/content_filter.tpl new file mode 100644 index 000000000..2dafdca09 --- /dev/null +++ b/view/templates/wall/content_filter.tpl @@ -0,0 +1,22 @@ +{{if count($reasons) > 1}} + +

+ +

+{{else}} +

+ {{$reasons.0|escape:html}} + +

+{{/if}} + \ No newline at end of file