Beispiel #1
0
 /**
  * @param array $parameters
  * @param object $caller
  * @param boolean $cached If TRUE, treats this inclusion as happening in a cached context
  * @return void
  */
 public function buildAll(array $parameters, $caller, $cached = TRUE)
 {
     if (FALSE === $this->objectManager instanceof \TYPO3\CMS\Extbase\Object\ObjectManager) {
         $this->objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
         $this->configurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
     }
     $settings = $this->getSettings();
     $cached = (bool) $cached;
     if (FALSE === self::$typoScriptAssetsBuilt && TRUE === isset($settings['asset']) && TRUE === is_array($settings['asset'])) {
         foreach ($settings['asset'] as $name => $typoScriptAsset) {
             if (FALSE === isset($GLOBALS['VhsAssets'][$name]) && TRUE === is_array($typoScriptAsset)) {
                 if (FALSE === isset($typoScriptAsset['name'])) {
                     $typoScriptAsset['name'] = $name;
                 }
                 Asset::createFromSettings($typoScriptAsset);
             }
         }
         self::$typoScriptAssetsBuilt = TRUE;
     }
     if (FALSE === isset($GLOBALS['VhsAssets']) || FALSE === is_array($GLOBALS['VhsAssets'])) {
         return;
     }
     $assets = $GLOBALS['VhsAssets'];
     $assets = $this->sortAssetsByDependency($assets);
     $assets = $this->manipulateAssetsByTypoScriptSettings($assets);
     $buildDebugRequested = isset($settings['asset']['debugBuild']) && $settings['asset']['debugBuild'] > 0;
     $assetDebugRequested = isset($settings['asset']['debug']) && $settings['asset']['debug'] > 0;
     $useDebugUtility = isset($settings['asset']['useDebugUtility']) && $settings['asset']['useDebugUtility'] > 0 || FALSE === isset($settings['asset']['useDebugUtility']);
     if (TRUE === ($buildDebugRequested || $assetDebugRequested)) {
         if (TRUE === $useDebugUtility) {
             DebuggerUtility::var_dump($assets);
         } else {
             echo var_export($assets, TRUE);
         }
     }
     $this->placeAssetsInHeaderAndFooter($assets, $cached);
 }