Copy ok
This commit is contained in:
parent
a3c2eb3978
commit
05e0fad922
@ -583,22 +583,28 @@ class theme extends common {
|
|||||||
if ($this->isPost()) {
|
if ($this->isPost()) {
|
||||||
$fontId = $this->getInput('fontAddFontId', null, true);
|
$fontId = $this->getInput('fontAddFontId', null, true);
|
||||||
$fontName = $this->getInput('fontAddFontName', null, true);
|
$fontName = $this->getInput('fontAddFontName', null, true);
|
||||||
$file = $this->getInput('fontAddFile', null, true);
|
$filePath = $this->getInput('fontAddFile', null, true);
|
||||||
$e = explode ('/', $file);
|
$e = explode ('/', $filePath);
|
||||||
$file = $e[count($e) - 1 ];
|
$file = $e[count($e) - 1 ];
|
||||||
|
|
||||||
// Charger les données des fontes
|
// Charger les données des fontes
|
||||||
$files = $this->getData(['fonts', 'files']);
|
$files = $this->getData(['fonts', 'files']);
|
||||||
$imported = $this->getData(['fonts', 'imported']);
|
$imported = $this->getData(['fonts', 'imported']);
|
||||||
|
|
||||||
// Concaténation dans les tableaux existants
|
// Concaténation dans les tableaux existants
|
||||||
$imported = array_merge([$fontId => $fontName], $imported);
|
$imported = array_merge([$fontId => $fontName], $imported);
|
||||||
$files = array_merge([$fontId => $file], $files);
|
$files = array_merge([$fontId => $file], $files);
|
||||||
|
|
||||||
|
// Copier la fonte
|
||||||
|
copy ( self::FILE_DIR . 'source/' . $filePath, self::DATA_DIR . 'fonts/' . $file );
|
||||||
|
|
||||||
// Mettre à jour le fichier des fontes
|
// Mettre à jour le fichier des fontes
|
||||||
$this->setData(['fonts', 'imported', $imported ]);
|
$this->setData(['fonts', 'imported', $imported ]);
|
||||||
$this->setData(['fonts', 'files', $files ]);
|
$this->setData(['fonts', 'files', $files ]);
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
|
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'notification' => 'Fonte importée',
|
'notification' => 'La fonte a été importée',
|
||||||
'redirect' => helper::baseUrl() . 'theme/fonts',
|
'redirect' => helper::baseUrl() . 'theme/fonts',
|
||||||
'state' => true
|
'state' => true
|
||||||
]);
|
]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user