From bcf23c3ab443567991d602f6d06d87051aa3468b Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Sat, 21 Oct 2017 23:54:41 +0200 Subject: Code optimization: The method "getStructure" has been added to the abstract Item class. --- include/classes/BigPipe/BigPipe.php | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'include/classes/BigPipe/BigPipe.php') diff --git a/include/classes/BigPipe/BigPipe.php b/include/classes/BigPipe/BigPipe.php index 2989a75..ab8c8f7 100755 --- a/include/classes/BigPipe/BigPipe.php +++ b/include/classes/BigPipe/BigPipe.php @@ -64,27 +64,7 @@ class BigPipe { usleep(rand(125, 175) * 2000); } - $stylesheets = []; - $javascripts = []; - - foreach($Pagelet->getResources()[Resource::TYPE_STYLESHEET] as $Resource) { - $stylesheets[] = ['ID' => $Resource->getID(), 'HREF' => $Resource->getURL(), 'PHASE' => $Resource->getPhaseDoneJS()]; - } - - foreach($Pagelet->getResources()[Resource::TYPE_JAVASCRIPT] as $Resource) { - $javascripts[] = ['ID' => $Resource->getID(), 'HREF' => $Resource->getURL(), 'PHASE' => $Resource->getPhaseDoneJS()]; - } - - $pageletJSON = [ - 'ID' => $Pagelet->getID(), - 'NEED' => $Pagelet->getDependencies(), - 'RSRC' => [ - Resource::TYPE_STYLESHEET => $stylesheets, - Resource::TYPE_JAVASCRIPT => $javascripts, - ], - 'CODE' => removeLineBreaksAndTabs($Pagelet->getJSCode()), - 'PHASE' => $Pagelet->getPhaseDoneJS() - ]; + $pageletJSON = $Pagelet->getStructure(); if($last) { $pageletJSON['IS_LAST'] = TRUE; -- cgit v1.2.3