]> git.mxchange.org Git - friendica.git/blob - mod/home.php
Merge remote-tracking branch 'upstream/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
20 if(! function_exists('home_content')) {
21 function home_content(App &$a) {
22
23         $o = '';
24
25         if (x($_SESSION,'theme')) {
26                 unset($_SESSION['theme']);
27         }
28         if (x($_SESSION,'mobile-theme')) {
29                 unset($_SESSION['mobile-theme']);
30         }
31
32         /// @TODO No absolute path used, maybe risky (security)
33         if (file_exists('home.html')) {
34                 if (file_exists('home.css')) {
35                         $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="'.App::get_baseurl().'/home.css'.'" media="all" />';
36                 }
37
38                 $o .= file_get_contents('home.html');}
39
40         else {
41                 $o .= '<h1>'.((x($a->config,'sitename')) ? sprintf(t("Welcome to %s"), $a->config['sitename']) : "").'</h1>';
42         }
43
44
45         $o .= login(($a->config['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
46
47         call_hooks("home_content",$o);
48
49         return $o;
50
51
52 }}