4 use Friendica\Core\Config;
5 use Friendica\Core\System;
6 use Friendica\Module\Login;
8 if(! function_exists('home_init')) {
9 function home_init(App $a) {
12 call_hooks('home_init',$ret);
14 if (local_user() && ($a->user['nickname'])) {
15 goaway(System::baseUrl()."/network");
18 if (strlen(Config::get('system','singleuser'))) {
19 goaway(System::baseUrl()."/profile/" . Config::get('system','singleuser'));
24 if(! function_exists('home_content')) {
25 function home_content(App $a) {
27 if (x($_SESSION,'theme')) {
28 unset($_SESSION['theme']);
30 if (x($_SESSION,'mobile-theme')) {
31 unset($_SESSION['mobile-theme']);
35 $defaultheader = '<h1>'.((x($a->config,'sitename')) ? sprintf(t("Welcome to %s"), $a->config['sitename']) : "").'</h1>';
37 $homefilepath = $a->basepath . "/home.html";
38 $cssfilepath = $a->basepath . "/home.css";
39 if (file_exists($homefilepath)) {
40 $customhome = $homefilepath;
41 if (file_exists($cssfilepath)) {
42 $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="'.System::baseUrl().'/home.css'.'" media="all" />';
46 $login = Login::form($a->query_string, $a->config['register_policy'] == REGISTER_CLOSED ? 0 : 1);
49 call_hooks("home_content",$content);
52 $tpl = get_markup_template('home.tpl');
53 return replace_macros($tpl, [
54 '$defaultheader' => $defaultheader,
55 '$customhome' => $customhome,
57 '$content' => $content