aboutsummaryrefslogtreecommitdiff
path: root/app/class/media.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2019-08-07 13:18:45 +0200
committervincent-peugnet <v.peugnet@free.fr>2019-08-07 13:18:45 +0200
commitce8c4c5e7d918d81e09710d7c89a45d36a80c32a (patch)
tree9ebe2fa7a2d89ebd3da16f229df3802041295b26 /app/class/media.php
parent7ccb591697227fcc77125e6b6fbe33f9fbe13ca4 (diff)
downloadwcms-ce8c4c5e7d918d81e09710d7c89a45d36a80c32a.tar.gz
wcms-ce8c4c5e7d918d81e09710d7c89a45d36a80c32a.zip
new medialist parse synthax + media file id bugfix
Diffstat (limited to 'app/class/media.php')
-rw-r--r--app/class/media.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/app/class/media.php b/app/class/media.php
index cd6c6f0..4b947fc 100644
--- a/app/class/media.php
+++ b/app/class/media.php
@@ -13,7 +13,7 @@ class Media
const IMAGE = array('jpg', 'jpeg', 'gif', 'png');
const SOUND = array('mp3', 'flac');
- const VIDEO = array('mp4', 'mov', 'avi');
+ const VIDEO = array('mp4', 'mov', 'avi', 'mkv');
@@ -98,9 +98,13 @@ class Media
return $this->type;
}
- public function size()
+ public function size($display = 'binary')
{
- return $this->size;
+ if($display == 'hr') {
+ return readablesize($this->size);
+ } else {
+ return $this->size;
+ }
}
public function width()
@@ -122,8 +126,8 @@ class Media
public function setid($id)
{
- if (strlen($id) < 40 and is_string($id)) {
- $this->id = strip_tags(strtolower($id));
+ if (is_string($id)) {
+ $this->id = $id;
}
}