merge the formfield patch from ooo-build
[ooovba.git] / sd / res / webview / savepic.pl
blob8d545aa108b05e760852ef8e5c7dc402c92832b0
1 #!/usr/bin/perl
3 require "common.pl";
5 %aRequestMap = common::HTTP_getRequest();
7 # get new picture
8 $sCurrPic = $aRequestMap{ "CurrPic" };
10 @aPictureArray = common::File_read( "picture.txt" );
11 $nPictureArrayLen = @aPictureArray;
13 # check if + or - was pressed
14 if( $aRequestMap{ "Auswahl" } eq "+" )
16 $sCurrPic = abs( $sCurrPic ) + 1;
19 if( $aRequestMap{ "Auswahl" } eq "-" )
21 $sCurrPic = abs( $sCurrPic ) - 1;
24 # save picture name
25 if( (abs( $sCurrPic ) > 0) && ( abs( $sCurrPic ) < ( $nPictureArrayLen ) ) )
27 open( F_CURRPIC, ">currpic.txt");
28 print F_CURRPIC abs( $sCurrPic );
29 close( F_CURRPIC );
32 # return to edit page
33 print "Content-type: text/html\n\n";
34 print "<HTML>\n<HEAD>\n";
35 print "<META http-equiv=\"refresh\" CONTENT=\"0 ;URL=editpic.pl\">";
36 print "<title>savepic.pl</title>";
37 print "</HEAD>\n";
38 print "<BODY>\n";
39 print "</BODY>\n";
40 print "</HTML>\n";