X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ftext.php;h=4c9a8864d595d6dca9d10c9f221d5a9e4627542b;hb=6dda5366ded349288b65eb7bc7c88b909a04626d;hp=2ec017caffa9bb613348d153f8cae2c47cc92a01;hpb=ab82c6df0341346658a7f28adc53ca2506d23c5a;p=friendica.git diff --git a/include/text.php b/include/text.php index 2ec017caff..4c9a8864d5 100644 --- a/include/text.php +++ b/include/text.php @@ -513,7 +513,7 @@ function load_view_file($s) { return $content; } - $theme = current_theme(); + $theme = $a->getCurrentTheme(); if (file_exists("$d/theme/$theme/$b")) { $stamp1 = microtime(true); @@ -637,7 +637,7 @@ function logger($msg, $level = 0) { // turn off logger in install mode if ( - $a->module == 'install' + $a->mode == App::MODE_INSTALL || !dba::$connected ) { return; @@ -709,7 +709,7 @@ function dlogger($msg, $level = 0) { // turn off logger in install mode if ( - $a->module == 'install' + $a->mode == App::MODE_INSTALL || !dba::$connected ) { return; @@ -1249,7 +1249,7 @@ function prepare_body(array &$item, $attach = false, $is_preview = false) // Compile eventual content filter reasons $filter_reasons = []; - if (!$is_preview && !($item['self'] && local_user() == $item['uid'])) { + if (!$is_preview && public_contact() != $item['author-id']) { if (!empty($item['content-warning']) && (!local_user() || !PConfig::get(local_user(), 'system', 'disable_cw', false))) { $filter_reasons[] = L10n::t('Content warning: %s', $item['content-warning']); } @@ -1411,18 +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); - $content_filter_html = ' -

' . - L10n::t('Click to open/close') . - '

- '; + $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;