3 namespace Friendica\Module;
5 use Friendica\BaseModule;
6 use Friendica\Core\Hook;
7 use Friendica\Core\L10n;
8 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 = [])
18 $app = self::getApp();
19 $config = $app->getConfig();
21 // currently no returned data is used
24 Hook::callAll('home_init', $ret);
26 if (local_user() && ($app->user['nickname'])) {
27 $app->internalRedirect('network');
30 if (strlen($config->get('system', 'singleuser'))) {
31 $app->internalRedirect('/profile/' . $config->get('system', 'singleuser'));
35 $defaultHeader = ($config->get('config', 'sitename') ? 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 $app->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $app->getBaseURL() . '/home.css' . '" media="all" />';
48 $login = Login::form($app->query_string, $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,