-if [ "$_PATH" = "/therapies/therapy.css" ]; then
- . $_EXEC/cgilite/file.sh
- FILE $_EXEC/therapies/therapy.css
- return 0
-fi
+case "$_PATH" in
+ /therapies/therapy.css)
+ . $_EXEC/cgilite/file.sh
+ FILE $_EXEC/therapies/therapy.css
+ return 0
+ ;;
+ /therapies/*.*_session*.png)
+ if [ -r "$_DATA/$_PATH" ]; then
+ . $_EXEC/cgilite/file.sh
+ FILE "$_DATA/$_PATH"
+ fi
+ return 0
+ ;;
+ /therapies/*/new)
+ card="${_PATH#/therapies/}"
+ card="${card%/new}"
+ uid="$(timeid)$(randomid)"
+ if [ -f "${_DATA}/vcard/${card}.vcf" ]; then
+ touch "${_DATA}/therapies/${card}.${uid}.tpy"
+ rm -f "${_DATA}/cache/${card}.vcf.cache"
+ REDIRECT "/therapies/${card}/${uid}"
+ fi
+ return 0
+ ;;
+esac