/** * Generates a string with all the JS/CSS stored using {@see CmsPage::addJs} using the * target {@see CmsPage::PAGE_AREA_BODY} * * @param CmsPage $cmsPage The requested CMS page * * @return string The HTML for all the JS which should ne present in the footer of the page */ protected function generateAreaBody(CmsPage $cmsPage) { $env = $this->currentDomain->environment; $isDebug = $this->core->getSettings()->core->environments->{$env}->debug === true; $areaBodyHtml = $isDebug ? '<!-- AREA BODY START -->' . PHP_EOL : null; $jsEntries = $cmsPage->getJs(CmsPage::PAGE_AREA_BODY); foreach ($jsEntries as $jsGroup) { foreach ($jsGroup as $jsEntry) { $areaBodyHtml .= $jsEntry . PHP_EOL; } } $areaBodyHtml .= $isDebug ? '<!-- AREA BODY STOP -->' . PHP_EOL : null; return $areaBodyHtml . PHP_EOL; }