+ REDIRECT "${SCRIPT_NAME}#${fid}"
+ ;;
+ delfolder)
+ fid="$(POST fid | checkid)"
+ target="$(POST target | checkid)"
+ file="${BDB}/${fid}.bm"
+ tfile="${BDB}/${target}.bm"
+ if [ "$(POST control)" = confirm -a -f "$file" ]; then
+ if [ "$target" = "____________" ] || tail -n+2 "$file" >>"$tfile"; then
+ rm -f "$file"
+ fi
+ fi
+ REDIRECT "${SCRIPT_NAME}#${target}"
+ ;;
+ movefolder)
+ fid="$(POST fid | checkid)"
+ target="$(POST target | checkid)"
+ file="${BDB}/${fid}.bm"
+ tfile="${BDB}/${target}.bm"
+ if [ "$target" = "____________" -a -f "$file" -a "$(POST control)" = confirm ]; then
+ read nan1 nan2 last nan3 <"${BDB}/$(list_folders |tail -n1 |cut -f1).bm"
+ sed -ri "1s;^(([^\t]+\t){2})[^\t]+(.*)$;\1$((${last:-0} + 1000))\3;;" "$file"
+ elif [ -f "$tfile" -a -f "$file" -a "$(POST control)" = confirm ]; then
+ read nan1 nan2 tid nan3 <"$tfile"
+ sed -ri "1s;^(([^\t]+\t){2})[^\t]+(.*)$;\1$((${tid:-1} -1))\2;;" "$file"
+ order_files
+ fi
+ REDIRECT "${SCRIPT_NAME}#${fid}"