diff --git a/include/plugin.php b/include/plugin.php index a6780d701..c9490eb8a 100644 --- a/include/plugin.php +++ b/include/plugin.php @@ -406,8 +406,7 @@ function upgrade_bool_message($bbcode = false) { function head_add_css($src,$media = 'screen') { - get_app()->css_sources[] = array($src,$type); - + get_app()->css_sources[] = array($src,$media); } function head_get_css() { @@ -430,7 +429,7 @@ function format_css_if_exists($source) { elseif(file_exists('view/css/' . $source[0])) $path = 'view/css/' . $source[0]; if($path) - return ''; + return '' . "\r\n"; } @@ -459,7 +458,7 @@ function format_js_if_exists($source) { elseif(file_exists('view/js/' . $source)) $path = 'view/js/' . $source[0]; if($path) - return '' . "\r\n" ; } diff --git a/index.php b/index.php index 02d853d06..4de315520 100644 --- a/index.php +++ b/index.php @@ -336,30 +336,18 @@ if($a->module != 'install') { * Build the page - now that we have all the components */ +if(file_exists('view/theme/' . current_theme() . '/php/theme_init.php')) + require_once('view/theme/' . current_theme() . '/php/theme_init.php'); +elseif(file_exists('view/theme/' . $a->theme_info['extends'] . '/php/theme_init.php')) + require_once('view/theme/' . $a->theme_info['extends'] . '/php/theme_init.php'); +else + require_once('view/php/theme_init.php'); -$page_css = 'view/theme/' . current_theme() . '/css/' - . ((x($a->page,'template')) ? $a->page['template'] : 'default' ) . '.css'; - -if(! file_exists($page_css)) - $page_css = str_replace('theme/' . current_theme() . '/', '', $page_css); - -$module_css = 'view/theme/' . current_theme() . '/css/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; - - -$module_js = 'view/theme/' . current_theme() . '/js/mod_' . $a->module . '.js'; - -if(! file_exists($module_js)) - $module_js = str_replace('theme/' . current_theme() . '/', '', $module_js); - -if(! file_exists($module_js)) - $module_js = null; +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); @@ -378,11 +366,9 @@ if(! file_exists($module_js)) '$showmore' => t('show more'), '$showfewer' => t('show fewer'), '$update_interval' => $interval, - '$page_css' => $a->get_baseurl() . '/' . $page_css, - '$module_css' => (($module_css) ? $a->get_baseurl() . '/' . $module_css : null), - '$module_js' => (($module_js) ? $a->get_baseurl() . '/' . $module_js : null), - '$stylesheet' => current_theme_url(), - '$theme' => current_theme(), + '$head_css' => head_get_css(), + '$head_js' => head_get_js(), + // localisations for jquery.timeago.js, see https://github.com/rmm5t/jquery-timeago // TRANSLATORS - only translate the conditionals if you require them! diff --git a/view/php/theme_init.php b/view/php/theme_init.php new file mode 100644 index 000000000..7a8f2d7a0 --- /dev/null +++ b/view/php/theme_init.php @@ -0,0 +1,26 @@ + + + {{ if $item.type == tag }} + {{ inc wall_item_tag.tpl }}{{ endinc }} + {{ else }} + {{ inc $item.template }}{{ endinc }} + {{ endif }} + + +{{ endfor }} + +
+ +{{ if $dropping }} + + $dropping + +{{ endif }} + + + +{{ if $mode == display }} + +{{ endif }} + diff --git a/view/theme/quattro/wall_item.tpl b/view/theme/quattro/tpl/wall_item.tpl similarity index 100% rename from view/theme/quattro/wall_item.tpl rename to view/theme/quattro/tpl/wall_item.tpl diff --git a/view/theme/quattro/wall_item_tag.tpl b/view/theme/quattro/tpl/wall_item_tag.tpl similarity index 100% rename from view/theme/quattro/wall_item_tag.tpl rename to view/theme/quattro/tpl/wall_item_tag.tpl diff --git a/view/theme/quattro/tpl/wall_thread.tpl b/view/theme/quattro/tpl/wall_thread.tpl new file mode 100644 index 000000000..4d454f00d --- /dev/null +++ b/view/theme/quattro/tpl/wall_thread.tpl @@ -0,0 +1,127 @@ +{{if $mode == display}} +{{ else }} +{{if $item.comment_firstcollapsed}} +
+ $item.num_comments $item.hide_text +
+ {{endif}} +{{ endif }} + +{{ if $item.flatten }} +
+ $item.comment +
+{{ endif }} diff --git a/view/theme/quattro/wallwall_item.tpl b/view/theme/quattro/tpl/wallwall_item.tpl similarity index 100% rename from view/theme/quattro/wallwall_item.tpl rename to view/theme/quattro/tpl/wallwall_item.tpl diff --git a/view/theme/quattro/tpl/wallwall_thread.tpl b/view/theme/quattro/tpl/wallwall_thread.tpl new file mode 100644 index 000000000..cc2f8e362 --- /dev/null +++ b/view/theme/quattro/tpl/wallwall_thread.tpl @@ -0,0 +1,134 @@ +{{if $mode == display}} +{{ else }} +{{if $item.comment_firstcollapsed}} +
+ $item.num_comments $item.hide_text +
+ {{endif}} +{{ endif }} + +{{ if $item.flatten }} +
+ $item.comment +
+{{ endif }} diff --git a/view/tpl/head.tpl b/view/tpl/head.tpl index 7853361d9..08fe8303a 100644 --- a/view/tpl/head.tpl +++ b/view/tpl/head.tpl @@ -2,16 +2,13 @@ - - - - + - -{{ if $module_css }} - -{{ endif }} - +$head_css + +$head_js - - - - - - - - - - - - - - -{{ if $module_js }} - -{{ endif }} - - - -