diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2018-12-22 09:01:20 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2018-12-22 09:01:20 +0100 |
commit | 0e95eb5121b2f4be63591705c367a0de10046133 (patch) | |
tree | fd389a73fffce6f1b3566bba7c07d02f07c196f7 /app/class | |
parent | 7f94fccda33383f3a7be364cf0c316e7ed2c61bb (diff) | |
download | wcms-0e95eb5121b2f4be63591705c367a0de10046133.tar.gz wcms-0e95eb5121b2f4be63591705c367a0de10046133.zip |
feature: linkto calc during render
Diffstat (limited to 'app/class')
-rw-r--r-- | app/class/art2.php | 2 | ||||
-rw-r--r-- | app/class/controllerart.php | 1 | ||||
-rw-r--r-- | app/class/modelrender.php | 11 |
3 files changed, 14 insertions, 0 deletions
diff --git a/app/class/art2.php b/app/class/art2.php index 8bf2729..6f2d4d8 100644 --- a/app/class/art2.php +++ b/app/class/art2.php @@ -344,6 +344,8 @@ class Art2 $linkto = $this->linkto; } elseif ($option == 'sort') { return count($this->linkto); + } elseif ($option == 'string') { + return implode(', ', $this->linkto); } return $linkto; diff --git a/app/class/controllerart.php b/app/class/controllerart.php index ee99b6a..8511243 100644 --- a/app/class/controllerart.php +++ b/app/class/controllerart.php @@ -79,6 +79,7 @@ class Controllerart extends Controller $this->art->setrenderhead($head); $this->art->setdaterender($now); $this->art->setlinkfrom($this->renderengine->linkfrom()); + $this->art->setlinkto($this->renderengine->linkto()); return ['head' => $head, 'body' => $body]; diff --git a/app/class/modelrender.php b/app/class/modelrender.php index e24e067..8139d6d 100644 --- a/app/class/modelrender.php +++ b/app/class/modelrender.php @@ -466,6 +466,17 @@ class Modelrender extends Modelart return $linkfrom; } + public function linkto() + { + $linkto = []; + foreach ($this->artlist as $art) { + if(in_array($this->art->id(), $art->linkfrom())) { + $linkto[] = $art->id(); + } + } + return $linkto; + } + |