Merge branch 'dev' into 12-dev

This commit is contained in:
fredtempez 2022-03-21 11:52:39 +01:00
commit 373a62a8be
2 changed files with 22 additions and 8 deletions

View File

@ -992,6 +992,20 @@ if ($this->getData(['core', 'dataVersion']) < 11400) {
];
$this->setData(['fonts', 'imported', $fonts]);
// Conversion des fontes locales
$files = $this->getData(['fonts', 'files']);
if (is_array($files)) {
$this->deleteData(['fonts', 'files']);
foreach ($files as $fontId => $fontName) {
$this->setData(['fonts', 'files', $fontId, [
'name' => ucfirst($fontId),
'font-family'=> $fontId . ', sans-serif',
'resource' => $fontName
]]);
}
}
// Rafraichir les thèmes
if (file_exists(self::DATA_DIR . 'admin.css')) {
unlink (self::DATA_DIR . 'admin.css');

View File

@ -622,10 +622,10 @@ class theme extends common {
// Type d'import en ligne ou local
$type = $this->getInput('fontAddFontImported', helper::FILTER_BOOLEAN) ? 'imported' : 'files';
$typeFlip = $type === 'files' ? 'imported' : 'files';
$ressource = $type === 'imported' ? $this->getInput('fontAddUrl', helper::FILTER_STRING_SHORT) : $this->getInput('fontAddFile', helper::FILTER_STRING_SHORT);
$fontId = $this->getInput('fontAddFontId', helper::FILTER_STRING_SHORT, true);
$fontName = $this->getInput('fontAddFontName', helper::FILTER_STRING_SHORT, true);
$fontFamilyName = $this->getInput('fontAddFontFamilyName', helper::FILTER_STRING_SHORT, true);
$ressource = $type === 'imported' ? $this->getInput('fontAddUrl', null) : $this->getInput('fontAddFile', null);
$fontId = $this->getInput('fontAddFontId', null, true);
$fontName = $this->getInput('fontAddFontName', null, true);
$fontFamilyName = $this->getInput('fontAddFontFamilyName', null, true);
// Supprime la fonte si elle existe dans le type inverse
if (is_array($this->getData(['fonts', $typeFlip, $fontId])) ) {
@ -672,10 +672,10 @@ class theme extends common {
// Type d'import en ligne ou local
$type = $this->getInput('fontEditFontImported', helper::FILTER_BOOLEAN) ? 'imported' : 'files';
$typeFlip = $type === 'files' ? 'imported' : 'files';
$ressource = $type === 'imported' ? $this->getInput('fontEditUrl', helper::FILTER_STRING_SHORT) : $this->getInput('fontEditFile', helper::FILTER_STRING_SHORT);
$fontId = $this->getInput('fontEditFontId', helper::FILTER_STRING_SHORT, true);
$fontName = $this->getInput('fontEditFontName', helper::FILTER_STRING_SHORT, true);
$fontFamilyName = $this->getInput('fontEditFontFamilyName', helper::FILTER_STRING_SHORT, true);
$ressource = $type === 'imported' ? $this->getInput('fontEditUrl', null) : $this->getInput('fontEditFile', null);
$fontId = $this->getInput('fontEditFontId', null, true);
$fontName = $this->getInput('fontEditFontName', null , true);
$fontFamilyName = $this->getInput('fontEditFontFamilyName', null, true);
// Supprime la fonte si elle existe dans le type inverse
if (is_array($this->getData(['fonts', $typeFlip, $fontId])) ) {