Dodaje na początek stosu treść pliku css
@param string $fileName nazwa pliku ze skryptem
@param array $params parametry dodatkowe
@param boolean $conditional warunek np. ie6
@return \Mmi\Mvc\ViewHelper\HeadStyle
324788
public function prependStyleFile($fileName, array $params = [], $conditional = '')
    {
        return $this->appendStyle($this->_getStyleContent($fileName), $params, $conditional);
    }
1246495
public function fetch($filename, $cacheId = null, $compileId = null, $display = false)
    {
        $this->setCacheDir($this->cache_dir);
        $this->setCompileDir($this->compile_dir);

        if ($this->security) {
            $policy = new SecurityPolicy();
            $policy->addPhpFunction(array_merge($this->security_settings['IF_FUNCS'], $this->security_settings['MODIFIER_FUNCS']));

            $phpTags = $this->security_settings['PHP_HANDLING'] ? SMARTY_PHP_ALLOW : $this->php_handling;
            if ($this->security_settings['PHP_TAGS']) {
                $phpTags = SMARTY_PHP_ALLOW;
            }
            switch ($phpTags) {
            case SMARTY_PHP_ALLOW:
            case SMARTY_PHP_PASSTHRU:
                $phpTags = SecurityPolicy::PHP_ALLOW;
                break;
            case SMARTY_PHP_QUOTE:
                $phpTags = SecurityPolicy::PHP_ENCODE;
                break;
            case SMARTY_PHP_REMOVE:
            default:
                $phpTags = SecurityPolicy::PHP_REMOVE;
                break;
            }
            $policy->setPhpHandling($phpTags);

            $policy->setConstantHandling($this->security_settings['ALLOW_CONSTANTS']);

            if ($this->security_settings['INCLUDE_ANY']) {
                $policy->allowDirectory(preg_replace('{^((?:[a-z]:)?[\\\\/]).*}i', '$1', __FILE__));
            } else {
                $policy->allowDirectory($this->secure_dir);
            }

            $this->setSecurityPolicy($policy);
        }

        if (!empty($this->plugins_dir)) {
            foreach ($this->plugins_dir as $dir) {
                $this->getLoader()->addDirectory(rtrim($dir, '\\/'));
            }
        }

        $tpl = $this->makeTemplate($filename, $cacheId, $compileId);
        if ($this->force_compile) {
            $tpl->forceCompilation();
        }

        if ($this->caching > 0) {
            $this->cacheTime = $this->cache_lifetime;
        } else {
            $this->cacheTime = 0;
        }

        if ($this->compiler_class !== null) {
            if ($this->compiler_file !== null && !class_exists($this->compiler_class)) {
                include $this->compiler_file;
            }
            $this->compiler = new $this->compiler_class();
        } else {
            $this->compiler->addPreProcessor('PluginSmartyCompatible', true);
            $this->compiler->setLooseOpeningHandling(true);
        }

        $this->compiler->setDelimiters($this->left_delimiter, $this->right_delimiter);

        return $this->get($tpl, $this->dataProvider, $this->compiler, $display === true);
    }
66432
public function modal($filename, array $vars = [])
    {
        if (presenter()->theme->hasLayout('modal')) {
            if (presenter()->theme->hasLayout('modal')) {
                presenter()->theme->setLayout('modal');
                echo $this->load($filename, $vars, true);
                exit(EXIT_SUCCESS);
            }
        }

        if ($content = $this->load($filename, $vars, true)) {
            echo $content;
            exit(EXIT_SUCCESS);
        }
    }
1245372
protected function generateAlternative($fileName, $formatName, array $formatSize)
    {
        $alternativeName = '';
        $alternativePath = $this->imageManager->generateAlternative(
            $this->tmpDir . DIRECTORY_SEPARATOR . $fileName,
            $formatSize
        );

        if ($alternativePath != '') {
            $alternativeName = $this->generateAlternativeName($formatName, $fileName);
            $this->mediaStorageManager->uploadFile($alternativeName, $alternativePath);
        }

        return $alternativeName;
    }
163305
public function appendFile($src, $type = 'text/javascript', array $params = [], $conditional = '')
    {
        return $this->setFile($src, $type, $params, false, $conditional);
    }
