source/Core/ViewHelper/JavaScriptRenderer.php
public function render($widget, $forceRender, $isDynamic = false)
    {
        $config = \OxidEsales\Eshop\Core\Registry::getConfig();
        $output = '';
        $suffix = $isDynamic ? '_dynamic' : '';
        $filesParameterName = \OxidEsales\Eshop\Core\ViewHelper\JavaScriptRegistrator::FILES_PARAMETER_NAME . $suffix;
        $scriptsParameterName = \OxidEsales\Eshop\Core\ViewHelper\JavaScriptRegistrator::SNIPPETS_PARAMETER_NAME . $suffix;

        $isAjaxRequest = $this->isAjaxRequest();
        $forceRender = $this->shouldForceRender($forceRender, $isAjaxRequest);

        if (!$widget || $forceRender) {
            if (!$isAjaxRequest) {
                $files = $this->prepareFilesForRendering($config->getGlobalParameter($filesParameterName), $widget);
                $output .= $this->formFilesOutput($files, $widget);
                $config->setGlobalParameter($filesParameterName, null);
                if ($widget) {
                    $dynamicIncludes = (array)$config->getGlobalParameter(\OxidEsales\Eshop\Core\ViewHelper\JavaScriptRegistrator::FILES_PARAMETER_NAME . '_dynamic');
                    $output .= $this->formFilesOutput($dynamicIncludes, $widget);
                    $config->setGlobalParameter(\OxidEsales\Eshop\Core\ViewHelper\JavaScriptRegistrator::FILES_PARAMETER_NAME . '_dynamic', null);
                }
            }

            // Form output for adds.
            $snippets = (array)$config->getGlobalParameter($scriptsParameterName);
            $scriptOutput = $this->formSnippetsOutput($snippets, $widget, $isAjaxRequest);
            $config->setGlobalParameter($scriptsParameterName, null);
            if ($widget) {
                $dynamicScripts = (array) $config->getGlobalParameter(\OxidEsales\Eshop\Core\ViewHelper\JavaScriptRegistrator::SNIPPETS_PARAMETER_NAME . '_dynamic');
                $scriptOutput .= $this->formSnippetsOutput($dynamicScripts, $widget, $isAjaxRequest);
                $config->setGlobalParameter(\OxidEsales\Eshop\Core\ViewHelper\JavaScriptRegistrator::SNIPPETS_PARAMETER_NAME . '_dynamic', null);
            }
            $output .= $this->enclose($scriptOutput, $widget, $isAjaxRequest);
        }

        return $output;
    }
public function render($widget, $forceRender, $isDynamic = false)
    {
        $config = \OxidEsales\Eshop\Core\Registry::getConfig();
        $output = '';
        $suffix = $isDynamic ? '_dynamic' : '';
        $filesParameterName = \OxidEsales\Eshop\Core\ViewHelper\JavaScriptRegistrator::FILES_PARAMETER_NAME . $suffix;
        $scriptsParameterName = \OxidEsales\Eshop\Core\ViewHelper\JavaScriptRegistrator::SNIPPETS_PARAMETER_NAME . $suffix;

        $isAjaxRequest = $this->isAjaxRequest();
        $forceRender = $this->shouldForceRender($forceRender, $isAjaxRequest);

        if (!$widget || $forceRender) {
            if (!$isAjaxRequest) {
                $files = $this->prepareFilesForRendering($config->getGlobalParameter($filesParameterName), $widget);
                $output .= $this->formFilesOutput($files, $widget);
                $config->setGlobalParameter($filesParameterName, null);
                if ($widget) {
                    $dynamicIncludes = (array)$config->getGlobalParameter(\OxidEsales\Eshop\Core\ViewHelper\JavaScriptRegistrator::FILES_PARAMETER_NAME . '_dynamic');
                    $output .= $this->formFilesOutput($dynamicIncludes, $widget);
                    $config->setGlobalParameter(\OxidEsales\Eshop\Core\ViewHelper\JavaScriptRegistrator::FILES_PARAMETER_NAME . '_dynamic', null);
                }
            }

            // Form output for adds.
            $snippets = (array)$config->getGlobalParameter($scriptsParameterName);
            $scriptOutput = $this->formSnippetsOutput($snippets, $widget, $isAjaxRequest);
            $config->setGlobalParameter($scriptsParameterName, null);
            if ($widget) {
                $dynamicScripts = (array) $config->getGlobalParameter(\OxidEsales\Eshop\Core\ViewHelper\JavaScriptRegistrator::SNIPPETS_PARAMETER_NAME . '_dynamic');
                $scriptOutput .= $this->formSnippetsOutput($dynamicScripts, $widget, $isAjaxRequest);
                $config->setGlobalParameter(\OxidEsales\Eshop\Core\ViewHelper\JavaScriptRegistrator::SNIPPETS_PARAMETER_NAME . '_dynamic', null);
            }
            $output .= $this->enclose($scriptOutput, $widget, $isAjaxRequest);
        }

        return $output;
    }
public function render ( $ widget , $ forceRender , $ isDynamic = false ) { $ config = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ output = '' ; $ suffix = $ isDynamic ? '_dynamic' : '' ; $ filesParameterName = \ OxidEsales \ Eshop \ Core \ ViewHelper \ JavaScriptRegistrator :: FILES_PARAMETER_NAME . $ suffix ; $ scriptsParameterName = \ OxidEsales \ Eshop \ Core \ ViewHelper \ JavaScriptRegistrator :: SNIPPETS_PARAMETER_NAME . $ suffix ; $ isAjaxRequest = $ this -> isAjaxRequest ( ) ; $ forceRender = $ this -> shouldForceRender ( $ forceRender , $ isAjaxRequest ) ; if ( ! $ widget || $ forceRender ) { if ( ! $ isAjaxRequest ) { $ files = $ this -> prepareFilesForRendering ( $ config -> getGlobalParameter ( $ filesParameterName ) , $ widget ) ; $ output .= $ this -> formFilesOutput ( $ files , $ widget ) ; $ config -> setGlobalParameter ( $ filesParameterName , null ) ; if ( $ widget ) { $ dynamicIncludes = ( array ) $ config -> getGlobalParameter ( \ OxidEsales \ Eshop \ Core \ ViewHelper \ JavaScriptRegistrator :: FILES_PARAMETER_NAME . '_dynamic' ) ; $ output .= $ this -> formFilesOutput ( $ dynamicIncludes , $ widget ) ; $ config -> setGlobalParameter ( \ OxidEsales \ Eshop \ Core \ ViewHelper \ JavaScriptRegistrator :: FILES_PARAMETER_NAME . '_dynamic' , null ) ; } } // Form output for adds. $ snippets = ( array ) $ config -> getGlobalParameter ( $ scriptsParameterName ) ; $ scriptOutput = $ this -> formSnippetsOutput ( $ snippets , $ widget , $ isAjaxRequest ) ; $ config -> setGlobalParameter ( $ scriptsParameterName , null ) ; if ( $ widget ) { $ dynamicScripts = ( array ) $ config -> getGlobalParameter ( \ OxidEsales \ Eshop \ Core \ ViewHelper \ JavaScriptRegistrator :: SNIPPETS_PARAMETER_NAME . '_dynamic' ) ; $ scriptOutput .= $ this -> formSnippetsOutput ( $ dynamicScripts , $ widget , $ isAjaxRequest ) ; $ config -> setGlobalParameter ( \ OxidEsales \ Eshop \ Core \ ViewHelper \ JavaScriptRegistrator :: SNIPPETS_PARAMETER_NAME . '_dynamic' , null ) ; } $ output .= $ this -> enclose ( $ scriptOutput , $ widget , $ isAjaxRequest ) ; } return $ output ; }
Renders all registered JavaScript snippets and files.

@param string $widget      Widget name
@param bool   $forceRender Force rendering of scripts.
@param bool   $isDynamic   Force rendering of scripts.

@return string
Renders all registered JavaScript snippets and files .