From 903100ecb99ab926d4ac3be4eba11ea1c9800e12 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Sat, 25 Jul 2015 21:55:05 +0200 Subject: Namespaces added --- include/classes/BigPipe/BigPipe.php | 81 +++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100755 include/classes/BigPipe/BigPipe.php (limited to 'include/classes/BigPipe/BigPipe.php') diff --git a/include/classes/BigPipe/BigPipe.php b/include/classes/BigPipe/BigPipe.php new file mode 100755 index 0000000..b69f1d8 --- /dev/null +++ b/include/classes/BigPipe/BigPipe.php @@ -0,0 +1,81 @@ + $Pagelet->getID(), + 'RESOURCES' => ['CSS' => $Pagelet->getCSSFiles(), 'JS' => $Pagelet->getJSFiles(), 'JS_CODE' => removeLineBreaksAndTabs($Pagelet->getJSCode())] + ]; + + if($last) { + $data['IS_LAST'] = true; + } + + echo ''."\n"; + echo ''."\n\n"; + } + + #==================================================================================================== + # Sendet den Output-Buffer so weit wie möglich in Richtung User + #==================================================================================================== + public static function flushOutputBuffer() { + ob_flush(); flush(); + } + + #==================================================================================================== + # Alle Pagelets an Client schicken + #==================================================================================================== + public static function render($async = FALSE) { + self::flushOutputBuffer(); + + $i = 0; + + ksort(self::$pagelets); + + foreach(array_reverse(self::$pagelets) as $priority => $pagelets) { + foreach($pagelets as $Pagelet) { + if(!self::isEnabled()) { + if($Pagelet->getJSCode()) { + echo ''."\n"; + } + + foreach($Pagelet->getCSSFiles() as $CSSFile) { + echo ''."\n"; + } + + foreach($Pagelet->getJSFiles() as $JSFile) { + echo ''."\n"; + } + } + + else { + self::pageletResponse($Pagelet, $async, (self::$count === ++$i)); + self::flushOutputBuffer(); + } + } + } + } +} \ No newline at end of file -- cgit v1.2.3