diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2020-03-26 18:07:28 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2020-03-26 18:07:28 +0100 |
commit | 5019671cf2bba2202c0024f3bd309fe674251226 (patch) | |
tree | 720aa7ca861f9ccc3216a8fff9e730a26a8eab6c /app/class/Medialist.php | |
parent | 633076d7c9275b33b722d9a7989e63839f8c38d2 (diff) | |
download | wcms-5019671cf2bba2202c0024f3bd309fe674251226.tar.gz wcms-5019671cf2bba2202c0024f3bd309fe674251226.zip |
sort media by date and ext fix #67
Diffstat (limited to 'app/class/Medialist.php')
-rw-r--r-- | app/class/Medialist.php | 5 |
1 files changed, 2 insertions, 3 deletions
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; } } |