tag="$(POST tag_$n $m)"
[ ! "${tag##${cat}:*}" ] || [ ! "${tag##-${cat}:*}" ] || [ "$cat" = '*' -a "${tag##*:*}" ] \
&& f="${f}${tag}|"
+ [ "$cat" = \$ ] && f="${f}\$:${tag}|"
done
f="${f%[|^]}^"
done
-f="${f%^}"
+f="$(printf '%s' "$f" |sed -E 's;[~|^]+$;;')"
+#f="${f%^}"
REDIRECT "$(URL "${ITEM}")?o=${order}&f=${f}"
STRING "$FILTER^" \
| sed -E 's;\^;\n;g; s;[]\/\(\)\\\^\$\?\.\+\*\;\[\{\}];\\&;g' \
| while read -r f; do
- [ "${f#\~}" ] || continue
- [ "${f#\~}" = "$f" ] \
- && fex="/(\ttags=([^\t]*,)?)(${f})((,[^\t]*)?\t)/{${fex}}" \
- || fex="/(\ttags=([^\t]*,)?)(${f#\~})((,[^\t]*)?\t)/d; ${fex}"
+ [ "${f##*[A-Z]*}" ] && tl="y;ABCDEFGHIJKLMNOPQRSTUVWXYZ;abcdefghijklmnopqrstuvwxyz;;"
+ case $f in
+ ''|~) continue;;
+ ~\\\$:*) fex="h; ${tl} /${f#~\\\$:}/d; g;${fex}";;
+ \\\$:*) fex="h; ${tl} /${f#\\\$:}/{g;${fex}}";;
+ ~*) fex="/(\ttags=([^\t]*,)?)(${f#\~})((,[^\t]*)?\t)/d; ${fex}";;
+ *) fex="/(\ttags=([^\t]*,)?)(${f})((,[^\t]*)?\t)/{${fex}}";;
+ esac
printf '%s\n' "${fex}"
done \
| tail -n1
$n "${t:+checked}" $n $n
f="|${f#\~}|"
- printf '*\n%s\n' "$w_tagcategories" \
+ printf '*\n%s\n$\n' "$w_tagcategories" \
| while read -r category; do
lbid="cat_${n}_${category}"
# printf '[option %s value="%s"\n%s]' "$t" "$tag" "$d"
printf '[label [checkbox "tag_%s" "%s" %s] %s]' "$n" "$tag" "$t" "$d"
done
+ d="${f##*\$:}" d="${d%%\|*}"
+ [ "$category" = \$ ] && printf '[input name="tag_%i" value="%s"]' "$n" "$d"
printf '\n]'
done
printf ']'