return $content;
}
- $theme = current_theme();
+ $theme = $a->getCurrentTheme();
if (file_exists("$d/theme/$theme/$b")) {
$stamp1 = microtime(true);
// turn off logger in install mode
if (
- $a->module == 'install'
+ $a->mode == App::MODE_INSTALL
|| !dba::$connected
) {
return;
// turn off logger in install mode
if (
- $a->module == 'install'
+ $a->mode == App::MODE_INSTALL
|| !dba::$connected
) {
return;
// 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']);
}
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;