]> git.plutz.net Git - shellwiki/commitdiff
search form in wikiform macro
authorPaul Hänsch <paul@plutz.net>
Fri, 22 Sep 2023 16:00:03 +0000 (18:00 +0200)
committerPaul Hänsch <paul@plutz.net>
Fri, 22 Sep 2023 16:00:03 +0000 (18:00 +0200)
macros/wikiform

index fe3dbd11a449b364bd218fce2f305207cd928fe3..be6e4be0dae26c19e0122f82f34417d279b86aa9 100755 (executable)
@@ -35,4 +35,15 @@ case $action in
   settings)
     w_user_update |"$_EXEC/cgilite/html-sh.sed"
     ;;
+  search)
+    if [ "$LANGUAGE_DEFAULT" ]; then
+      printf '<form class="search" method="GET" action="./:%s/[search]">
+        <input class="search" placeholder="%s" name="q" value=""><button type="submit" class="search">%s</button>
+      </form>' "$LANGUAGE" "$(_ Search)" "$(_ Search)"
+    else
+      printf '<form class="search" method="GET" action="./[search]">
+        <input class="search" placeholder="%s" name="q" value=""><button type="submit" class="search">%s</button>
+      </form>' "$(_ Search)" "$(_ Search)"
+    fi
+    ;;
 esac