]> dev.renevier.net Git - syp.git/blob - inc/templates_index.php
when clicking image in popup, show it full screen
[syp.git] / inc / templates_index.php
1 <?php
2 /* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
3    license. */
4
5 require_once ("./inc/settings.php");
6 require_once ("./inc/db/mysql.php");
7
8 try {
9     $connection->connect (DBHOST, DBUSER, DBPWD, DBNAME, DBPREFIX);
10 } catch (Exception $e) {
11 }
12
13 $bbox = $connection->mbr ();
14 if (defined ("THUMBSMAXSIZE") && (THUMBSMAXSIZE > 0)) {
15     $thumbsmaxsize = THUMBSMAXSIZE;
16 } else {
17     $thumbsmaxsize = 400; // default value;
18 }
19 ?>
20 <html lang="<?php echo $lang?>">
21 <head>
22     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
23     <title><?php echo defined ("SITETITLE") ? SITETITLE : "SYP"?></title>
24     <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="news.php">
25     <link rel="stylesheet" href="./openlayers/theme/default/style.css" type="text/css">
26     <link rel="stylesheet" href="./media/syp.css" type="text/css">
27     <style type="text/css">
28         .olPopup p {
29             <?php printf("width: %dpx;\n", $thumbsmaxsize)?>
30         }
31         .olPopup img {
32             <?php printf("max-height: %dpx;\n", $thumbsmaxsize)?>
33             <?php printf("max-width: %dpx;\n", $thumbsmaxsize)?>
34
35             /* for IE (does not understand max-heigth max-width) */
36             <?php printf("_height: expression((this.scrollHeight>this.scrollWidth) ? 
37                  Math.min(parseInt(this.scrollHeight), %d ) + 'px' : 'auto');\n", $thumbsmaxsize)?>
38             <?php printf("_width: expression((this.scrollWidth>this.scrollHeight) ? 
39                  Math.min(parseInt(this.scrollWidth), %d ) + 'px' : 'auto');\n", $thumbsmaxsize)?>
40         }
41     </style>
42
43     <script type="text/javascript">
44         var SypStrings = {
45             language: "<?php echo $lang ?>",
46             propulsedByLink: "<?php ptrans('propulsed by <a href=\"http://syp.renevier.net\">syp</a>')?>",
47             noImageRegistered: "<?php ptrans('There is no image registered on this site.')?>"
48         };
49         <?php
50             printf ("var sypOrig = [%.18F, %.18F, %.18F, %.18F];\n",
51                     $bbox [0], $bbox [1], $bbox [2], $bbox [3]);
52         ?>
53     </script>
54     <script src="./openlayers/OpenLayers.js" type="text/javascript"></script>
55     <script src="./js/syp.js" type="text/javascript"></script>
56
57     <noscript>
58     <style type="text/css">
59         #map {
60             display: none;
61         }
62     </style>
63     </noscript>
64
65     </head>
66
67     <body onload="SYP.init();">
68
69         <noscript>
70             <p><?php ptrans('SYP needs javascript. Please activate scripts in your browser.')?></p>
71         </noscript>
72
73         <div id="map"></div>
74         <div id="message"></div>
75
76     <div id="bigimg_container">
77     <div id="bigimg_transparency"></div>
78         <div id="bigimg_content">
79             <img id="bigimg" onclick="SYP.closeBigImage()">
80             <img id="bigimg_close" alt="<?php ptrans('close')?>" 
81                     src="openlayers/theme/default/img/close.gif" 
82                     onclick="SYP.closeBigImage()">
83         </div>
84     </div>
85
86 </body>
87 </html>