diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2020-01-29 03:33:22 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2020-01-29 03:33:22 +0100 |
commit | 5aa781242e42c95c6f2e04a30510d853a89fa944 (patch) | |
tree | e1096011f9473a380240c40a01b610e37097e88f /app/class | |
parent | cc73b11de5d9185825e058d1914d65bb8703077d (diff) | |
download | wcms-5aa781242e42c95c6f2e04a30510d853a89fa944.tar.gz wcms-5aa781242e42c95c6f2e04a30510d853a89fa944.zip |
new feature : authors column
Diffstat (limited to 'app/class')
-rw-r--r-- | app/class/Model.php | 2 | ||||
-rw-r--r-- | app/class/Modelhome.php | 2 | ||||
-rw-r--r-- | app/class/Opt.php | 4 | ||||
-rw-r--r-- | app/class/Page.php | 2 |
4 files changed, 6 insertions, 4 deletions
diff --git a/app/class/Model.php b/app/class/Model.php index f48b555..655de9f 100644 --- a/app/class/Model.php +++ b/app/class/Model.php @@ -58,7 +58,7 @@ abstract class Model '' => 'other' ]; - const COLUMNS = ['id', 'title', 'description', 'tag', 'date', 'datemodif', 'datecreation', 'secure', 'linkfrom', 'linkto', 'visitcount', 'affcount', 'editcount']; + const COLUMNS = ['id', 'title', 'description', 'tag', 'date', 'datemodif', 'datecreation', 'secure', 'authors', 'linkfrom', 'linkto', 'visitcount', 'affcount', 'editcount']; const TEXT_ELEMENTS = ['header', 'nav', 'main', 'aside', 'footer']; diff --git a/app/class/Modelhome.php b/app/class/Modelhome.php index f12f7d3..701eb73 100644 --- a/app/class/Modelhome.php +++ b/app/class/Modelhome.php @@ -13,7 +13,7 @@ class Modelhome extends Modelpage { $opt = new Opt(Page::classvarlist()); - $opt->setcol(['id', 'tag', 'linkfrom', 'linkto', 'description', 'title', 'datemodif', 'datecreation', 'date', 'secure', 'visitcount', 'editcount', 'affcount']); + $opt->setcol(['id', 'tag', 'linkfrom', 'linkto', 'description', 'title', 'datemodif', 'datecreation', 'date', 'secure', 'authors', 'visitcount', 'editcount', 'affcount']); $opt->settaglist($table); $opt->setauthorlist($table); $opt->submit(); diff --git a/app/class/Opt.php b/app/class/Opt.php index 426328f..6697c63 100644 --- a/app/class/Opt.php +++ b/app/class/Opt.php @@ -244,7 +244,7 @@ class Opt extends Item public function setsortby($sortby) { - if (is_string($sortby) && in_array($sortby, $this->pagevarlist)) { + if (is_string($sortby) && in_array($sortby, $this->pagevarlist) && in_array($sortby, Model::COLUMNS)) { $this->sortby = strtolower(strip_tags($sortby)); } } @@ -337,7 +337,7 @@ class Opt extends Item public function setcol($col) { if (is_array($col)) { - $this->col = array_intersect($this->pagevarlist(), $col); + $this->col = array_intersect($this->pagevarlist, $col); } } diff --git a/app/class/Page.php b/app/class/Page.php index 82e61c1..7475b6b 100644 --- a/app/class/Page.php +++ b/app/class/Page.php @@ -399,6 +399,8 @@ class Page extends Dbitem return implode(', ', $this->authors); } elseif ($type == 'array') { return $this->authors; + } elseif ($type == 'sort') { + return count($this->authors); } } |