122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
$values = [];
$db = DB::getInstance();
if (isset($this->modified['image_fond']))
{
if ($current = $db->firstColumn('SELECT valeur FROM config WHERE cle = \'image_fond\';'))
{
$f = new Fichiers($current);
$f->remove();
}
if (strlen($this->config['image_fond']) > 0)
{
$f = Fichiers::storeFromBase64('Image_fond_admin.png', $this->config['image_fond']);
$this->config['image_fond'] = $f->id;
unset($f);
|
>
|
|
>
>
>
>
|
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
$values = [];
$db = DB::getInstance();
if (isset($this->modified['image_fond']))
{
if ($current = $db->firstColumn('SELECT valeur FROM config WHERE cle = \'image_fond\';'))
{
try {
$f = new Fichiers($current);
$f->remove();
}
catch (\InvalidArgumentException $e) {
// Ignore: the file has already been deleted
}
}
if (strlen($this->config['image_fond']) > 0)
{
$f = Fichiers::storeFromBase64('Image_fond_admin.png', $this->config['image_fond']);
$this->config['image_fond'] = $f->id;
unset($f);
|