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()
17 if (!empty($_SESSION['theme'])) {
18 unset($_SESSION['theme']);
21 if (!empty($_SESSION['mobile-theme'])) {
22 unset($_SESSION['mobile-theme']);
25 $app = self::getApp();
26 $config = $app->getConfig();
28 // currently no returned data is used
31 Hook::callAll('home_init', $ret);
33 if (local_user() && ($app->user['nickname'])) {
34 $app->internalRedirect('network');
37 if (strlen($config->get('system', 'singleuser'))) {
38 $app->internalRedirect('/profile/' . $config->get('system', 'singleuser'));
42 $defaultHeader = ($config->get('config', 'sitename') ? L10n::t('Welcome to %s', $config->get('config', 'sitename')) : '');
44 $homeFilePath = $app->getBasePath() . '/home.html';
45 $cssFilePath = $app->getBasePath() . '/home.css';
47 if (file_exists($homeFilePath)) {
48 $customHome = $homeFilePath;
50 if (file_exists($cssFilePath)) {
51 $app->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $app->getBaseURL() . '/home.css' . '" media="all" />';
55 $login = Login::form($app->query_string, $config->get('config', 'register_policy') === Register::CLOSED ? 0 : 1);
58 Hook::callAll('home_content', $content);
60 $tpl = Renderer::getMarkupTemplate('home.tpl');
61 return Renderer::replaceMacros($tpl, [
62 '$defaultheader' => $defaultHeader,
63 '$customhome' => $customHome,
65 '$content' => $content,