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