From 2e18b36a287ad9b25619f9e2a073dcedf6d620ee Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 18 May 2016 18:04:56 +0200 Subject: MORE WMORK --- inc/render.inc.php | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'inc/render.inc.php') diff --git a/inc/render.inc.php b/inc/render.inc.php index 5fc5be92..b422d7f9 100644 --- a/inc/render.inc.php +++ b/inc/render.inc.php @@ -46,9 +46,8 @@ class Render public static function output() { Header('Content-Type: text/html; charset=utf-8'); - $zip = isset($_SERVER['HTTP_ACCEPT_ENCODING']) && (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false); - if ($zip) - ob_start(); + $modules = Module::getActivated(); + ob_start('ob_gzhandler'); echo ' @@ -59,9 +58,16 @@ class Render - + '; + // Include any module specific styles + foreach ($modules as $module) { + $file = $module->getDir() . '/style.css'; + if (file_exists($file)) { + echo ''; + } + } + echo ' - @@ -80,20 +86,21 @@ class Render - ', + + '; + foreach ($modules as $module) { + $file = $module->getDir() . '/clientscript.js'; + if (file_exists($file)) { + echo ''; + } + } + echo self::$footer , ' ' ; - if ($zip) { - Header('Content-Encoding: gzip'); - ob_implicit_flush(false); - $gzip_contents = ob_get_contents(); - ob_end_clean(); - echo "\x1f\x8b\x08\x00\x00\x00\x00\x00"; - echo substr(gzcompress($gzip_contents, 5), 0, -4); - } + ob_end_flush(); } /** @@ -127,7 +134,7 @@ class Render */ public static function addScriptTop($file) { - self::addHeader(''); + trigger_error('Ignoring addScriptTop for ' . $file . ': Deprecated, use module-specific clientscript.js', E_USER_WARNING); } /** @@ -137,7 +144,7 @@ class Render */ public static function addScriptBottom($file) { - self::addFooter(''); + trigger_error('Ignoring addScriptBottom for ' . $file . ': Deprecated, use module-specific clientscript.js', E_USER_WARNING); } /** -- cgit v1.2.3-55-g7522