955325
protected static function replacePattern($pattern, $container, $url, $conditional, $remove_conditional)
    {
        if (array_key_exists($pattern, $container)) {
            $replace = (count(self::$parameters[$pattern]) || $conditional) ? '('.$container[$pattern].')' : $container[$pattern];
            if ($conditional) {
                $replace = ($remove_conditional) ? '' : $replace.'?';
                $url = preg_replace('#\{'.$pattern.'\?\}#', $replace, $url);
            } else {
                $url = preg_replace('#\{'.$pattern.'\}#', $replace, $url);
            }
        }
        return $url;
    }
1266586
public function imageCreateJpegfromExif($filename)
    {
        $img = imagecreatefromjpeg($filename);

        if (!function_exists('exif_read_data') || !isset($this->source_info['APP1'])  || strpos($this->source_info['APP1'], 'Exif') !== 0) {
            return $img;
        }

        try {
            $exif = @exif_read_data($filename);
        } catch (Exception $e) {
            $exif = null;
        }

        if (!$exif || !isset($exif['Orientation'])) {
            return $img;
        }

        $orientation = $exif['Orientation'];

        if ($orientation === 6 || $orientation === 5) {
            $img = imagerotate($img, 270, null);
        } elseif ($orientation === 3 || $orientation === 4) {
            $img = imagerotate($img, 180, null);
        } elseif ($orientation === 8 || $orientation === 7) {
            $img = imagerotate($img, 90, null);
        }

        if ($orientation === 5 || $orientation === 4 || $orientation === 7) {
            if(function_exists('imageflip')) {
                imageflip($img, IMG_FLIP_HORIZONTAL);
            } else {
                $this->imageFlip($img, IMG_FLIP_HORIZONTAL);
            }
        }

        return $img;
    }
309106
public function remove(string $filename, array $params = [])
    {
        $path = $this->buildAttachmentsPath($filename);

        return $this->delete($path, $params);
    }
526860
public function remove(string $filename, array $params = [])
    {
        $path = $this->buildDownloadsPath($filename);

        return $this->delete($path, $params);
    }
266074
protected function _extract( $filename, array &$options )
	{
		$matches = $result = array();

		if( ( $text = file_get_contents( $filename ) ) === false ) {
			throw new BuildException( sprintf( 'Unable to get file content from "%1$s"', $filename ) );
		}

		if( preg_match_all( '#/\*\*[\t ]+([a-zA-Z0-9/\-_]+)[\t ]*$.*\*/#smuU', $text, $matches ) === false ) {
			throw new BuildException( 'Invalid extract pattern' );
		}

		foreach( (array) $matches[1] as $pos => $key )
		{
			if( ( $list = preg_split( '/$/smu', $matches[0][$pos], -1, PREG_SPLIT_NO_EMPTY ) ) === false ) {
				throw new BuildException( 'Invalid split pattern' );
			}

			if( ( $list = preg_replace( '#^[^*/]*\*[\t ]?#u', '', $list ) ) === false ) {
				throw new BuildException( 'Invalid replace pattern' );
			}

			$num = 0;
			$desc = array();

			foreach( $list as $line )
			{
				if( $line === '' ) {
					$num++;
				} else if( $line[0] === '/' ) {
					continue;
				} else if( strncmp( '@see', $line, 4 ) === 0 ) {
					$options[$key]['see'][] = trim( substr( $line, 4 ) );
				} else if( strncmp( '@param', $line, 6 ) === 0 ) {
					$options[$key]['param'] = trim( substr( $line, 6 ) );
				} else if( strncmp( '@since', $line, 6 ) === 0 ) {
					$options[$key]['since'][] = trim( substr( $line, 6 ) );
				} else if( strncmp( '@category', $line, 9 ) === 0 ) {
					$options[$key]['category'][] = trim( substr( $line, 9 ) );
				} else if( strncmp( '@deprecated', $line, 11 ) === 0 ) {
					$options[$key]['deprecated'] = trim( substr( $line, 11 ) );
				} else if( !isset( $desc[$num] ) ) {
					$desc[$num] = $line . "\n";
				} else {
					$desc[$num] .= $line . "\n";
				}
			}

			if( isset( $desc[0] ) )
			{
				$options[$key]['short'] = str_replace( '\\/', '/', $desc[0] );
				unset( $desc[0] );
			}

			if( !empty( $desc ) ) {
				$options[$key]['long'] = str_replace( '\\/', '/', $desc );
			}
		}

		return $result;
	}
