diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2018-12-05 19:34:23 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2018-12-05 19:34:23 +0100 |
commit | 1d463145d3a1dae2ea91f75d4d854ea0ea4c431e (patch) | |
tree | 057057b69d22dbeb70259b65166b8e1247310c2a /app | |
parent | 7fb607b48c181512b31f52a7ef7e302f331ec18d (diff) | |
download | wcms-1d463145d3a1dae2ea91f75d4d854ea0ea4c431e.tar.gz wcms-1d463145d3a1dae2ea91f75d4d854ea0ea4c431e.zip |
home table sort
Diffstat (limited to 'app')
-rw-r--r-- | app/class/modelhome.php | 9 | ||||
-rw-r--r-- | app/class/opt.php | 26 | ||||
-rw-r--r-- | app/view/templates/home.php | 16 |
3 files changed, 42 insertions, 9 deletions
diff --git a/app/class/modelhome.php b/app/class/modelhome.php index 3ff72c7..5d16062 100644 --- a/app/class/modelhome.php +++ b/app/class/modelhome.php @@ -12,20 +12,13 @@ class Modelhome extends Modeldb $opt = new Opt(Art2::classvarlist()); $opt->setcol(['id', 'tag', 'linkfrom', 'linkto', 'description', 'title', 'datemodif', 'datecreation', 'secure']); - //$table = $listmanager->getlisteropt($opt); - //$listmanager->listcalclinkfrom($table); $opt->settaglist($table); $opt->submit(); - - return $opt; } - public function optupdate() - { - - } + public function table2($table, $opt) diff --git a/app/class/opt.php b/app/class/opt.php index f1cb4df..9d23c3f 100644 --- a/app/class/opt.php +++ b/app/class/opt.php @@ -86,6 +86,32 @@ class Opt } } + public function getadress($sortby) + { + if(in_array($sortby, $this->col)) { + if($this->sortby() === $sortby) { + $order = $this->order * -1; + } else { + $order = $this->order; + } + $adress = '?sortby=' . $sortby; + $adress .= '&order=' . $order; + $adress .= '&secure=' . $this->secure; + $adress .= '&tagcompare=' . $this->tagcompare; + foreach ($this->tagfilter as $tag) { + $adress .= '&tagfilter[]=' . $tag; + } + if($this->invert == 1) { + $adress .= '&invert=1'; + } + $adress .= '&submit=filter'; + + return $adress; + } else { + returnfalse; + } + } + // _______________________________________________ G E T _______________________________________________ diff --git a/app/view/templates/home.php b/app/view/templates/home.php index 87cdb8d..ac4f158 100644 --- a/app/view/templates/home.php +++ b/app/view/templates/home.php @@ -63,7 +63,21 @@ <table id="home2table"> - <tr><th>x</th><th>id</th><th>edit</th><th>see</th><th>del</th><th>log</th><th>tag</th><th>summary</th><th>↘ to</th><th>↗ from</th><th>last modification</th><th>date of creation</th><th>privacy</th></tr> + <tr> + <th>x</th> + <th><a href="<?= $opt->getadress('id') ?>">id</a></th> + <th>edit</th> + <th>see</th> + <th>del</th> + <th>log</th> + <th><a href="<?= $opt->getadress('tag') ?>">tag</a></th> + <th>summary</th> + <th><a href="<?= $opt->getadress('linkto') ?>">link to</a></th> + <th><a href="<?= $opt->getadress('linkfrom') ?>">linkfrom</a></th> + <th><a href="<?= $opt->getadress('datemodif') ?>">last modification</a></th> + <th><a href="<?= $opt->getadress('datecreation') ?>">date of creation</a></th> + <th><a href="<?= $opt->getadress('secure') ?>">privacy</a></th> + </tr> <?php foreach ($table2 as $item) { ?> <tr> <td><input type="checkbox" name="id[]" value="<?= $item->id() ?>" id="<?= $item->id() ?>"></td> |