Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 12958112 authored by Nicolas's avatar Nicolas
Browse files

Gestion des valeurs de system.xml pour les PDF

parent ba9873ad
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ use \Magento\Framework\App\Filesystem\DirectoryList;
use \Magento\Framework\Image\AdapterFactory as ImageAdapterFactory;
use \Magento\Framework\View\Element\Template;
use \Magento\Framework\View\Element\Template\Context;
use \Magento\Store\Model\ScopeInterface;
use \Magento\Store\Model\StoreManagerInterface;
use \Magento\Widget\Block\BlockInterface;
......@@ -88,18 +89,7 @@ class Pdf extends Template implements BlockInterface
* if keepAspectRatio(false).
* - backgroundColor[null]: Default white
*/
protected $defaultSettings = [
'constrainOnly' => true,
'keepAspectRatio' => true,
'keepTransparency' => true,
'keepFrame' => false,
'backgroundColor' => null,
'identifier' => 'mmi',
'basename' => '',
'width' => 1920,
'height' => 1080,
'compression' => 60
];
protected $defaultSettings = [];
/**
* @var ImageOptimizer
......@@ -134,6 +124,19 @@ class Pdf extends Template implements BlockInterface
$this->imageOptimizer = $imageOptimizer;
parent::__construct($context, $data);
$this->defaultSettings = [
'constrainOnly' => $this->_scopeConfig->getValue('mediamanagerpdf/resize/constrain_only', ScopeInterface::SCOPE_STORE),
'keepAspectRatio' => $this->_scopeConfig->getValue('mediamanagerpdf/resize/keep_aspect_ratio', ScopeInterface::SCOPE_STORE),
'keepTransparency' => $this->_scopeConfig->getValue('mediamanagerpdf/resize/keep_transparency', ScopeInterface::SCOPE_STORE),
'keepFrame' => $this->_scopeConfig->getValue('mediamanagerpdf/resize/keep_frame', ScopeInterface::SCOPE_STORE),
'backgroundColor' => $this->_scopeConfig->getValue('mediamanagerpdf/resize/background_color', ScopeInterface::SCOPE_STORE),
'identifier' => $this->_scopeConfig->getValue('mediamanagerpdf/save/identifier', ScopeInterface::SCOPE_STORE),
'basename' => $this->_scopeConfig->getValue('mediamanagerpdf/save/basename', ScopeInterface::SCOPE_STORE),
'width' => $this->_scopeConfig->getValue('mediamanagerpdf/save/width', ScopeInterface::SCOPE_STORE),
'height' => $this->_scopeConfig->getValue('mediamanagerpdf/save/height', ScopeInterface::SCOPE_STORE),
'compression' => $this->_scopeConfig->getValue('mediamanagerpdf/save/compression', ScopeInterface::SCOPE_STORE)
];
}
/**
......
......@@ -56,7 +56,7 @@
</section>
<section id="mediamanagerpdf" translate="label" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<class>separator-top</class>
<label>Media Manager PDF (Not Working Yet)</label>
<label>Media Manager PDF</label>
<tab>nicolasbejean</tab>
<resource>NicolasBejean_MediaManager::pdf</resource>
<group id="resize" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment