Loads an asset from the Nails asset module

@param  string $sAsset     The asset to load
@param  string $sForceType Force a particular type of asset (i.e. JS or CSS)

@return void
480997
protected function loadNails($sAsset, $sForceType)
    {
        $sType = $this->determineType($sAsset, $sForceType);

        switch ($sType) {

            case 'CSS':

                $this->aCss['NAILS-' . $sAsset] = NAILS_ASSETS_URL . $this->sCssDir . $sAsset;
                break;

            case 'JS':

                $this->aJs['NAILS-' . $sAsset] = NAILS_ASSETS_URL . $this->sJsDir . $sAsset;
                break;
        }
    }
375660
private function addAssetsRange($assetType, $type, array $assets)
    {
        $assetsCollection = $this->assets->$assetType->$type;
        $assetsCollection->addRange($assets);
    }
705129
private function getMacSource(Dataset $dataset, $requestType)
    {
        $this->formatParams($dataset);
        $macParams = $this->getNormalizedMacParams($dataset, $requestType);
        $source = implode($macParams);

        return $source;
    }
340466
protected function displayAssets(array $aAssetFiles)
    {
        // Retrieve options
        $oOptions = $this->getOptions();

        // Arbitrary last modified time in production
        $iLastModifiedTime = $oOptions->isProduction() ? $oOptions->getLastModifiedTime() : null;

        // Use to cache loaded plugins
        $aRendererPlugins = array();

        // Render asset files
        foreach ($aAssetFiles as $oAssetFile) {
            if (!($oAssetFile instanceof \AssetsBundle\AssetFile\AssetFile)) {
                throw new \InvalidArgumentException(sprintf(
                    'Asset file expects an instance of "AssetsBundle\AssetFile\AssetFile", "%s" given',
                    is_object($oAssetFile) ? get_class($oAssetFile) : gettype($oAssetFile)
                ));
            }

            switch ($sAssetFileType = $oAssetFile->getAssetFileType()) {
                case \AssetsBundle\AssetFile\AssetFile::ASSET_JS:
                    $oRendererPlugin = isset($aRendererPlugins[$sAssetFileType]) ? $aRendererPlugins[$sAssetFileType] : $aRendererPlugins[$sAssetFileType] = $oOptions->getViewHelperPluginForAssetFileType($sAssetFileType);
                    $oRendererPlugin->appendFile($oOptions->getAssetFileBaseUrl($oAssetFile, $iLastModifiedTime));
                    break;
                case \AssetsBundle\AssetFile\AssetFile::ASSET_CSS:
                    $oRendererPlugin = isset($aRendererPlugins[$sAssetFileType]) ? $aRendererPlugins[$sAssetFileType] : $aRendererPlugins[$sAssetFileType] = $oOptions->getViewHelperPluginForAssetFileType($sAssetFileType);
                    $oRendererPlugin->appendStylesheet($oOptions->getAssetFileBaseUrl($oAssetFile, $iLastModifiedTime), 'all');
                    break;
                default:
                    throw new \DomainException('Asset\'s type "' . $oAssetFile->getAssetFileType() . '" can not be rendering as asset');
            }
        }
        return $this;
    }
518798
protected function unloadNails($sAsset, $sForceType)
    {
        $sType = $this->determineType($sAsset, $sForceType);

        switch ($sType) {

            case 'CSS':

                unset($this->aCss['NAILS-' . $sAsset]);
                break;

            case 'JS':

                unset($this->aJs['NAILS-' . $sAsset]);
                break;
        }
    }
756832
private function loadImageFromString($imagestring)
    {
        if (Utils::isJPGResource($imagestring)) {
            $this->extension = 'jpg';
            $this->type = IMAGETYPE_JPEG;
        }

        if (Utils::isPNGResource($imagestring)) {
            $this->extension = 'png';
            $this->type = IMAGETYPE_PNG;
        }

        $this->from = 'imagestring';
        $this->resource = imagecreatefromstring($imagestring);
        $this->width = $this->boxWidth = imagesx($this->resource);
        $this->height = $this->boxHeight = imagesy($this->resource);
    }
1006665
public function loadFiles($assets)
    {
        foreach ($assets as $type => $item) {
            $addMethod = 'load' . ucfirst($type);

            if (method_exists($this, $addMethod)) {
                call_user_func_array([&$this, $addMethod], [$item]);
            }
        }
    }
940131
protected function checkIfProductHasConcreteOrAbstractAlternative(DataSetInterface $dataSet): void
    {
        if (!$dataSet[ProductAlternativeDataSetInterface::KEY_COLUMN_ALTERNATIVE_PRODUCT_CONCRETE_SKU] &&
            !$dataSet[ProductAlternativeDataSetInterface::KEY_COLUMN_ALTERNATIVE_PRODUCT_ABSTRACT_SKU]
        ) {
            throw new InvalidDataException(
                sprintf(
                    'Product concrete with SKU "%s" has neither concrete nor abstract alternative products',
                    $dataSet[ProductAlternativeDataSetInterface::KEY_COLUMN_CONCRETE_SKU]
                )
            );
        }
    }
