3 namespace Friendica\Module;
5 use Friendica\BaseModule;
6 use Friendica\Core\Hook;
7 use Friendica\Core\Renderer;
9 use Friendica\Module\Security\Login;
12 * Home module - Landing page of the current node
14 class Home extends BaseModule
16 public static function content(array $parameters = [])
19 $config = DI::config();
21 // currently no returned data is used
24 Hook::callAll('home_init', $ret);
26 if (local_user() && ($app->user['nickname'])) {
27 DI::baseUrl()->redirect('network');
30 if (strlen($config->get('system', 'singleuser'))) {
31 DI::baseUrl()->redirect('/profile/' . $config->get('system', 'singleuser'));
35 $defaultHeader = ($config->get('config', 'sitename') ? DI::l10n()->t('Welcome to %s', $config->get('config', 'sitename')) : '');
37 $homeFilePath = $app->getBasePath() . '/home.html';
38 $cssFilePath = $app->getBasePath() . '/home.css';
40 if (file_exists($homeFilePath)) {
41 $customHome = $homeFilePath;
43 if (file_exists($cssFilePath)) {
44 DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/home.css' . '" media="all" />';
48 $login = Login::form(DI::args()->getQueryString(), $config->get('config', 'register_policy') === Register::CLOSED ? 0 : 1);
51 Hook::callAll('home_content', $content);
53 $tpl = Renderer::getMarkupTemplate('home.tpl');
54 return Renderer::replaceMacros($tpl, [
55 '$defaultheader' => $defaultHeader,
56 '$customhome' => $customHome,
58 '$content' => $content,