aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--boot.php16
-rw-r--r--index.php36
-rw-r--r--mod/zregister.php11
-rw-r--r--view/head.tpl7
4 files changed, 48 insertions, 22 deletions
diff --git a/boot.php b/boot.php
index a9da0eee5..7f5291ecc 100644
--- a/boot.php
+++ b/boot.php
@@ -585,22 +585,8 @@ if(! class_exists('App')) {
}
function init_pagehead() {
- $interval = ((local_user()) ? get_pconfig(local_user(),'system','update_interval') : 40000);
- if($interval < 10000)
- $interval = 40000;
-
$this->page['title'] = $this->config['sitename'];
- $tpl = file_get_contents('view/head.tpl');
- $this->page['htmlhead'] = replace_macros($tpl,array(
- '$baseurl' => $this->get_baseurl(), // FIXME for z_path!!!!
- '$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
- ));
+ $this->page['htmlhead'] = file_get_contents('view/head.tpl');
}
function set_curl_code($code) {
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;
diff --git a/mod/zregister.php b/mod/zregister.php
index e55c9f5ba..2b8b0ebff 100644
--- a/mod/zregister.php
+++ b/mod/zregister.php
@@ -1,7 +1,12 @@
<?php
-if(! function_exists('register_post')) {
-function register_post(&$a) {
+
+function zregister_init(&$a) {
+ $a->page['layout'] = 'full';
+}
+
+
+function zregister_post(&$a) {
global $lang;
@@ -155,7 +160,7 @@ function register_post(&$a) {
}
return;
-}}
+}
diff --git a/view/head.tpl b/view/head.tpl
index d7fb1e5b7..7e753c022 100644
--- a/view/head.tpl
+++ b/view/head.tpl
@@ -1,11 +1,16 @@
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<base href="$baseurl/" />
<meta name="generator" content="$generator" />
+
<link rel="stylesheet" href="$baseurl/library/fancybox/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />
<link rel="stylesheet" href="$baseurl/library/tiptip/tipTip.css" type="text/css" media="screen" />
<link rel="stylesheet" href="$baseurl/library/jgrowl/jquery.jgrowl.css" type="text/css" media="screen" />
+<link rel="stylesheet" type="text/css" href="$baseurl/library/jslider/bin/jquery.slider.min.css" media="screen" />
-<link rel="stylesheet" type="text/css" href="$baseurl/library/jslider/bin/jquery.slider.min.css" />
+<link rel="stylesheet" type="text/css" href="$page_css" media="all" />
+{{ if $mod_css }}
+<link rel="stylesheet" type="text/css" href="$mod_css" media="all" />
+{{ endif }}
<link rel="stylesheet" type="text/css" href="$stylesheet" media="all" />
<link rel="shortcut icon" href="$baseurl/images/friendica-32.png" />