28706
protected function _loadAssets()
    {
        $this->_View->Html->css('System./font-panel/fontpanel.css', ['block' => true]);
        $this->_View->Html->script('System./font-panel/fontpanel.js', ['block' => true]);
        $this->_View->Html->script('System./font-panel/font-panel-init.js', ['block' => true]);
    }
168223
protected function loadAppPackage($sAsset, $sForceType)
    {
        $sType = $this->determineType($sAsset, $sForceType);

        switch ($sType) {

            case 'CSS':

                $this->aCss['APP-PACKAGE-' . $sAsset] = $this->sBaseUrl . 'packages/' . $sAsset;
                break;

            case 'JS':

                $this->aJs['APP-PACKAGE-' . $sAsset] = $this->sBaseUrl . 'packages/' . $sAsset;
                break;
        }
    }
907496
public function setJSFromFile(string $filename, Scopable $scope = null, bool $relativeToRootPath = true): void
    {
        $this->jsElement = new HtmlFromFile($filename, $scope, $relativeToRootPath);
    }
526158
public function setType(string $filename, $type = null): AssetFileInterface
    {
        if (! is_null($type) && in_array($type, $this->extensions, true)) {
            // We first listen to a defined asset type.
            // If no type is defined, let's try to discover it.
            $this->type = $this->findType($type);

            return $this;
        }

        $ext = $this->files->extension($filename);

        if (! empty($ext) && in_array($ext, $this->extensions, true)) {
            $this->type = $this->findType($ext);
        }

        return $this;
    }
431831
protected function loadNailsPackage($sAsset, $sForceType)
    {
        $sType = $this->determineType($sAsset, $sForceType);

        switch ($sType) {

            case 'CSS':

                $this->aCss['NAILS-PACKAGE-' . $sAsset] = NAILS_ASSETS_URL . 'packages/' . $sAsset;
                break;

            case 'JS':

                $this->aJs['NAILS-PACKAGE-' . $sAsset] = NAILS_ASSETS_URL . 'packages/' . $sAsset;
                break;
        }
    }
1341725
public function setStyle($cssStyle) {
		if (!JString::startsWith($cssStyle, "panel"))
			$cssStyle="panel".$cssStyle;
		return $this->addToPropertyCtrl("class", $cssStyle, CssRef::Styles("panel"));
	}
335153
protected function unloadAppBower($sAsset, $sForceType)
    {
        $sType = $this->determineType($sAsset, $sForceType);

        switch ($sType) {

            case 'CSS':

                unset($this->aCss['APP-BOWER-' . $sAsset]);
                break;

            case 'JS':

                unset($this->aJs['APP-BOWER-' . $sAsset]);
                break;
        }
    }
641531
public function assetsConfigurationHasChanged(array $aAssetsType = null)
    {
        $aAssetsType = $aAssetsType ? array_unique($aAssetsType) : array(\AssetsBundle\AssetFile\AssetFile::ASSET_CSS, \AssetsBundle\AssetFile\AssetFile::ASSET_LESS, \AssetsBundle\AssetFile\AssetFile::ASSET_JS, \AssetsBundle\AssetFile\AssetFile::ASSET_MEDIA);

        //Retrieve saved onfiguration file
        if (file_exists($sConfigFilePath = $this->getConfigurationFilePath())) {
            \Zend\Stdlib\ErrorHandler::start();
            $aConfig = include $sConfigFilePath;
            \Zend\Stdlib\ErrorHandler::stop(true);

            if ($aConfig === false || !is_array($aConfig)) {
                throw new \RuntimeException('Unable to get file content from file "' . $sConfigFilePath . '"');
            }

            //Get assets configuration
            $aAssets = $this->getOptions()->getAssets();

            //Check if configuration has changed for each type of asset
            foreach ($aAssetsType as $sAssetType) {
                if (!\AssetsBundle\AssetFile\AssetFile::assetFileTypeExists($sAssetType)) {
                    throw new \LogicException('Asset type "' . $sAssetType . '" does not exist');
                }
                if (empty($aAssets[$sAssetType]) && !empty($aConfig[$sAssetType])) {
                    return true;
                } elseif (!empty($aAssets[$sAssetType])) {
                    if (empty($aConfig[$sAssetType])) {
                        return true;
                    } elseif (array_diff($aAssets[$sAssetType], $aConfig[$sAssetType]) || array_diff($aConfig[$sAssetType], $aAssets[$sAssetType])
                    ) {
                        return true;
                    }
                }
            }
            return false;
        }
        return true;
    }
168132
protected function unloadUrl($sAsset, $sForceType)
    {
        $sType = $this->determineType($sAsset, $sForceType);

        switch ($sType) {

            case 'CSS':

                unset($this->aCss['URL-' . $sAsset]);
                break;

            case 'JS':

                unset($this->aJs['URL-' . $sAsset]);
                break;
        }
    }