- printf '[td [input type=radio id="%s_%s" name="%s" value="%s" %s][label for="%s_%s" . %i]]' \
- "$input" "$date" "$input" "$date" "$(checked $dom $selected)" "$input" "$date" "$dom"
- [ $dow = 0 ] && printf ']\n'
- [ $dow = 0 ] && V=$(( V % 53 + 1))
+ case $type in
+ none)
+ printf '[td [label %s . %i]]' \
+ "$(checked $dom $selected)" "$dom"
+ ;;
+ multiple)
+ printf '[td [input type=checkbox id="%s_%s" name="%s" value="%s" %s][label for="%s_%s" . %i]]' \
+ "$input" "$date" "$input" "$date" "$(checked $dom $selected)" "$input" "$date" "$dom"
+ ;;
+ submit)
+ [ "$(checked $dom $selected)" ] \
+ && printf '[td [submit "%s_remove" "%s" . %i][hidden "%s" "%s"]]' "$input" "$date" "$dom" "$input" "$date" \
+ || printf '[td [submit "%s_add" "%s" . %i]]' "$input" "$date" "$dom"
+ ;;
+ select|*)
+ printf '[td [input type=radio id="%s_%s" name="%s" value="%s" %s][label for="%s_%s" . %i]]' \
+ "$input" "$date" "$input" "$date" "$(checked $dom $selected)" "$input" "$date" "$dom"
+ ;;
+ esac
+ if [ $dow = 0 ]; then
+ printf ']\n'
+ V=$((V + 1))
+ [ $m = 1 -a $V -ge 53 ] && V=1
+ fi