$nb = count($list);
usort($list, function ($a, $b) {
- if ($a['page'] == $b['page']) {
+ if (!isset($a['page']) || !isset($b['page']) || $a['page'] == $b['page']) {
$ea = explode('-', $a['id']);
$eb = explode('-', $b['id']);
if (is_numeric($ea[0]) && is_numeric($eb[0])) {
$this->config->product_zoom_references = [];
foreach ($this->config->basketReferences as $ref => $data) {
- $this->config->product_zoom_references[$ref] = [$ref];
+ $this->config->set('product_zoom_references.' . $ref, [$ref]);
}
}
}
$vdest = 'data/commerce/opt/' . $d;
$this->vdir->copy($dest, $vdest);
- $this->config->basketReferences[$ref]['Image'] = $vdest;
+ $this->config->set('basketReferences.' . $ref . '.Image', $vdest);
}
foreach ($links as $link) {
for ($i = 1; $i <= 5; $i++) {
$ic = $this->fluidbookSettings->{'navExtraIcon' . $i};
- if ($ic != '') {
- if (stristr($ic, '.svg')) {
- $e = explode('.', $ic);
- $sname = 'external-' . $e[0];
- $this->addSVGSymbolFromFile($this->wdir . '/' . $ic, $sname);
- $this->config->{'navExtraIcon' . $i} = $sname;
- } else if (stristr($ic, '.')) {
- $this->vdir->copy($this->wdir . '/' . $ic, 'data/images/' . $ic);
- }
+ if (!$ic) {
+ continue;
+ }
+ $f = $this->wdir . '/' . $ic;
+
+ if (!stristr($ic, '.')) {
+ continue;
+ }
+
+ if (!file_exists($f)) {
+ $this->addIssue(FluidbookHealthIssues::TYPE_MISSING_FILE, ['path', $f]);
+ continue;
+ }
+
+ if (stristr($ic, '.svg')) {
+ $e = explode('.', $ic);
+ $sname = 'external-' . $e[0];
+ $this->addSVGSymbolFromFile($f, $sname);
+ $this->config->{'navExtraIcon' . $i} = $sname;
+ } else {
+ $this->vdir->copy($f, 'data/images/' . $ic);
}
}
}
protected function addSVGSymbolFromFile($svg, $symbolName)
{
+
$svg = SVGTools::optimizeSVG($svg);
$xml = simplexml_load_string(file_get_contents($svg));
return [
static::TYPE_MISSING_FILE =>
[
- 'summary' => __('Erreur 404'),
+ 'summary' => __('Erreur 404') . ', ' . __('Fichier introuvable'),
'criticality' => self::CRIT_ERROR,
'text' => __('Le chemin ":path" est introuvable'),