From a66df8c97f4aa70977b25478fc3b6413ebd9b9db Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Thu, 23 Jan 2020 01:18:33 +0100 Subject: new media types --- app/class/Medialist.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/class/Medialist.php') diff --git a/app/class/Medialist.php b/app/class/Medialist.php index b208fef..2c17fa0 100644 --- a/app/class/Medialist.php +++ b/app/class/Medialist.php @@ -20,7 +20,7 @@ class Medialist protected $order = 1; /** @var array list of media type to display */ - protected $type = ['image', 'sound', 'video', 'other']; + protected $type = []; /** @var int display media contents*/ protected $display = 1; @@ -42,6 +42,7 @@ class Medialist public function __construct(array $datas = []) { + $this->type = Model::mediatypes(); $this->hydrate($datas); } @@ -226,7 +227,7 @@ class Medialist public function settype($type) { if(is_array($type)) { - $this->type = array_intersect(self::TYPES, array_unique($type)); + $this->type = array_intersect(Model::mediatypes(), array_unique($type)); } } } -- cgit v1.2.3