xref: /aoo42x/main/sd/res/webview/show.pl (revision c667dd47)
1*c667dd47SPedro Giffuni#!/usr/bin/env perl
2bb113e63SAndrew Rist# *************************************************************
3bb113e63SAndrew Rist#
4bb113e63SAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
5bb113e63SAndrew Rist#  or more contributor license agreements.  See the NOTICE file
6bb113e63SAndrew Rist#  distributed with this work for additional information
7bb113e63SAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
8bb113e63SAndrew Rist#  to you under the Apache License, Version 2.0 (the
9bb113e63SAndrew Rist#  "License"); you may not use this file except in compliance
10bb113e63SAndrew Rist#  with the License.  You may obtain a copy of the License at
11bb113e63SAndrew Rist#
12bb113e63SAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
13bb113e63SAndrew Rist#
14bb113e63SAndrew Rist#  Unless required by applicable law or agreed to in writing,
15bb113e63SAndrew Rist#  software distributed under the License is distributed on an
16bb113e63SAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17bb113e63SAndrew Rist#  KIND, either express or implied.  See the License for the
18bb113e63SAndrew Rist#  specific language governing permissions and limitations
19bb113e63SAndrew Rist#  under the License.
20bb113e63SAndrew Rist#
21bb113e63SAndrew Rist# *************************************************************
22cdf0e10cSrcweir
23cdf0e10cSrcweirrequire "common.pl";
24cdf0e10cSrcweir
25cdf0e10cSrcweirprint "Content-type: text/html\n\n";
26cdf0e10cSrcweir
27cdf0e10cSrcweir# get current and next picture
28cdf0e10cSrcweir$sCurrPic = join( "", common::File_read( "currpic.txt" ) );
29cdf0e10cSrcweir@aPictureArray = common::File_read( "picture.txt" );
30cdf0e10cSrcweir
31cdf0e10cSrcweir# not last picture or wrong input ?
32cdf0e10cSrcweirif( abs( $sCurrPic ) > 0 )
33cdf0e10cSrcweir{
34cdf0e10cSrcweir    $nCurrPic = abs( $sCurrPic );
35cdf0e10cSrcweir    $nPictureArrayLen = @aPictureArray;
36cdf0e10cSrcweir    if( $nCurrPic < $nPictureArrayLen )
37cdf0e10cSrcweir    {
38cdf0e10cSrcweir        $sPictureName1 = ( split( ";", @aPictureArray[ $nCurrPic ] ) )[ 1 ];
39cdf0e10cSrcweir        $sPictureName2 = ( split( ";", @aPictureArray[ $nCurrPic + 1 ] ) )[ 1 ];
40cdf0e10cSrcweir    }
41cdf0e10cSrcweir    else
42cdf0e10cSrcweir    {
43cdf0e10cSrcweir        $sPictureName1 = ( split( ";", @aPictureArray[ $nCurrPic ] ) )[ 1 ];
44cdf0e10cSrcweir        $sPictureName2 = $sPictureName1;
45cdf0e10cSrcweir    }
46cdf0e10cSrcweir}
47cdf0e10cSrcweir
48cdf0e10cSrcweirprint "<HTML>";
49cdf0e10cSrcweir
50cdf0e10cSrcweirprint "<HEAD>";
51cdf0e10cSrcweir    print "<TITLE>$$1</TITLE>";
52cdf0e10cSrcweirprint "</HEAD>";
53cdf0e10cSrcweir
54cdf0e10cSrcweirprint "<BODY bgcolor=\"white\">";
55cdf0e10cSrcweir    print "<P ALIGN=CENTER><IMG src=\"" . $sPictureName1 . "\" width=$$4 height=$$5 border=0>";
56cdf0e10cSrcweir    print "<P><IMG src=\"" . $sPictureName2 . "\" width=1 height=1 border=0>";
57cdf0e10cSrcweirprint "</BODY>";
58cdf0e10cSrcweir
59bb113e63SAndrew Ristprint "</HTML>";
60