b374k
m1n1 1.01
Apache/2.4.41 (Ubuntu)
Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64
uid=33(www-data) gid=33(www-data) groups=33(www-data)
server ip : 62.171.164.128 | your ip : 127.0.0.1
safemode OFF
 >  / home / dev2.destoffenstraat.com / app / code / Infortis / Base / Helper /
Filename/home/dev2.destoffenstraat.com/app/code/Infortis/Base/Helper/Design.php
Size2.13 kb
Permissionrwxrwxrwx
Ownerroot : root
Create time17-Aug-2025 10:26
Last modified06-Apr-2021 18:06
Last accessed22-Aug-2025 00:36
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
<?php

namespace Infortis\Base\Helper;

use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Framework\App\Helper\Context;
use Magento\Framework\View\Asset\Repository;

class Design extends AbstractHelper
{
/**
* The tail part of directory path for background image uploading
*/
const BACKGROUND_DIR = 'wysiwyg/infortis/_bg/';

/**
* The tail part of directory path for textures
*/
const PATTERN_DIR = 'images/tex/';

/**
* File extension
*/
const PATTERN_FILE_EXT = '.png';

/**
* The tail part of directory path for flags
*/
const FLAG_DIR = 'images/flags/';

/**
* File extension
*/
const FLAG_FILE_EXT = '.png';

/**
* Asset service
*
* @var \Magento\Framework\View\Asset\Repository
*/
protected $_assetRepo;

/**
* Prepare paths
*/
public function __construct(
Context $context,
\Magento\Framework\View\Asset\Repository $assetRepo
) {
$this->_assetRepo = $assetRepo;

parent::__construct($context);
}

/**
* Get URL of the background image
*
* @param string $image
* @param array $params
* @return string
*/
public function getBackgroundUrl($image, array $params = [])
{
$path = self::BACKGROUND_DIR . $image;

return $this->_urlBuilder->getBaseUrl(['_type' => \Magento\Framework\UrlInterface::URL_TYPE_MEDIA], $params) . $path;
}

/**
* Get URL of the pattern image
*
* @param string $pattern
* @param array $params
* @return string
*/
public function getPatternUrl($pattern, array $params = [])
{
$path = self::PATTERN_DIR . $pattern . self::PATTERN_FILE_EXT;

return $this->_assetRepo->getUrlWithParams($path, $params);
}

/**
* Get URL of the flag image
*
* @param string $flag
* @param array $params
* @return string
*/
public function getFlagUrl($flag, array $params = [])
{
$path = self::FLAG_DIR . $flag . self::FLAG_FILE_EXT;

return $this->_assetRepo->getUrlWithParams($path, $params);
}

}