aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Home.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-04-18 20:38:38 -0700
committerredmatrix <git@macgirvin.com>2016-04-18 20:38:38 -0700
commit2a4e8972e0edfa3156d9ce54d68ce0e54c0ec289 (patch)
tree2376d950ba2bdc7753336a3e2b94865c95c238f2 /Zotlabs/Module/Home.php
parent2a61817bad96526994c0499f1fc0a843a9cc9405 (diff)
downloadvolse-hubzilla-2a4e8972e0edfa3156d9ce54d68ce0e54c0ec289.tar.gz
volse-hubzilla-2a4e8972e0edfa3156d9ce54d68ce0e54c0ec289.tar.bz2
volse-hubzilla-2a4e8972e0edfa3156d9ce54d68ce0e54c0ec289.zip
module updates
Diffstat (limited to 'Zotlabs/Module/Home.php')
-rw-r--r--Zotlabs/Module/Home.php89
1 files changed, 89 insertions, 0 deletions
diff --git a/Zotlabs/Module/Home.php b/Zotlabs/Module/Home.php
new file mode 100644
index 000000000..f3ba96fdd
--- /dev/null
+++ b/Zotlabs/Module/Home.php
@@ -0,0 +1,89 @@
+<?php
+namespace Zotlabs\Module;
+
+require_once('include/items.php');
+require_once('include/conversation.php');
+
+
+
+class Home extends \Zotlabs\Web\Controller {
+
+ function init() {
+
+ $ret = array();
+
+ call_hooks('home_init',$ret);
+
+ $splash = ((argc() > 1 && argv(1) === 'splash') ? true : false);
+
+ $channel = \App::get_channel();
+ if(local_channel() && $channel && $channel['xchan_url'] && ! $splash) {
+ $dest = $channel['channel_startpage'];
+ if(! $dest)
+ $dest = get_pconfig(local_channel(),'system','startpage');
+ if(! $dest)
+ $dest = get_config('system','startpage');
+ if(! $dest)
+ $dest = z_root() . '/network';
+
+ goaway($dest);
+ }
+
+ if(get_account_id() && ! $splash) {
+ goaway(z_root() . '/new_channel');
+ }
+
+ }
+
+
+ function get($update = 0, $load = false) {
+
+ $o = '';
+
+
+ if(x($_SESSION,'theme'))
+ unset($_SESSION['theme']);
+ if(x($_SESSION,'mobile_theme'))
+ unset($_SESSION['mobile_theme']);
+
+ $splash = ((argc() > 1 && argv(1) === 'splash') ? true : false);
+
+ call_hooks('home_content',$o);
+ if($o)
+ return $o;
+
+ $frontpage = get_config('system','frontpage');
+ if($frontpage) {
+ if(strpos($frontpage,'include:') !== false) {
+ $file = trim(str_replace('include:' , '', $frontpage));
+ if(file_exists($file)) {
+ \App::$page['template'] = 'full';
+ \App::$page['title'] = t('$Projectname');
+ $o .= file_get_contents($file);
+ return $o;
+ }
+ }
+ if(strpos($frontpage,'http') !== 0)
+ $frontpage = z_root() . '/' . $frontpage;
+ if(intval(get_config('system','mirror_frontpage'))) {
+ $o = '<html><head><title>' . t('$Projectname') . '</title></head><body style="margin: 0; padding: 0; border: none;" ><iframe src="' . $frontpage . '" width="100%" height="100%" style="margin: 0; padding: 0; border: none;" ></iframe></body></html>';
+ echo $o;
+ killme();
+ }
+ goaway($frontpage);
+ }
+
+
+ $sitename = get_config('system','sitename');
+ if($sitename)
+ $o .= '<h1 class="home-welcome">' . sprintf( t("Welcome to %s") ,$sitename) . '</h1>';
+
+ $loginbox = get_config('system','login_on_homepage');
+ if(intval($loginbox) || $loginbox === false)
+ $o .= login((\App::$config['system']['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
+
+ return $o;
+
+ }
+
+}