1
0
mirror of https://github.com/flarum/core.git synced 2025-08-25 01:16:20 +02:00

Add Custom Footer HTML (#1315)

* Add Custom Footer HTML

Straight copy from Custom Header HTML

* Move Custom Footer HTML to exactly before `</body>` tag.

* Fix invalid class name

* Append CustomFooterHTML when preparing the view.

* Some consistency in placing the variable
This commit is contained in:
AFR
2018-01-06 05:44:11 +07:00
committed by Franz Liedke
parent 9342723f64
commit 6dc96b38af
4 changed files with 48 additions and 1 deletions

View File

@@ -77,6 +77,7 @@ class ForumSerializer extends AbstractSerializer
'logoUrl' => $this->getLogoUrl(),
'faviconUrl' => $this->getFaviconUrl(),
'headerHtml' => $this->settings->get('custom_header'),
'footerHtml' => $this->settings->get('custom_footer'),
'allowSignUp' => (bool) $this->settings->get('allow_sign_up'),
'defaultRoute' => $this->settings->get('default_route'),
'canViewDiscussions' => $this->actor->can('viewDiscussions'),

View File

@@ -304,7 +304,7 @@ class FrontendView
$view->jsUrls = $this->buildJsUrls($baseUrl);
$view->head = $this->buildHeadContent();
$view->foot = implode("\n", $this->foot);
$view->foot = $this->buildFootContent(array_get($forum, 'data.attributes.footerHtml'));
return $view->render();
}
@@ -380,6 +380,15 @@ class FrontendView
return $html;
}
protected function buildFootContent($customFooterHtml)
{
$html = implode("\n", $this->foot);
$html .= $customFooterHtml;
return $html;
}
/**
* @return CompilerInterface
*/