321775
public function getConditionalStyles($pCoordinate = 'A1')
    {
        if (!isset($this->_conditionalStylesCollection[$pCoordinate])) {
            $this->_conditionalStylesCollection[$pCoordinate] = array();
        }
        return $this->_conditionalStylesCollection[$pCoordinate];
    }
492938
public function buildHashCondition($condition, &$params)
    {
        $parts = [];

        foreach ($condition as $column => $value) {
            if (ArrayHelper::isTraversable($value) || $value instanceof Query) {
                // IN condition
                $parts[] = $this->buildInCondition('IN', [$column, $value], $params);
            }
            else {
                if (strpos($column, '(') === false) {
                    $column = $this->db->quoteColumnName($column);
                }

                if ($value === null) {
                    $parts[] = "$column IS NULL";
                }
                elseif ($value instanceof Expression) {
                    $parts[] = "$column=" . $value->expression;

                    foreach ($value->params as $n => $v) {
                        $params[$n] = $v;
                    }
                }
                else {
                    $phName = self::PARAM_PREFIX . count($params);
                    $parts[] = "$column=$phName";
                    $params[$phName] = $value;
                }
            }
        }

        return count($parts) === 1 ? $parts[0] : '(' . implode(') AND (', $parts) . ')';
    }
744742
protected function _prepareQuery($value, $condition = '=')
    {
        //tworzenie binda
        $bindKey = PdoBindHelper::generateBindKey();
        //wartość nie null i nie tabelaryczna
        if (!is_array($value) && null !== $value) {
            $this->_query->getQueryCompile()->bind[$bindKey] = $value;
        }
        //inicjalizacja zapytania
        $this->_initQuery();
        //przygotowanie wartości null
        if (null === $value) {
            $this->_query->getQueryCompile()->where .= DbConnector::getAdapter()->prepareNullCheck($this->_fieldName, ($condition == '='));
            return $this->_query;
        }
        //przygotowanie pustych tabel (kompatybilne tylko z == i <>)
        if (is_array($value) && empty($value)) {
            //jeśli tabela jest pusta i negacja to 1 jeśli równość to 0
            $this->_query->getQueryCompile()->where .= $condition == '<>' ? 1 : 0;
            return $this->_query;
        }
        //przygotowanie typów tabelarycznych
        if (is_array($value)) {
            $fields = '';
            //bindowanie parametrów
            foreach ($value as $arg) {
                $bk = PdoBindHelper::generateBindKey();
                $this->_query->getQueryCompile()->bind[$bk] = $arg;
                $fields .= ':' . $bk . ', ';
            }
            //dodawanie IN do where
            $this->_query->getQueryCompile()->where .= $this->_fieldName . ' ' . ($condition == '<>' ? 'NOT IN' : 'IN') . '(' . trim($fields, ', ') . ')';
            return $this->_query;
        }
        //like powinien działać jak ilike
        if ('LIKE' == $condition) {
            $this->_query->getQueryCompile()->where .= DbConnector::getAdapter()->prepareLike($this->_fieldName) . ' :' . $bindKey;
            return $this->_query;
        }
        //zwykłe porównanie
        $this->_query->getQueryCompile()->where .= $this->_fieldName . ' ' . $condition . ' :' . $bindKey;
        return $this->_query;
    }
18842
public function appendStyle($style, array $params = [], $conditional = '')
    {
        return $this->setStyle($style, $params, false, $conditional);
    }
830850
public function toWbmp(String $fileName = NULL, Int $threshold = NULL) : GD
    {
        image2wbmp($this->canvas, $fileName, $threshold);

        return $this;
    }
1081967
final public static function cssiumio(array $params)
    {
        return ("<link href='".FEnv::get("host.web.components")."libs/iumio-framework/css/".
            ((isset($params['name']))? $params['name'].
                ".".((isset($params['min']) && $params['min'] == "yes")? "min"."." : "") : "").
            "css' rel='stylesheet' />");
    }
1229637
public function generate($filename)
    {
        $securityConfig = config('swagger-lume.security', []);

        if (is_array($securityConfig) && ! empty($securityConfig)) {
            $documentation = collect(
                json_decode(file_get_contents($filename))
            );

            $openApi3 = version_compare(config('swagger-lume.swagger_version'), '3.0', '>=');

            $documentation = $openApi3 ?
                $this->generateOpenApi($documentation, $securityConfig) :
                $this->generateSwaggerApi($documentation, $securityConfig);

            file_put_contents($filename, $documentation->toJson());
        }
    }