]> git.mxchange.org Git - friendica.git/blobdiff - include/text.php
Merge pull request #5004 from annando/missing-posts
[friendica.git] / include / text.php
index 2ec017caffa9bb613348d153f8cae2c47cc92a01..4c9a8864d595d6dca9d10c9f221d5a9e4627542b 100644 (file)
@@ -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 = '<ul class="content-filter-reasons">';
-               foreach ($reasons as $reason) {
-                       $content_filter_html .= '<li>' . htmlspecialchars($reason) . '</li>' . PHP_EOL;
-               }
-               $content_filter_html .= '</ul>
-                       <p><span id="content-filter-wrap-' . $rnd . '" class="fakelink content-filter-button" onclick=openClose(\'content-filter-' . $rnd . '\'); >' .
-                       L10n::t('Click to open/close') .
-                       '</span></p>
-                       <div id="content-filter-' . $rnd . '" class="content-filter-content" style="display: none;">';
-
-               $html = $content_filter_html . $html . '</div>';
+               $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;