add watermark on zoom, update display of article nature on shelve (change icon to text

This commit is contained in:
ludo
2024-02-04 22:09:53 +01:00
parent 4c6f9b3b61
commit 308b6cb349
9 changed files with 93 additions and 58 deletions

View File

@@ -16,52 +16,57 @@ trait Imageable
return Medias::getImages(self::get($id));
}
public static function getThumb($image, $with_undefined = true)
public static function getThumb($image, $undefined = true)
{
$src = self::getThumbSrc($image, $with_undefined);
$src = self::getThumbSrc($image, $undefined);
return $src ? "<img src='{$src}'>" : '';
}
public static function getThumbSrc($image, $with_undefined = true)
public static function getThumbSrc($image, $undefined = true)
{
return $image ? Medias::getThumbSrc($image) : ($with_undefined ? '/img/visuel-non-disponible.jpg' : '');
return $image ? Medias::getThumbSrc($image) : ($undefined ? '/img/visuel-non-disponible.jpg' : '');
}
public static function getPreview($image, $with_undefined = true)
public static function getPreview($image, $undefined = true)
{
$src = self::getPreviewSrc($image, $with_undefined);
$src = self::getPreviewSrc($image, $undefined);
return $src ? "<img src='{$src}' class='img-fluid'>" : '';
}
public static function getPreviewSrc($image, $with_undefined = true)
public static function getPreviewSrc($image, $undefined = true)
{
return $image ? Medias::getPreviewSrc($image) : ($with_undefined ? self::getUnknown() : '');
return $image ? Medias::getPreviewSrc($image) : ($undefined ? self::getUnknown() : '');
}
public static function getNormal($image, $with_undefined = true)
public static function getNormal($image, $undefined = true)
{
$src = self::getNormalSrc($image, $with_undefined);
$src = self::getNormalSrc($image, $undefined);
return $src ? "<img src='{$src}'>" : '';
}
public static function getNormalSrc($image, $with_undefined = true)
public static function getNormalSrc($image, $undefined = true)
{
return $image ? Medias::getNormalSrc($image) : ($with_undefined ? self::getUnknown() : '');
return $image ? Medias::getNormalSrc($image) : ($undefined ? self::getUnknown() : '');
}
public static function getImage($image, $with_undefined = true)
public static function getZoomSrc($image, $undefined = true)
{
$src = self::getImageSrc($image, $with_undefined);
return $image ? Medias::getZoomSrc($image) : ($undefined ? self::getUnknown() : '');
}
public static function getImage($image, $undefined = true)
{
$src = self::getImageSrc($image, $undefined);
return $src ? "<img src='{$src}' class='img-fluid'>" : '';
}
public static function getImageSrc($image, $with_undefined = true)
public static function getImageSrc($image, $undefined = true)
{
return $image ? Medias::getImageSrc($image) : ($with_undefined ? self::getUnknown() : '');
return $image ? Medias::getImageSrc($image) : ($undefined ? self::getUnknown() : '');
}
public static function getUnknown()