save(/home/jj/NATERM/naterm.log) cginame(/home/jj/public_html/bin/naterm) formtitle(NATerm Terminology tool) uploaddir(/home/jj/NATERM/POOL) feedback(d) inv(um) { {{Sea syntax details HERE
}}; *name1 (name) ; *numero1 (numero) ; lang ; terminology : file ; {{
Images, sounds: create, zip a folder named "MEDIA" with the files; Avoid non-alphanumeric chars in filenames.
}}; _imgs (MEDIA.zip) : file } ## sub um{ my $p = shift; arrumaFiles($p); unzip("_imgs"); if( $p->{terminology} ){""} else {"Nada submetido?"} } sub d{ my $p=shift; # fields: number, lang, terminology my $ldir= "naterm-pool"; my $outdir= "/home/jj/public_html/$ldir"; #out base dir my $udir= "http://natura.di.uminho.pt/~jj/$ldir"; #out base url my $stud = $p->{numero1}; #user id my $indir= $act->{uploaddir1}; #subm. dir my $lang="$p->{lang}" || "PT"; my $ERR = ""; ### Input processing executa( "cd $indir ; naterm -lua -lang=$lang terminology > _t.tex 2> _t.err ; naterm -html -lang=$lang terminology > _t.html 2> _t.err2 ; naterm -xdxf -lang=$lang terminology > _t.xdxf 2> _t.err3 ; HOME=/var/www /home/jj/bin/jpdf -l -q _t.tex"); ### copy to Output-dir executa( "cp $indir/terminology $outdir/$stud.naterm" ); executa( "cp $indir/_t.pdf $outdir/$stud.pdf" ); executa( "cp $indir/_t.html $outdir/$stud.html" ); executa( "cp $indir/_t.xdxf $outdir/$stud.xdxf" ); if (-s "$indir/_t.err"){ ## if errors in naterm executa( "cp $indir/_t.err $outdir/$stud.err" ); $ERR = " $stud.err "; } ### Feedback "ok
Results: submeted terminology | PDF: $stud.pdf | HTML: $stud.html | XDXF: $stud.xdxf | $ERR\n\n
" }