From: Paul Hänsch Date: Sun, 8 Dec 2019 22:14:24 +0000 (+0100) Subject: helper functions for checking item selections X-Git-Url: https://git.plutz.net/?p=confetti;a=commitdiff_plain;h=f697cfeeaa6196451b1ddbb2ec682058d74fe680;ds=sidebyside helper functions for checking item selections --- diff --git a/index.cgi b/index.cgi index 43abf5d..093a5c4 100755 --- a/index.cgi +++ b/index.cgi @@ -18,6 +18,9 @@ ACTION="$(GET a)" message="$(COOKIE message)" [ "$message" ] && SET_COOKIE 0 message='' +checked(){ [ "$1" = "$2" ] || [ "$1" -eq "$2" ] && printf 'checked="checked"' 2>/dev/null; } +selected(){ [ "$1" = "$2" ] || [ "$1" -eq "$2" ] && printf 'selected="selected"' 2>/dev/null; } + yield_page() { local class="$1" style="$2" printf 'Content-Type: text/html; charset=utf-8\r\n\r\n'