diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2019-08-18 03:33:11 +0200 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2019-08-18 03:33:11 +0200 |
commit | 50e367e56b367259a2e6fb29621c97e9b0fc9c5e (patch) | |
tree | 082c451342bc52deffb9c36eacd5df125de7bbb1 /app | |
parent | 11233711f4e16957fbe6f5c4f4399e269e87f68f (diff) | |
download | wcms-50e367e56b367259a2e6fb29621c97e9b0fc9c5e.tar.gz wcms-50e367e56b367259a2e6fb29621c97e9b0fc9c5e.zip |
interface home update
Diffstat (limited to 'app')
-rw-r--r-- | app/class/controllerhome.php | 12 | ||||
-rw-r--r-- | app/view/templates/backtopbar.php | 3 | ||||
-rw-r--r-- | app/view/templates/home.php | 366 | ||||
-rw-r--r-- | app/view/templates/homemenu.php | 49 | ||||
-rw-r--r-- | app/view/templates/homeopt.php | 292 |
5 files changed, 377 insertions, 345 deletions
diff --git a/app/class/controllerhome.php b/app/class/controllerhome.php index e177272..5a6d839 100644 --- a/app/class/controllerhome.php +++ b/app/class/controllerhome.php @@ -62,7 +62,17 @@ class Controllerhome extends Controller public function search() { if(isset($_POST['id']) && !empty($_POST['id'])) { - $this->routedirect('artread/', ['art' => $_POST['id']]); + if(isset($_POST['action'])) { + switch ($_POST['action']) { + case 'read': + $this->routedirect('artread/', ['art' => $_POST['id']]); + break; + + case 'edit': + $this->routedirect('artedit', ['art' => $_POST['id']]); + break; + } + } } else { $this->routedirect('home'); } diff --git a/app/view/templates/backtopbar.php b/app/view/templates/backtopbar.php index 91ccd89..8e15d14 100644 --- a/app/view/templates/backtopbar.php +++ b/app/view/templates/backtopbar.php @@ -3,7 +3,8 @@ <span id="search"> <form action="<?= $this->url('search') ?>" method="post"> <input type="text" name="id" id="id" placeholder="page id" required> -<input type="submit" value="go"> +<input type="submit" name="action" value="read"> +<?= $user->iseditor() ? '<input type="submit" name="action" value="edit">' : '' ?> </form> </span> diff --git a/app/view/templates/home.php b/app/view/templates/home.php index bf00301..f2d2668 100644 --- a/app/view/templates/home.php +++ b/app/view/templates/home.php @@ -10,196 +10,182 @@ <?php $this->insert('backtopbar', ['user' => $user, 'tab' => 'home']) ?> -<?php if($user->iseditor()) { ?> - -<main class="home"> - - - -</div> - - - - <?php $this->insert('homeopt', ['opt' => $opt, 'user' => $user]) ?> - -<div id="main"> - -<article id="main"> - -<h2>Pages (<?= count($table2) ?>)</h2> - - -<details id="import" class="hidephone"> - <summary>Import W JSON page file</summary> - <i>Upload page file as json</i> - <form action="<?= $this->url('artupload') ?>" method="post" enctype="multipart/form-data"> - <input type="file" name="pagefile" id="pagefile" accept=".json"> - <label for="pagefile">JSON Page file</label> - <input type="hidden" name="erase" value="0"> - <input type="hidden" name="datecreation" value="0"> - </br> - <input type="text" name="id" id="id" placeholder="new id (optionnal)"> - <label for="id">change ID</label> - </br> - <input type="checkbox" name="datecreation" id="datecreation" value="1"> - <label for="datecreation">Reset date creation as now</label> - </br> - <input type="checkbox" name="author" id="author" value="1"> - <label for="author">Reset author(s) as just you</label> - </br> - <input type="checkbox" name="erase" id="erase" value="1"> - <label for="erase">Replace if already existing</label> - </br> - <input type="submit" value="upload"> - </form> -</details> - -<details id="list" class="hidephone" <?= isset($optlist) ? 'open' : '' ?>> - <summary>Generate list</summary> - <i>Generate code to display a list of pages</i> - <form action="<?= $this->url('homequery') ?>" method="post"> - <input type="hidden" name="query" value="1"> - - <input type="hidden" name="description" value="0"> - <input type="checkbox" name="description" id="list_description" value="1" <?= isset($optlist) && $optlist->description() ? 'checked' : '' ?>> - <label for="list_description">Show description</label> - </br> - <input type="hidden" name="thumbnail" value="0"> - <input type="checkbox" name="thumbnail" id="list_thumbnail" value="1" <?= isset($optlist) && $optlist->thumbnail() ? 'checked' : '' ?>> - <label for="list_thumbnail">Show thumbnail</label> - </br> - <input type="hidden" name="date" value="0"> - <input type="checkbox" name="date" id="list_date" value="1" <?= isset($optlist) && $optlist->date() ? 'checked' : '' ?>> - <label for="list_date">Show date</label> - </br> - <input type="hidden" name="author" value="0"> - <input type="checkbox" name="author" id="list_author" value="1" <?= isset($optlist) && $optlist->author() ? 'checked' : '' ?>> - <label for="list_author">Show author(s)</label> - </br> - <select name="style" id="list_style"> - <option value="0">list</option> - <option value="1" <?= isset($optlist) && $optlist->style() == 1 ? 'selected' : '' ?>>div</option> - </select> - <input type="submit" value="generate"> - </form> - - <?php - if(isset($optlist)) { - echo '<code>' . $optlist->getcode() . '</code>'; - } - - ?> -</details> - - - -<form action="/massedit" method="post"> - -<div id="massedit"> - <!-- - <select name="massedit" required> - <option value="public">set as public</option> - <option value="private">set as private</option> - <option value="not published">set as not published</option> - <option value="erasetag">erase all tags</option> - <option value="erasetemplate">erase template</option> - <option value="delete">delete</option> - <option value="render">render</option> - </select> - - <input type="submit" name="massaction" value="do" onclick="confirmSubmit(event, 'Are you sure')" > - --> - - - - </div> - - - <table id="home2table"> - <thead> - <tr> - <th>x</th> - <th><a href="<?= $opt->getadress('id') ?>">id</a></th> - <th>edit</th> - <th>see</th> - <th class="delete" title="delete page">del</th> - <?php if($user->issupereditor()) { ?> - <th class="download" title="download page as json">dl</th> - <?php } if($columns['tag']) { ?> - <th class="tag"><a href="<?= $opt->getadress('tag') ?>">tag</a></th> - <?php } if($columns['title']) { ?> - <th class="title"><a href="<?= $opt->getadress('title') ?>">title</a></th> - <?php } if($columns['description']) { ?> - <th class="summary">summary</th> - <?php } if($columns['linkto']) { ?> - <th class="linkto"><a href="<?= $opt->getadress('linkto') ?>">to</a></th> - <?php } if($columns['linkfrom']) { ?> - <th class="linkfrom"><a href="<?= $opt->getadress('linkfrom') ?>">from</a></th> - <?php } if($columns['datemodif']) { ?> - <th class="datemodif"><a href="<?= $opt->getadress('datemodif') ?>">last modification</a></th> - <?php } if($columns['datecreation']) { ?> - <th class="datecreation"><a href="<?= $opt->getadress('datecreation') ?>">date of creation</a></th> - <?php } if($columns['date']) { ?> - <th class="date"><a href="<?= $opt->getadress('date') ?>">date</a></th> - <?php } if($columns['secure']) { ?> - <th class="secure"><a href="<?= $opt->getadress('secure') ?>">privacy</a></th> - <?php } if($columns['visitcount']) { ?> - <th class="visitcount"><a href="<?= $opt->getadress('visitcount') ?>">visit</a></th> - <?php } if($columns['editcount']) { ?> - <th class="editcount"><a href="<?= $opt->getadress('editcount') ?>">edit</a></th> - <?php } if($columns['affcount']) { ?> - <th class="affcount"><a href="<?= $opt->getadress('affcount') ?>">aff</a></th> - <?php } ?> - </tr> - </thead> - <tbody> - <?php foreach ($table2 as $item) { ?> - <tr> - <td><input type="checkbox" name="id[]" value="<?= $item->id() ?>" id="id_<?= $item->id() ?>"></td> - <td><label title="<?= $item->title() ?>" for="id_<?= $item->id() ?>"><?= $item->id() ?></label></td> - <td><a href="<?= $this->uart('artedit', $item->id()) ?>"><img src="<?= Model::iconpath() ?>edit.png" class="icon"></a></td> - <td><a href="<?= $this->uart('artread/', $item->id()) ?>" target="_blank"><img src="<?= Model::iconpath() ?>read.png" class="icon"></a></td> - <td class="delete"><a href="<?= $this->uart('artdelete', $item->id()) ?>" >✖</a></td> - <?php if($user->issupereditor()) { ?> - <td><a href="<?= $this->uart('artdownload', $item->id()) ?>" download><img src="<?= Model::iconpath() ?>download.png" class="icon"></a></td> - <?php } if($columns['tag']) { ?> - <td class="tag"><a title="<?= $item->tag('string') ?>"><?= $item->tag('sort') ?></a></td> - <?php } if($columns['title']) { ?> - <td class="title" title="<?= $item->title() ?>"><?= $item->title() ?></td> - <?php } if($columns['description']) { ?> - <td class="summary" title="<?= $item->description() ?>"><?= $item->description('short') ?></td> - <?php } if($columns['linkto']) { ?> - <td class="linkto"><a title="<?= $item->linkto('string') ?>" ><?= $item->linkto('sort') ?></a></td> - <?php } if($columns['linkfrom']) { ?> - <td class="linkfrom"><a title="<?= $item->linkfrom('string') ?>" ><?= $item->linkfrom('sort') ?></a></td> - <?php } if($columns['datemodif']) { ?> - <td class="datemodif"><?= $item->datemodif('hrdi') ?></td> - <?php } if($columns['datecreation']) { ?> - <td class="datecreation"><?= $item->datecreation('hrdi') ?></td> - <?php } if($columns['date']) { ?> - <td class="date"><?= $item->date('dmy') ?></td> - <?php } if($columns['secure']) { ?> - <td class="secure"><?= $item->secure('string') ?></td> - <?php } if($columns['visitcount']) { ?> - <td class="visitcount"><?= $item->visitcount() ?></td> - <?php } if($columns['editcount']) { ?> - <td class="editcount"><?= $item->editcount() ?></td> - <?php } if($columns['affcount']) { ?> - <td class="affcount"><?= $item->affcount() ?></td> - <?php } ?> - </tr> - - <?php }?> - </tbody> - </table> -</form> -</article> -</div> -</main> - -<?php } ?> - -<?php $this->insert('footer', ['footer' => $footer]) ?> + <?php if ($user->iseditor()) { ?> + + + + <?php $this->insert('homemenu', ['user' => $user]) ?> + + + <main class="home"> + + + <?php $this->insert('homeopt', ['opt' => $opt, 'user' => $user]) ?> + + <section class="pages"> + + <div class="block"> + + <h2>Pages (<?= count($table2) ?>)</h2> + + + <details id="list" class="hidephone" <?= isset($optlist) ? 'open' : '' ?>> + <summary>Generate list</summary> + <i>Generate code to display a list of pages</i> + <form action="<?= $this->url('homequery') ?>" method="post"> + <input type="hidden" name="query" value="1"> + + <input type="hidden" name="description" value="0"> + <input type="checkbox" name="description" id="list_description" value="1" <?= isset($optlist) && $optlist->description() ? 'checked' : '' ?>> + <label for="list_description">Show description</label> + </br> + <input type="hidden" name="thumbnail" value="0"> + <input type="checkbox" name="thumbnail" id="list_thumbnail" value="1" <?= isset($optlist) && $optlist->thumbnail() ? 'checked' : '' ?>> + <label for="list_thumbnail">Show thumbnail</label> + </br> + <input type="hidden" name="date" value="0"> + <input type="checkbox" name="date" id="list_date" value="1" <?= isset($optlist) && $optlist->date() ? 'checked' : '' ?>> + <label for="list_date">Show date</label> + </br> + <input type="hidden" name="author" value="0"> + <input type="checkbox" name="author" id="list_author" value="1" <?= isset($optlist) && $optlist->author() ? 'checked' : '' ?>> + <label for="list_author">Show author(s)</label> + </br> + <select name="style" id="list_style"> + <option value="0">list</option> + <option value="1" <?= isset($optlist) && $optlist->style() == 1 ? 'selected' : '' ?>>div</option> + </select> + <input type="submit" value="generate"> + </form> + + <?php + if (isset($optlist)) { + echo '<code>' . $optlist->getcode() . '</code>'; + } + + ?> + </details> + + + + <form action="/massedit" method="post"> + + </form> + + + <div class="scroll"> + + <table id="home2table"> + <thead> + <tr> + <th>x</th> + <th><a href="<?= $opt->getadress('id') ?>">id</a></th> + <th>edit</th> + <th>see</th> + <th class="delete" title="delete page">del</th> + <?php if ($user->issupereditor()) { ?> + <th class="download" title="download page as json">dl</th> + <?php } + if ($columns['tag']) { ?> + <th class="tag"><a href="<?= $opt->getadress('tag') ?>">tag</a></th> + <?php } + if ($columns['title']) { ?> + <th class="title"><a href="<?= $opt->getadress('title') ?>">title</a></th> + <?php } + if ($columns['description']) { ?> + <th class="summary">summary</th> + <?php } + if ($columns['linkto']) { ?> + <th class="linkto"><a href="<?= $opt->getadress('linkto') ?>">to</a></th> + <?php } + if ($columns['linkfrom']) { ?> + <th class="linkfrom"><a href="<?= $opt->getadress('linkfrom') ?>">from</a></th> + <?php } + if ($columns['datemodif']) { ?> + <th class="datemodif"><a href="<?= $opt->getadress('datemodif') ?>">last modification</a></th> + <?php } + if ($columns['datecreation']) { ?> + <th class="datecreation"><a href="<?= $opt->getadress('datecreation') ?>">date of creation</a></th> + <?php } + if ($columns['date']) { ?> + <th class="date"><a href="<?= $opt->getadress('date') ?>">date</a></th> + <?php } + if ($columns['secure']) { ?> + <th class="secure"><a href="<?= $opt->getadress('secure') ?>">privacy</a></th> + <?php } + if ($columns['visitcount']) { ?> + <th class="visitcount"><a href="<?= $opt->getadress('visitcount') ?>">visit</a></th> + <?php } + if ($columns['editcount']) { ?> + <th class="editcount"><a href="<?= $opt->getadress('editcount') ?>">edit</a></th> + <?php } + if ($columns['affcount']) { ?> + <th class="affcount"><a href="<?= $opt->getadress('affcount') ?>">aff</a></th> + <?php } ?> + </tr> + </thead> + <tbody> + <?php foreach ($table2 as $item) { ?> + <tr> + <td><input type="checkbox" name="id[]" value="<?= $item->id() ?>" id="id_<?= $item->id() ?>"></td> + <td><label title="<?= $item->title() ?>" for="id_<?= $item->id() ?>"><?= $item->id() ?></label></td> + <td><a href="<?= $this->uart('artedit', $item->id()) ?>"><img src="<?= Model::iconpath() ?>edit.png" class="icon"></a></td> + <td><a href="<?= $this->uart('artread/', $item->id()) ?>" target="_blank"><img src="<?= Model::iconpath() ?>read.png" class="icon"></a></td> + <td class="delete"><a href="<?= $this->uart('artdelete', $item->id()) ?>">✖</a></td> + <?php if ($user->issupereditor()) { ?> + <td><a href="<?= $this->uart('artdownload', $item->id()) ?>" download><img src="<?= Model::iconpath() ?>download.png" class="icon"></a></td> + <?php } + if ($columns['tag']) { ?> + <td class="tag"><a title="<?= $item->tag('string') ?>"><?= $item->tag('sort') ?></a></td> + <?php } + if ($columns['title']) { ?> + <td class="title" title="<?= $item->title() ?>"><?= $item->title() ?></td> + <?php } + if ($columns['description']) { ?> + <td class="summary" title="<?= $item->description() ?>"><?= $item->description('short') ?></td> + <?php } + if ($columns['linkto']) { ?> + <td class="linkto"><a title="<?= $item->linkto('string') ?>"><?= $item->linkto('sort') ?></a></td> + <?php } + if ($columns['linkfrom']) { ?> + <td class="linkfrom"><a title="<?= $item->linkfrom('string') ?>"><?= $item->linkfrom('sort') ?></a></td> + <?php } + if ($columns['datemodif']) { ?> + <td class="datemodif"><?= $item->datemodif('hrdi') ?></td> + <?php } + if ($columns['datecreation']) { ?> + <td class="datecreation"><?= $item->datecreation('hrdi') ?></td> + <?php } + if ($columns['date']) { ?> + <td class="date"><?= $item->date('dmy') ?></td> + <?php } + if ($columns['secure']) { ?> + <td class="secure"><?= $item->secure('string') ?></td> + <?php } + if ($columns['visitcount']) { ?> + <td class="visitcount"><?= $item->visitcount() ?></td> + <?php } + if ($columns['editcount']) { ?> + <td class="editcount"><?= $item->editcount() ?></td> + <?php } + if ($columns['affcount']) { ?> + <td class="affcount"><?= $item->affcount() ?></td> + <?php } ?> + </tr> + + <?php } ?> + </tbody> + </table> + </div> + + </div> + + </section> + </main> + + <?php $this->insert('footer', ['footer' => $footer]) ?> + + <?php } ?> </body> diff --git a/app/view/templates/homemenu.php b/app/view/templates/homemenu.php new file mode 100644 index 0000000..2dd486c --- /dev/null +++ b/app/view/templates/homemenu.php @@ -0,0 +1,49 @@ +<aside class="home"> + <details class="hidephone"> + <summary>Import page as file</summary> + <form action="<?= $this->url('artupload') ?>" method="post" enctype="multipart/form-data"> + <input type="file" name="pagefile" id="pagefile" accept=".json"> + <label for="pagefile">JSON Page file</label> + <input type="hidden" name="erase" value="0"> + <input type="hidden" name="datecreation" value="0"> + </br> + <input type="text" name="id" id="id" placeholder="new id (optionnal)"> + <label for="id">change ID</label> + </br> + <input type="checkbox" name="datecreation" id="datecreation" value="1"> + <label for="datecreation">Reset date creation as now</label> + </br> + <input type="checkbox" name="author" id="author" value="1"> + <label for="author">Reset author(s) as just you</label> + </br> + <input type="checkbox" name="erase" id="erase" value="1"> + <label for="erase">Replace if already existing</label> + </br> + <input type="submit" value="upload"> + </form> + </details> + + + + <details class="hidephone"> + <summary>Columns</summary> + <form action="<?= $this->url('homecolumns') ?>" method="post"> + <ul> + <?php + foreach (Model::COLUMNS as $col) { ?> + <li> + <input type="checkbox" name="columns[]" value="<?= $col ?>" id="col_<?= $col ?>" <?= in_array($col, $user->columns()) ? 'checked' : '' ?>> + <label for="col_<?= $col ?>"><?= $col ?></label> + </li> + <?php } ?> + </ul> + <input type="submit" value="update columns"> + </form> + </details> + + <span> + <a href="">Render All</a> + </span> + + +</aside>
\ No newline at end of file diff --git a/app/view/templates/homeopt.php b/app/view/templates/homeopt.php index 8b1b7d7..27d5625 100644 --- a/app/view/templates/homeopt.php +++ b/app/view/templates/homeopt.php @@ -1,154 +1,140 @@ -<div id="options"> -<h2>Options</h2> -<form action="./" method="get" > -<input type="submit" name="submit" value="filter"> -⬅<input type="submit" name="submit" value="reset"> - -<div id="optfield"> - -<fieldset><legend>Sort</legend> -<select name="sortby" id="sortby"> -<?php -foreach ($opt->col('array') as $key => $col) { - echo '<option value="' . $col . '" ' . ($opt->sortby() == $col ? "selected" : "") . '>' . $col . '</option>'; -} -?> -</select> -</br> -<input type="radio" id="asc" name="order" value="1" <?= $opt->order() == '1' ? "checked" : "" ?>/><label for="asc">ascending</label> -</br> -<input type="radio" id="desc" name="order" value="-1" <?= $opt->order() == '-1' ? "checked" : "" ?>/><label for="desc">descending</label> - -</fieldset> - -<fieldset><legend>Privacy</legend><ul> -<li><input type="radio" id="4" name="secure" value="4"<?= $opt->secure() == 4 ? "checked" : "" ?>/><label for="4">all</label></li> -<li><input type="radio" id="2" name="secure" value="2"<?= $opt->secure() == 2 ? "checked" : "" ?>/><label for="2">not published</label></li> -<li><input type="radio" id="1" name="secure" value="1"<?= $opt->secure() == 1 ? "checked" : "" ?>/><label for="1">private</label></li> -<li><input type="radio" id="0" name="secure" value="0"<?= $opt->secure() == 0 ? "checked" : "" ?>/><label for="0">public</label></li> -</ul></fieldset> - - <fieldset><legend>Tag</legend> - -<ul> - -<input type="radio" id="tag_OR" name="tagcompare" value="OR" ' . <?= $opt->tagcompare() == "OR" ? "checked" : "" ?> ><label for="tag_OR">OR</label> -<input type="radio" id="tag_AND" name="tagcompare" value="AND" <?= $opt->tagcompare() == "AND" ? "checked" : "" ?>><label for="tag_AND">AND</label> - -<?php -$in = false; -$out = false; -$limit = 1; -foreach ($opt->taglist() as $tagfilter => $count) { - - if ($count > $limit && $in == false) { - echo '<details open><summary>>' . $limit . '</summary>'; - $in = true; - } - if ($count == $limit && $in == true && $out == false) { - echo '</details><details><summary>' . $limit . '</summary>'; - $out = true; - } - - if (in_array($tagfilter, $opt->tagfilter())) { - - echo '<li><input type="checkbox" name="tagfilter[]" id="tag_' . $tagfilter . '" value="' . $tagfilter . '" checked /><label for="tag_' . $tagfilter . '">' . $tagfilter . ' (' . $count . ')</label></li>'; - } else { - echo '<li><input type="checkbox" name="tagfilter[]" id="tag_' . $tagfilter . '" value="' . $tagfilter . '" /><label for="tag_' . $tagfilter . '">' . $tagfilter . ' (' . $count . ')</label></li>'; - } -} -if ($in = true || $out = true) { - echo '</details>'; -} -?> - -</ul> - -</fieldset> - -<fieldset> - <legend>Author(s)</legend> - - <ul> - -<input type="radio" id="author_OR" name="authorcompare" value="OR" ' . <?= $opt->authorcompare() == "OR" ? "checked" : "" ?> ><label for="author_OR">OR</label> -<input type="radio" id="author_AND" name="authorcompare" value="AND" <?= $opt->authorcompare() == "AND" ? "checked" : "" ?>><label for="author_AND">AND</label> - -<?php -$in = false; -$out = false; -$limit = 1; -foreach ($opt->authorlist() as $authorfilter => $count) { - - if ($count > $limit && $in == false) { - echo '<details open><summary>>' . $limit . '</summary>'; - $in = true; - } - if ($count == $limit && $in == true && $out == false) { - echo '</details><details><summary>' . $limit . '</summary>'; - $out = true; - } - - if (in_array($authorfilter, $opt->authorfilter())) { - - echo '<li><input type="checkbox" name="authorfilter[]" id="author_' . $authorfilter . '" value="' . $authorfilter . '" checked /><label for="author_' . $authorfilter . '">' . $authorfilter . ' (' . $count . ')</label></li>'; - } else { - echo '<li><input type="checkbox" name="authorfilter[]" id="author_' . $authorfilter . '" value="' . $authorfilter . '" /><label for="author_' . $authorfilter . '">' . $authorfilter . ' (' . $count . ')</label></li>'; - } -} -if ($in = true || $out = true) { - echo '</details>'; -} -?> - -</ul> +<nav> + + <div class="block"> + + <h2>Options</h2> + + <div class="scroll"> + + <form action="./" method="get"> + <input type="submit" name="submit" value="filter"> + ⬅<input type="submit" name="submit" value="reset"> + + <div id="optfield"> + + <fieldset> + <legend>Sort</legend> + <select name="sortby" id="sortby"> + <?php + foreach ($opt->col('array') as $key => $col) { + echo '<option value="' . $col . '" ' . ($opt->sortby() == $col ? "selected" : "") . '>' . $col . '</option>'; + } + ?> + </select> + </br> + <input type="radio" id="asc" name="order" value="1" <?= $opt->order() == '1' ? "checked" : "" ?> /><label for="asc">ascending</label> + </br> + <input type="radio" id="desc" name="order" value="-1" <?= $opt->order() == '-1' ? "checked" : "" ?> /><label for="desc">descending</label> + + </fieldset> + + <fieldset> + <legend>Privacy</legend> + <ul> + <li><input type="radio" id="4" name="secure" value="4" <?= $opt->secure() == 4 ? "checked" : "" ?> /><label for="4">all</label></li> + <li><input type="radio" id="2" name="secure" value="2" <?= $opt->secure() == 2 ? "checked" : "" ?> /><label for="2">not published</label></li> + <li><input type="radio" id="1" name="secure" value="1" <?= $opt->secure() == 1 ? "checked" : "" ?> /><label for="1">private</label></li> + <li><input type="radio" id="0" name="secure" value="0" <?= $opt->secure() == 0 ? "checked" : "" ?> /><label for="0">public</label></li> + </ul> + </fieldset> + + <fieldset> + <legend>Tag</legend> + + <ul> + + <input type="radio" id="tag_OR" name="tagcompare" value="OR" ' . <?= $opt->tagcompare() == "OR" ? "checked" : "" ?> ><label for="tag_OR">OR</label> + <input type="radio" id="tag_AND" name="tagcompare" value="AND" <?= $opt->tagcompare() == "AND" ? "checked" : "" ?>><label for="tag_AND">AND</label> + + <?php + $in = false; + $out = false; + $limit = 1; + foreach ($opt->taglist() as $tagfilter => $count) { + + if ($count > $limit && $in == false) { + echo '<details open><summary>>' . $limit . '</summary>'; + $in = true; + } + if ($count == $limit && $in == true && $out == false) { + echo '</details><details><summary>' . $limit . '</summary>'; + $out = true; + } + + if (in_array($tagfilter, $opt->tagfilter())) { + + echo '<li><input type="checkbox" name="tagfilter[]" id="tag_' . $tagfilter . '" value="' . $tagfilter . '" checked /><label for="tag_' . $tagfilter . '">' . $tagfilter . ' (' . $count . ')</label></li>'; + } else { + echo '<li><input type="checkbox" name="tagfilter[]" id="tag_' . $tagfilter . '" value="' . $tagfilter . '" /><label for="tag_' . $tagfilter . '">' . $tagfilter . ' (' . $count . ')</label></li>'; + } + } + if ($in = true || $out = true) { + echo '</details>'; + } + ?> + + </ul> + + </fieldset> + + <fieldset> + <legend>Author(s)</legend> + + <ul> + + <input type="radio" id="author_OR" name="authorcompare" value="OR" ' . <?= $opt->authorcompare() == "OR" ? "checked" : "" ?>><label for="author_OR">OR</label> + <input type="radio" id="author_AND" name="authorcompare" value="AND" <?= $opt->authorcompare() == "AND" ? "checked" : "" ?>><label for="author_AND">AND</label> + + <?php + $in = false; + $out = false; + $limit = 1; + foreach ($opt->authorlist() as $authorfilter => $count) { + + if ($count > $limit && $in == false) { + echo '<details open><summary>>' . $limit . '</summary>'; + $in = true; + } + if ($count == $limit && $in == true && $out == false) { + echo '</details><details><summary>' . $limit . '</summary>'; + $out = true; + } + + if (in_array($authorfilter, $opt->authorfilter())) { + + echo '<li><input type="checkbox" name="authorfilter[]" id="author_' . $authorfilter . '" value="' . $authorfilter . '" checked /><label for="author_' . $authorfilter . '">' . $authorfilter . ' (' . $count . ')</label></li>'; + } else { + echo '<li><input type="checkbox" name="authorfilter[]" id="author_' . $authorfilter . '" value="' . $authorfilter . '" /><label for="author_' . $authorfilter . '">' . $authorfilter . ' (' . $count . ')</label></li>'; + } + } + if ($in = true || $out = true) { + echo '</details>'; + } + ?> + + </ul> + + </fieldset> + + <?php + if ($opt->invert() == 1) { + echo '<input type="checkbox" name="invert" value="1" id="invert" checked>'; + } else { + echo '<input type="checkbox" name="invert" value="1" id="invert">'; + } + echo '<label for="invert">invert</></br>'; + ?> + + </div> + + + <input type="submit" name="submit" value="filter"> + ⬅<input type="submit" name="submit" value="reset"> + + </form> + + </div> + + </div> -</fieldset> - - <?php - if ($opt->invert() == 1) { - echo '<input type="checkbox" name="invert" value="1" id="invert" checked>'; - } else { - echo '<input type="checkbox" name="invert" value="1" id="invert">'; - } - echo '<label for="invert">invert</></br>'; - ?> - -</div> - - -<input type="submit" name="submit" value="filter"> -⬅<input type="submit" name="submit" value="reset"> - -<?php if($user->isadmin()) { ?> - -</form> - -<h2>Columns</h2> - -<form action="<?= $this->url('homecolumns') ?>" method="post"> - -<ul> - -<?php - -foreach (Model::COLUMNS as $col) { - ?> - <li> - <input type="checkbox" name="columns[]" value="<?= $col ?>" id="col_<?= $col ?>" <?= in_array($col, $user->columns()) ? 'checked' : '' ?>> - <label for="col_<?= $col ?>"><?= $col ?></label> - </li> - <?php -} - -?> - -</ul> - -<input type="submit" value="update columns"> - -</form> - -<?php } ?> - -</div> +</nav>
\ No newline at end of file |