aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-07-21 18:03:22 -0700
committerfriendica <info@friendica.com>2012-07-21 18:03:22 -0700
commitc1fe66bec5fb2fe3ce3be2985036c0c8b006d7fd (patch)
tree33287e3bece27bd1316cb6e87e2d2cd8723875c1 /index.php
parentf8107be85bf5482c6fc46b9cd4f46ae899ad4771 (diff)
downloadvolse-hubzilla-c1fe66bec5fb2fe3ce3be2985036c0c8b006d7fd.tar.gz
volse-hubzilla-c1fe66bec5fb2fe3ce3be2985036c0c8b006d7fd.tar.bz2
volse-hubzilla-c1fe66bec5fb2fe3ce3be2985036c0c8b006d7fd.zip
breakup css into page layout css, and provide module specific layout css - which should dramatically reduce the size of theme files and reduce load times
Diffstat (limited to 'index.php')
-rw-r--r--index.php36
1 files changed, 33 insertions, 3 deletions
diff --git a/index.php b/index.php
index bcad5f607..858795201 100644
--- a/index.php
+++ b/index.php
@@ -356,9 +356,39 @@ if($a->module != 'install') {
* Build the page - now that we have all the components
*/
-$a->page['htmlhead'] = replace_macros($a->page['htmlhead'],
- array('$stylesheet' => current_theme_url(),
- '$theme' => current_theme()
+
+$page_css = 'view/theme/' . current_theme() . '/'
+ . ((x($a->page,'layout')) ? $a->page['layout'] : 'layout' ) . '.css';
+
+if(! file_exists($page_css))
+ $page_css = str_replace('theme/' . current_theme() . '/', '', $page_css);
+
+$module_css = 'view/theme/' . current_theme() . '/mod_' . $a->module . '.css';
+if(! file_exists($module_css))
+ $module_css = str_replace('theme/' . current_theme() . '/', '', $module_css);
+if(! file_exists($module_css))
+ $module_css = null;
+
+ $interval = ((local_user()) ? get_pconfig(local_user(),'system','update_interval') : 40000);
+ if($interval < 10000)
+ $interval = 40000;
+
+ $a->page['title'] = $a->config['sitename'];
+
+
+ $a->page['htmlhead'] = replace_macros($a->page['htmlhead'], array(
+ '$baseurl' => $a->get_baseurl(),
+ '$local_user' => local_user(),
+ '$generator' => FRIENDICA_PLATFORM . ' ' . FRIENDICA_VERSION,
+ '$delitem' => t('Delete this item?'),
+ '$comment' => t('Comment'),
+ '$showmore' => t('show more'),
+ '$showfewer' => t('show fewer'),
+ '$update_interval' => $interval,
+ '$page_css' => $a->get_baseurl() . '/' . $page_css,
+ '$module_css' => $a->get_baseurl() . '/' . $module_css,
+ '$stylesheet' => current_theme_url(),
+ '$theme' => current_theme()
));
$page = $a->page;