]> git.mxchange.org Git - friendica.git/blob - mod/home.php
Merge remote-tracking branch 'refs/remotes/friendica/develop' into develop
[friendica.git] / mod / home.php
1 <?php
2
3 if(! function_exists('home_init')) {
4 function home_init(App $a) {
5
6         $ret = array();
7         call_hooks('home_init',$ret);
8
9         if (local_user() && ($a->user['nickname'])) {
10                 goaway(App::get_baseurl()."/network");
11         }
12
13         if (strlen(get_config('system','singleuser'))) {
14                 goaway(App::get_baseurl()."/profile/" . get_config('system','singleuser'));
15         }
16
17 }}
18
19 if(! function_exists('home_content')) {
20 function home_content(App $a) {
21
22         $o = '';
23
24         if (x($_SESSION,'theme')) {
25                 unset($_SESSION['theme']);
26         }
27         if (x($_SESSION,'mobile-theme')) {
28                 unset($_SESSION['mobile-theme']);
29         }
30
31         /// @TODO No absolute path used, maybe risky (security)
32         if (file_exists('home.html')) {
33                 if (file_exists('home.css')) {
34                         $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="'.App::get_baseurl().'/home.css'.'" media="all" />';
35                 }
36
37                 $o .= file_get_contents('home.html');
38         } else {
39                 $o .= '<h1>'.((x($a->config,'sitename')) ? sprintf(t("Welcome to %s"), $a->config['sitename']) : "").'</h1>';
40         }
41
42
43         $o .= login(($a->config['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
44
45         call_hooks("home_content",$o);
46
47         return $o;
48
49 }}