3 namespace Friendica\Module;
5 use Friendica\BaseModule;
6 use Friendica\Core\Hook;
7 use Friendica\Core\L10n;
8 use Friendica\Core\Renderer;
10 use Friendica\Module\Security\Login;
13 * Home module - Landing page of the current node
15 class Home extends BaseModule
17 public static function content(array $parameters = [])
20 $config = DI::config();
22 // currently no returned data is used
25 Hook::callAll('home_init', $ret);
27 if (local_user() && ($app->user['nickname'])) {
28 DI::baseUrl()->redirect('network');
31 if (strlen($config->get('system', 'singleuser'))) {
32 DI::baseUrl()->redirect('/profile/' . $config->get('system', 'singleuser'));
36 $defaultHeader = ($config->get('config', 'sitename') ? L10n::t('Welcome to %s', $config->get('config', 'sitename')) : '');
38 $homeFilePath = $app->getBasePath() . '/home.html';
39 $cssFilePath = $app->getBasePath() . '/home.css';
41 if (file_exists($homeFilePath)) {
42 $customHome = $homeFilePath;
44 if (file_exists($cssFilePath)) {
45 $app->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/home.css' . '" media="all" />';
49 $login = Login::form($app->query_string, $config->get('config', 'register_policy') === Register::CLOSED ? 0 : 1);
52 Hook::callAll('home_content', $content);
54 $tpl = Renderer::getMarkupTemplate('home.tpl');
55 return Renderer::replaceMacros($tpl, [
56 '$defaultheader' => $defaultHeader,
57 '$customhome' => $customHome,
59 '$content' => $content,