lbid="$(HTML "cat_${n}_(none)")"
printf '[input .and type=checkbox name=and id="and_%i" %s][label for="and_%i" +and
][fieldset .select
- [input .pol type="radio" name=pol_%i %s id="pol_pos_%i"][label for=pol_pos_%i Any]
- [input .pol type="radio" name=pol_%i %s id="pol_neg_%i"][label for=pol_neg_%i None]
+ [radio "pol_%i" "pos" .pol %s #pol_pos_%i"][label for=pol_pos_%i Any]
+ [radio "pol_%i" "neg" .pol %s #pol_neg_%i"][label for=pol_neg_%i None]
[label .head Category:]' \
- $n "$([ "$f" ] && printf 'checked="checked"')" $n \
- $n "$([ "$f" -a ! "${f%%~*}" ] || printf 'checked="checked"')" $n $n \
- $n "$([ "$f" -a ! "${f%%~*}" ] && printf 'checked="checked"')" $n $n
+ $n "$([ "$f" ] && printf 'checked')" $n \
+ $n "$([ "$f" -a ! "${f%%~*}" ] || printf 'checked')" $n $n \
+ $n "$([ "$f" -a ! "${f%%~*}" ] && printf 'checked')" $n $n
f="|${f#~}|"
printf '*\n%s\n' "$w_tagcategories" \
| while read -r category; do
- lbid="$(HTML "cat_${n}_${category}")"
- printf '[input .cat type=radio %s name="cat_%i" id="%s"][label for="%s" %s]
- [select name=tag_%s size=10 multiple="multiple"' \
- "$([ ! "${f%%*|${category}:*}" -o ! "${category%\*}" ] && printf 'checked="checked"')" \
- $n "$lbid" "$lbid" "$(HTML "$category")" $n
+ catn="$(HTML "$category")"
+ lbid="cat_${n}_${catn}"
+ printf '[radio "cat_%i" "%s" .cat id="%s" %s][label for="%s" %s]
+ [select name=tag_%s size=10 multiple' \
+ $n "$catn" "$lbid" \
+ "$([ ! "${f%%*|${category}:*}" -o ! "${category%\*}" ] && printf 'checked')" \
+ "$lbid" "$catn" $n
printf %s "$w_tags" \
| { [ "$category" = '*' ] && grep -vF ':' || grep -wF "${category}"; } \
[ ! "$tag" ] && continue
tg="$(HTML "$tag")"; tn="${tg#*:}"
printf '[option %s value="%s" %s]' \
- "$([ ! "${f%%*|${tag}|*}" ] && printf 'selected="selected"')" \
+ "$([ ! "${f%%*|${tag}|*}" ] && printf 'selected')" \
"$tg" "$tn"
done
printf '\n]'