aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-04 20:27:41 -0800
committerfriendica <info@friendica.com>2013-01-04 20:27:41 -0800
commit37957204215854f2d80ca8b975f275ebda305f7e (patch)
tree26c119582f0ce0229fcb15742745bcc0c4bd4dee /boot.php
parent78a65c7c1b98991574469e8baee9457296827dff (diff)
downloadvolse-hubzilla-37957204215854f2d80ca8b975f275ebda305f7e.tar.gz
volse-hubzilla-37957204215854f2d80ca8b975f275ebda305f7e.tar.bz2
volse-hubzilla-37957204215854f2d80ca8b975f275ebda305f7e.zip
move all the final page construction to a construct_page() function
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php83
1 files changed, 83 insertions, 0 deletions
diff --git a/boot.php b/boot.php
index fc93879e7..6e90af0bc 100644
--- a/boot.php
+++ b/boot.php
@@ -1940,3 +1940,86 @@ function curPageURL() {
}
return $pageURL;
}
+
+function construct_page(&$a) {
+
+
+ /**
+ * Build the page - now that we have all the components
+ */
+
+
+ if($a->module != 'install') {
+ nav($a);
+ }
+
+ require_once(theme_include('theme_init.php'));
+
+ if(($p = theme_include(current_theme() . '.js')) != '')
+ head_add_js($p);
+
+ if(($p = theme_include('mod_' . $a->module . '.php')) != '')
+ require_once($p);
+
+ require_once('include/js_strings.php');
+
+ head_add_css(((x($a->page,'template')) ? $a->page['template'] : 'default' ) . '.css');
+ head_add_css('mod_' . $a->module . '.css');
+ head_add_css('style.css');
+
+ head_add_js('mod_' . $a->module . '.js');
+
+
+ $interval = ((local_user()) ? get_pconfig(local_user(),'system','update_interval') : 40000);
+ if($interval < 10000)
+ $interval = 40000;
+
+ $a->page['title'] = $a->config['system']['sitename'];
+
+
+ $a->page['htmlhead'] = replace_macros($a->page['htmlhead'], array(
+ '$baseurl' => $a->get_baseurl(),
+ '$local_user' => local_user(),
+ '$generator' => FRIENDICA_PLATFORM . ' ' . FRIENDICA_VERSION,
+ '$update_interval' => $interval,
+ '$head_css' => head_get_css(),
+ '$head_js' => head_get_js(),
+ '$js_strings' => js_strings()
+ ));
+
+ $arr = $a->get_widgets();
+ if(count($arr)) {
+ foreach($arr as $x) {
+ if(! array_key_exists($x['location'],$a->page))
+ $a->page[$x['location']] = '';
+ $a->page[$x['location']] .= $x['html'];
+ }
+ }
+
+ if($a->is_mobile || $a->is_tablet) {
+ if(isset($_SESSION['show-mobile']) && !$_SESSION['show-mobile']) {
+ $link = $a->get_baseurl() . '/toggle_mobile?f=&address=' . curPageURL();
+ }
+ else {
+ $link = $a->get_baseurl() . '/toggle_mobile?f=&off=1&address=' . curPageURL();
+ }
+ $a->page['footer'] .= replace_macros(get_markup_template("toggle_mobile_footer.tpl"), array(
+ '$toggle_link' => $link,
+ '$toggle_text' => t('toggle mobile')
+ ));
+ }
+
+ $page = $a->page;
+ $profile = $a->profile;
+
+ header("Content-type: text/html; charset=utf-8");
+
+ require_once(theme_include(
+ ((x($a->page,'template'))
+ ? $a->page['template']
+ : 'default' )
+ . '.php' )
+ );
+
+ return;
+} \ No newline at end of file