aboutsummaryrefslogtreecommitdiff
path: root/app/view/templates/homeopt.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2019-01-30 15:56:04 +0100
committervincent-peugnet <v.peugnet@free.fr>2019-01-30 15:56:04 +0100
commit396a5776cd043e899e4897ec50fc8edc52585512 (patch)
tree51714a3aa981e698f4573f0ce54e22e1dc8338a8 /app/view/templates/homeopt.php
parent3309bd722454fa8696ce2415075f401e444c9910 (diff)
downloadwcms-396a5776cd043e899e4897ec50fc8edc52585512.tar.gz
wcms-396a5776cd043e899e4897ec50fc8edc52585512.zip
author filter home
Diffstat (limited to 'app/view/templates/homeopt.php')
-rw-r--r--app/view/templates/homeopt.php48
1 files changed, 45 insertions, 3 deletions
diff --git a/app/view/templates/homeopt.php b/app/view/templates/homeopt.php
index 4008a71..36b44c5 100644
--- a/app/view/templates/homeopt.php
+++ b/app/view/templates/homeopt.php
@@ -28,8 +28,9 @@ foreach ($opt->col('array') as $key => $col) {
<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>
-
+ <fieldset><legend>Tag</legend>
+
+<ul>
<input type="radio" id="OR" name="tagcompare" value="OR" ' . <?= $opt->tagcompare() == "OR" ? "checked" : "" ?> ><label for="OR">OR</label>
<input type="radio" id="AND" name="tagcompare" value="AND" <?= $opt->tagcompare() == "AND" ? "checked" : "" ?>><label for="AND">AND</label>
@@ -61,7 +62,48 @@ if ($in = true || $out = true) {
}
?>
-</ul></fieldset>
+</ul>
+
+</fieldset>
+
+<fieldset>
+ <legend>Author(s)</legend>
+
+ <ul>
+
+<input type="radio" id="OR" name="authorcompare" value="OR" ' . <?= $opt->authorcompare() == "OR" ? "checked" : "" ?> ><label for="OR">OR</label>
+<input type="radio" id="AND" name="authorcompare" value="AND" <?= $opt->authorcompare() == "AND" ? "checked" : "" ?>><label for="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="tag_' . $authorfilter . '" value="' . $authorfilter . '" checked /><label for="tag_' . $authorfilter . '">' . $authorfilter . ' (' . $count . ')</label></li>';
+ } else {
+ echo '<li><input type="checkbox" name="authorfilter[]" id="tag_' . $authorfilter . '" value="' . $authorfilter . '" /><label for="tag_' . $authorfilter . '">' . $authorfilter . ' (' . $count . ')</label></li>';
+ }
+}
+if ($in = true || $out = true) {
+ echo '</details>';
+}
+?>
+
+</ul>
+
+</fieldset>
<?php
if ($opt->invert() == 1) {