From 5019671cf2bba2202c0024f3bd309fe674251226 Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Thu, 26 Mar 2020 18:07:28 +0100 Subject: sort media by date and ext fix #67 --- app/class/Medialist.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'app/class/Medialist.php') diff --git a/app/class/Medialist.php b/app/class/Medialist.php index 2141d40..ca42f4b 100644 --- a/app/class/Medialist.php +++ b/app/class/Medialist.php @@ -31,7 +31,6 @@ class Medialist extends Item /** @var string display the file name of the file */ protected $filename = 0; - const SORT_BY_FILTER = ['id', 'size', 'type', 'date']; const TYPES = ['image', 'sound', 'video', 'other']; @@ -95,7 +94,7 @@ class Medialist extends Item */ public function getsortbyadress(string $sortby) : string { - if(!in_array($sortby, self::SORT_BY_FILTER)) { + if(!in_array($sortby, Model::MEDIA_SORTBY)) { $sortby = 'id'; } if ($this->sortby === $sortby) { @@ -201,7 +200,7 @@ class Medialist extends Item public function setsortby(string $sortby) { - if (in_array($sortby, self::SORT_BY_FILTER)) { + if (in_array($sortby, Model::MEDIA_SORTBY)) { $this->sortby = $sortby; } } -- cgit v1.2.3