3 namespace Friendica\Module;
5 use Friendica\BaseModule;
6 use Friendica\Core\Hook;
7 use Friendica\Core\L10n;
8 use Friendica\Core\Renderer;
11 * Home module - Landing page of the current node
13 class Home extends BaseModule
15 public static function content(array $parameters = [])
17 $app = self::getApp();
18 $config = $app->getConfig();
20 // currently no returned data is used
23 Hook::callAll('home_init', $ret);
25 if (local_user() && ($app->user['nickname'])) {
26 $app->internalRedirect('network');
29 if (strlen($config->get('system', 'singleuser'))) {
30 $app->internalRedirect('/profile/' . $config->get('system', 'singleuser'));
34 $defaultHeader = ($config->get('config', 'sitename') ? L10n::t('Welcome to %s', $config->get('config', 'sitename')) : '');
36 $homeFilePath = $app->getBasePath() . '/home.html';
37 $cssFilePath = $app->getBasePath() . '/home.css';
39 if (file_exists($homeFilePath)) {
40 $customHome = $homeFilePath;
42 if (file_exists($cssFilePath)) {
43 $app->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $app->getBaseURL() . '/home.css' . '" media="all" />';
47 $login = Login::form($app->query_string, $config->get('config', 'register_policy') === Register::CLOSED ? 0 : 1);
50 Hook::callAll('home_content', $content);
52 $tpl = Renderer::getMarkupTemplate('home.tpl');
53 return Renderer::replaceMacros($tpl, [
54 '$defaultheader' => $defaultHeader,
55 '$customhome' => $customHome,
57 '$content' => $content,