1
0
forked from GitHub/gf-core

gfse: added links to download PGF files for user's grammars

This commit is contained in:
hallgren
2011-08-01 15:01:14 +00:00
parent a918bcaf68
commit 8cf7671e07

View File

@@ -66,8 +66,12 @@ check_grammar() {
dt ; echo "◂"; link "javascript:history.back()" "Back to Editor"
end
sed=();
for pgf in *.pgf ; do
sed=("${sed[@]}" -e "s%$pgf%<a href=\"${dir##*/}/$pgf\">$pgf</a>%")
done
begin pre
ls -l *.pgf
ls -l *.pgf | sed "${sed[@]}"
end
else
end
@@ -226,6 +230,22 @@ case "$REQUEST_METHOD" in
cgiheaders
echo "cc $exp" | GF_RESTRICTED=True gf -run
;;
"")
case "$PATH_INFO" in
/tmp/gfse.*/*.pgf)
path="$documentRoot$PATH_INFO"
if [ -r $path ] ; then
ContentType="application/binary"
cgiheaders
cat "$path"
else
error404
fi
;;
*)
error400
esac
;;
*) error400
esac
esac