NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/Chameleon/trunk/Chameleon/ProjectionSelector/ProjectionSelectorPopup.phtml

Revision 13 (checked in by jcleary, 17 years ago)

Latest Chameleon code checkout from previous repository

Line 
1 <?php
2 //set the language resource file
3 $szLanguageResource = str_replace("\\","/",dirname(__FILE__))."/ProjectionSelectorPopup.dbf";
4
5
6 // include the session handling file (currently only required for MLT)
7 define("LOAD_MAPSESSION", "1");
8 include_once("../session.inc.php");
9
10 include_once("../CWC2ButtonCache.php");
11 ?>
12 <html>
13 <head>
14 <title><?php echo trim($oMLT->get("0", "Map Projection")); ?></title>
15 <link href="<?php echo $szCSSFile; ?>" rel="stylesheet" type="text/css">
16 </head>
17 <script language="JavaScript" src="<?php echo $_SESSION['gszCoreWebPath']; ?>/widgets/js/cwc_dhtml.js" type="text/javascript"></script>
18 <script language="JavaScript" src="<?php echo $_SESSION['gszCoreWebPath']; ?>/widgets/js/cwc_button.js" type="text/javascript"></script>
19 <script language="JavaScript" type="text/javascript">
20 function applyProjection( obj )
21 {
22     obj = document.forms[0].projections;
23     proj = obj[obj.selectedIndex].value;
24     window.opener.applyProjection( proj );
25     window.close();
26 }
27 function updateProjectionList()
28 {
29     obj = document.forms[0].projections;
30
31     while (obj.options.length != 0)
32     {
33         obj.options[0] = null;
34     }
35
36     aszProj = window.opener.getProjectionList();
37     szDefault = window.opener.getCurrentProjection();
38     for (i=0;i<aszProj.length;i++)
39     {
40         if (szDefault == aszProj[i][1])
41             opt = new Option( aszProj[i][0], aszProj[i][1], true, true);
42         else
43             opt = new Option( aszProj[i][0], aszProj[i][1] );
44         obj.options[obj.options.length] = opt;
45     }
46
47     self.focus();
48 }
49 function CloseWindow()
50 {
51     window.close();
52 }
53 </script>
54 <body class="page" onLoad="updateProjectionList()">
55
56 <form>
57
58 <table border="0" cellpadding="1" cellspacing="10">
59   <tr>
60     <td class="layoutTable">
61           <table class="titleArea" width="100%" border="0" cellpadding="4" cellspacing="0">
62         <tr>
63           <td><img src="title_projection.gif" width="22" height="22" align="texttop">&nbsp;<span class="title"><?php echo trim($oMLT->get("0", "Map Projection")); ?></span></td>
64                 </tr>
65             </table>
66             <table class="contentArea" width="100%" border="0" cellpadding="4" cellspacing="0">
67         <tr>
68           <td align="center"><p class="helpArea"><?php echo trim($oMLT->get("1", "Please select a projection from the dropdown box and click [Ok] to reproject the current map view.")); ?></p></td>
69                 </tr>
70             </table>
71             <table class="contentArea" border="0" cellspacing="0" cellpadding="4" width="100%">
72         <tr>
73           <td>
74                         <table border="0" cellspacing="0" cellpadding="2">
75 <?php
76 // check if mapobjec have a projection defined
77 //print_r($oMapSession->oMap);
78 if ($oMapSession->oMap->getProjection() == "")
79 {
80     echo "<tr>";
81     echo "<td colspan=2><font color=red size=2><b>".trim($oMLT->get("3", "ERROR: Your mapfile don't have any projection defined. Can't change projection."))."</b></font></td>";
82     echo "</tr>";
83 }
84 else
85 {
86 ?>
87                             <tr>
88                                 <td><span class="label"><?php echo trim($oMLT->get("2", "Projection")); ?>:</span></td>
89                                 <td>
90                                     <span class="nnInputWrap"><select class="inputList" name="projections">
91                                         <option class="inputList" value=1>--------------------------------------------</option>
92                                         <option class="inputList" value=1>--------------------------------------------</option>
93                                         <option class="inputList" value=1>--------------------------------------------</option>
94                                     </select></span>
95                                 </td>
96                             </tr>
97 <?php
98 }
99 ?>
100                         </table>
101                     </td>
102                 </tr>
103             </table>
104     </td>
105   </tr>
106   <tr>
107     <td align="right">
108       <table border="0" cellspacing="0" cellpadding="0">
109         <tr>
110           <td><?php echo ($oMapSession->oMap->getProjection() != "") ? makeButton( 'applyProjection', '', 'ProjectionSelector', "images/icon_ok.png", trim($oCommonMLT->get("Ok", "Ok")), trim($oCommonMLT->get("OkTip", "Apply and Close")), array( 'width' => 75 ) ) : ""; ?></td>
111           <td>&nbsp;&nbsp;</td>
112           <td><?php echo makeButton( 'CloseWindow', '', 'ProjectionSelector', "images/icon_cancel.png", trim($oCommonMLT->get("Cancel", "Cancel")), trim($oCommonMLT->get("CloseTip", "Close Dialog")), array( 'width' => 75 ) ); ?></td>
113         </tr>
114       </table>
115     </td>
116   </tr>
117 </table>
118
119 </form>
120
121 </body>
122 </html>
Note: See TracBrowser for help on using the browser.