xref: /trunk/main/sd/res/webview/savepic.pl (revision cdf0e10c)
1#!/usr/bin/perl
2
3require "common.pl";
4
5%aRequestMap = common::HTTP_getRequest();
6
7# get new picture
8$sCurrPic = $aRequestMap{ "CurrPic" };
9
10@aPictureArray = common::File_read( "picture.txt" );
11$nPictureArrayLen = @aPictureArray;
12
13# check if + or - was pressed
14if( $aRequestMap{ "Auswahl" } eq "+" )
15{
16	$sCurrPic = abs( $sCurrPic ) + 1;
17}
18
19if( $aRequestMap{ "Auswahl" } eq "-" )
20{
21	$sCurrPic = abs( $sCurrPic ) - 1;
22}
23
24# save picture name
25if( (abs( $sCurrPic ) > 0) && ( abs( $sCurrPic ) < ( $nPictureArrayLen ) ) )
26{
27	open( F_CURRPIC, ">currpic.txt");
28	print F_CURRPIC abs( $sCurrPic );
29	close( F_CURRPIC );
30}
31
32# return to edit page
33print "Content-type: text/html\n\n";
34print "<HTML>\n<HEAD>\n";
35print "<META http-equiv=\"refresh\" CONTENT=\"0 ;URL=editpic.pl\">";
36print "<title>savepic.pl</title>";
37print "</HEAD>\n";
38print "<BODY>\n";
39print "</BODY>\n";
40print "</HTML>\n";
41%>
42