aboutsummaryrefslogtreecommitdiff
path: root/app/class
diff options
context:
space:
mode:
Diffstat (limited to 'app/class')
-rw-r--r--app/class/Media.php2
-rw-r--r--app/class/Medialist.php5
-rw-r--r--app/class/Model.php8
-rw-r--r--app/class/Modelmedia.php4
4 files changed, 11 insertions, 8 deletions
diff --git a/app/class/Media.php b/app/class/Media.php
index ad36b8e..f29d2c9 100644
--- a/app/class/Media.php
+++ b/app/class/Media.php
@@ -174,7 +174,7 @@ class Media extends Item
}
}
- public function date($option = 'string')
+ public function date($option = 'date')
{
return $this->datetransform('date', $option);
}
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;
}
}
diff --git a/app/class/Model.php b/app/class/Model.php
index 9e66af4..ea75da8 100644
--- a/app/class/Model.php
+++ b/app/class/Model.php
@@ -21,6 +21,14 @@ abstract class Model
const DATABASE_DIR = '.' . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR;
const PAGES_DIR = self::DATABASE_DIR . 'pages' . DIRECTORY_SEPARATOR;
+ const MEDIA_SORTBY = [
+ 'id' => 'id',
+ 'size' => 'size',
+ 'type' => 'type',
+ 'date' => 'date',
+ 'extension' => 'extension'
+ ];
+
const MAP_LAYOUTS = [
'cose' => 'cose',
'cose-bilkent' => 'cose-bilkent',
diff --git a/app/class/Modelmedia.php b/app/class/Modelmedia.php
index 567e659..079a5f7 100644
--- a/app/class/Modelmedia.php
+++ b/app/class/Modelmedia.php
@@ -5,10 +5,6 @@ namespace Wcms;
class Modelmedia extends Model
{
- const MEDIA_SORTBY = ['id', 'size', 'type'];
-
-
-
/**
* Get the Media Object
*