From cdcab5593311b4bdec2b54c070d9f6133b95aaa7 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 13 May 2016 21:50:30 +0200 Subject: Multiple updates --- include/classes/BigPipe/BigPipe.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'include/classes/BigPipe/BigPipe.php') diff --git a/include/classes/BigPipe/BigPipe.php b/include/classes/BigPipe/BigPipe.php index 39a812d..8cdda0b 100755 --- a/include/classes/BigPipe/BigPipe.php +++ b/include/classes/BigPipe/BigPipe.php @@ -33,21 +33,23 @@ class BigPipe { # Prints a single pagelet response #=============================================================================== private static function singleResponse(Pagelet $Pagelet, $last = FALSE) { - $data = [ + $pageletJSON = [ 'ID' => $Pagelet->getID(), 'RESOURCES' => ['CSS' => $Pagelet->getCSSFiles(), 'JS' => $Pagelet->getJSFiles(), 'JS_CODE' => removeLineBreaksAndTabs($Pagelet->getJSCode())], - 'PHASES' => (object) $Pagelet->getPhaseDoneJS(), + 'PHASES' => (object) $Pagelet->getPhaseDoneJS() ]; if($last) { - $data['IS_LAST'] = true; + $pageletJSON['IS_LAST'] = true; } - $pageletHTML = str_replace('--', '--', removeLineBreaksAndTabs($Pagelet->getHTML())); - $pageletJSON = json_encode($data, (self::$debug ? JSON_PRETTY_PRINT : FALSE)); + $pageletHTML = removeLineBreaksAndTabs($Pagelet->getHTML()); + $pageletHTML = str_replace('--', '--', $pageletHTML); + + $pageletJSON = json_encode($pageletJSON, (self::$debug ? JSON_PRETTY_PRINT : NULL)); echo "getID()}\">\n"; - echo "\n\n"; + echo "\n\n"; } #=============================================================================== @@ -71,15 +73,15 @@ class BigPipe { foreach($pagelets as $Pagelet) { if(!self::isEnabled()) { foreach($Pagelet->getCSSFiles() as $CSSFile) { - echo ''."\n"; + echo "\n"; } foreach($Pagelet->getJSFiles() as $JSFile) { - echo ''."\n"; + echo "\n"; } - if($Pagelet->getJSCode()) { - echo ''."\n"; + foreach($Pagelet->getJSCode() as $JSCode) { + echo "\n"; } } -- cgit v1.2.3