4 use Friendica\Core\Addon;
5 use Friendica\Core\Config;
6 use Friendica\Core\System;
7 use Friendica\Module\Login;
9 if(! function_exists('home_init')) {
10 function home_init(App $a) {
13 Addon::callHooks('home_init',$ret);
15 if (local_user() && ($a->user['nickname'])) {
16 goaway(System::baseUrl()."/network");
19 if (strlen(Config::get('system','singleuser'))) {
20 goaway(System::baseUrl()."/profile/" . Config::get('system','singleuser'));
25 if(! function_exists('home_content')) {
26 function home_content(App $a) {
28 if (x($_SESSION,'theme')) {
29 unset($_SESSION['theme']);
31 if (x($_SESSION,'mobile-theme')) {
32 unset($_SESSION['mobile-theme']);
36 $defaultheader = '<h1>'.((x($a->config,'sitename')) ? sprintf(t("Welcome to %s"), $a->config['sitename']) : "").'</h1>';
38 $homefilepath = $a->basepath . "/home.html";
39 $cssfilepath = $a->basepath . "/home.css";
40 if (file_exists($homefilepath)) {
41 $customhome = $homefilepath;
42 if (file_exists($cssfilepath)) {
43 $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="'.System::baseUrl().'/home.css'.'" media="all" />';
47 $login = Login::form($a->query_string, $a->config['register_policy'] == REGISTER_CLOSED ? 0 : 1);
50 Addon::callHooks("home_content",$content);
53 $tpl = get_markup_template('home.tpl');
54 return replace_macros($tpl, [
55 '$defaultheader' => $defaultheader,
56 '$customhome' => $customhome,
58 '$content' => $content