-w_tagging(){
- printf '[div #multitag [input type="hidden" name="ref" value="%s"]' "$(HTML "$REQUEST_URI")"
- printf '[a href="#" Hide][br]'
- tags="$(find "$_DATA/$ITEM" -path '*/.index/meta' -exec cut -f4 '{}' + \
- | cut -d= -f2- |tr , '\n' | sort -u)"
- tags="$(UNSTRING "$tags")"
-
- printf '[fieldset [legend %s:][select name=tag size=4 multiple' "Tags"
- printf %s "$tags" |grep -vF ":" |grep -vxF '' \
- | while read -r tag; do
- printf '[option value="%s" %s]' "$(HTML "$tag")" "$(HTML "$tag")"
- done
- printf ']]'
-
- printf %s "$tags" |cut -sd: -f1 |sort -u \
- | while read -r category; do
- printf '[fieldset [legend %s:][select name=tag size=4 multiple' "$(HTML "$category")"
- printf %s "$tags" |grep -wF "${category}" \
- | while read -r tag; do
- printf '[option value="%s" %s]' "$(HTML "$tag")" "$(HTML "${tag#*:}")"
- done
- printf ']]'
- done
-
- printf '[fieldset [legend New:][textarea name=newtag\n][button type=Submit Add Tags]]]'
-}
-