2003-09-09 04:02:55 +00:00
< ? php
2002-08-26 08:59:36 +00:00
include ( " plotconf.inc " );
include ( " plot.inc " );
if ( $warnings == " 1 " ) {
error_reporting ( E_ALL );
} else {
error_reporting ( E_ERROR );
}
?>
2003-09-11 13:53:25 +00:00
< ? php
2002-08-26 08:59:36 +00:00
if ( shouldrun ( $HTTP_SERVER_VARS [ 'HTTP_USER_AGENT' ])) {
$drawmode = " GD " ;
} else {
$drawmode = " CSS " ;
}
if ( isset ( $HTTP_POST_VARS [ " button " ])) {
// save data from the POST
setcookie ( " atlasprefs " , " " , time () - 36000000 );
setcookie ( " atlasprefs " , " $HTTP_POST_VARS[shape] : $HTTP_POST_VARS[color] : $HTTP_POST_VARS[size] : $HTTP_POST_VARS[earthimage] : $HTTP_POST_VARS[cssdot] : $HTTP_POST_VARS[seldrawmode] " , time () + 36000000 , $cookiepath );
$setshape = $HTTP_POST_VARS [ " shape " ];
$setcolor = $HTTP_POST_VARS [ " color " ];
$setsize = $HTTP_POST_VARS [ " size " ];
$setearthimage = $HTTP_POST_VARS [ " earthimage " ];
$setcssdot = $HTTP_POST_VARS [ " cssdot " ];
$setseldrawmode = $HTTP_POST_VARS [ " seldrawmode " ];
if ( $setseldrawmode == " 1 " ) {
$drawmode = " GD " ;
} else {
$drawmode = " CSS " ;
}
} elseif ( isset ( $HTTP_COOKIE_VARS [ " atlasprefs " ]) && validcookie ( $HTTP_COOKIE_VARS [ " atlasprefs " ])) {
// get data from the cookie
@ list ( $setshape , $setcolor , $setsize , $setearthimage , $setcssdot , $setseldrawmode ) = split ( " : " , $HTTP_COOKIE_VARS [ " atlasprefs " ]);
} else {
$setshape = " Diamond " ;
$setsize = " 3 " ;
$setcolor = " red " ;
$setearthimage = $earthimages [ $defaultimage ];
$setcssdot = " reddot.gif " ;
if ( shouldrun ( $HTTP_SERVER_VARS [ 'HTTP_USER_AGENT' ])) {
$setseldrawmode = 1 ;
} else {
$setseldrawmode = 0 ;
}
// override old cookie if there is post data
if ( isset ( $HTTP_POST_VARS [ " seldrawmode " ])) {
$setsetdrawmode = $HTTP_POST_VARS [ " seldrawmode " ];
}
}
?>
2003-09-09 04:02:55 +00:00
< ? php # START HTML
2002-08-26 08:59:36 +00:00
?>
2003-09-09 04:02:55 +00:00
< html >< head >< title >< ? php echo t ( " IP-Atlas Preferences " ) ?> </title>
2002-08-26 08:59:36 +00:00
<!-- your head tags here -->
< link rel = " Stylesheet " href = " ip-atlas.css " >
</ head >< body bgcolor = " #ffffff " >
</ head >< body >
2003-09-09 04:02:55 +00:00
< b >< ? php echo t ( " IP-Atlas preferences " ); ?> </b> <?php echo t("(cookie based)"); ?><br><br>
2002-08-26 08:59:36 +00:00
2003-09-11 13:53:25 +00:00
< ? php
2002-08-26 08:59:36 +00:00
if ( isset ( $HTTP_POST_VARS [ " button " ])) {
2003-09-09 04:02:55 +00:00
print t ( " Your settings have been saved. You can now try " ); ?> <a href="plot.php<?php if(isset($HTTP_GET_VARS["lastquery"])) { echo "?address=$HTTP_GET_VARS[lastquery]"; } ?>"><?php print t("plotting something.")."</a>"."<br><br>";
2002-08-26 08:59:36 +00:00
}
?>
2003-09-09 04:02:55 +00:00
< form action = " <?php echo $HTTP_SERVER_VARS['PHP_SELF'] ; ?><?php if(isset( $HTTP_GET_VARS["lastquery"] )) { echo " ? lastquery = $HTTP_GET_VARS [ lastquery ] " ; } ?> " method = " POST " >
2002-08-26 08:59:36 +00:00
2003-09-09 04:02:55 +00:00
< ? php if ( istheregd ()) {
2002-08-26 08:59:36 +00:00
echo t ( " Draw mode (defaults guessed for your browser): " );
print " <br><select name= \" seldrawmode \" > " ;
if ( ! isset ( $setseldrawmode )) {
if ( shouldrun ( $HTTP_SERVER_VARS [ 'HTTP_USER_AGENT' ])) {
$setseldrawmode = 1 ;
} else {
$setseldrawmode = 0 ;
}
}
if ( $setseldrawmode == " 1 " ) {
echo " <option value= \" 1 \" selected>GD " ;
echo " <option value= \" 0 \" >CSS " ;
} elseif ( $setseldrawmode == " 0 " ) {
echo " <option value= \" 1 \" >GD " ;
echo " <option value= \" 0 \" selected>CSS " ;
}
print " </select><br><br> " ;
} else {
print " <input type= \" hidden \" name= \" seldrawmode \" value= \" 0 \" > " ;
}
?>
2003-09-09 04:02:55 +00:00
< ? php echo t ( " Pointer Preferences (the dot that marks lat/lon): " ); ?> <br>
2003-09-11 13:53:25 +00:00
< ? php
2002-08-26 08:59:36 +00:00
if ( $drawmode == " GD " ) {
print '
< input type = " hidden " name = " cssdot " value = " reddot.gif " >
< table >< tr >
< td > '.t("Shape:").' </ td >< td >< select name = " shape " >
' ;
$shapes = array ( " Diamond " , " Diamond Outline " , " Square " , " Square Outline " , " Cross " );
foreach ( $shapes as $curshape ) {
if ( $setshape == $curshape ) {
print " <option value= \" $curshape\ " selected > " .t( $curshape );
} else {
print " <option value= \" $curshape\ " > " .t( $curshape );
}
}
print " </select></td></tr><tr><td> " . t ( " Size: " ) . " </td><td><select name= \" size \" > " ;
$sizes = array ( " 2 " , " 3 " , " 4 " , " 5 " , " 6 " , " 7 " , " 8 " );
foreach ( $sizes as $cursize ) {
if ( $setsize == $cursize ) {
print " <option value= \" $cursize\ " selected > $cursize " ;
} else {
print " <option value= \" $cursize\ " > $cursize " ;
}
}
print " </select></td></tr><tr><td> " . t ( " Color: " ) . " </td><td><select name= \" color \" > " ;
$colors = array ( " red " , " white " , " yellow " , " magenta " , " cyan " , " green " , " violet " );
foreach ( $colors as $curcolor ) {
if ( $setcolor == $curcolor ) {
print " <option value= \" $curcolor\ " selected > " .t( $curcolor );
} else {
print " <option value= \" $curcolor\ " > " .t( $curcolor );
}
}
print "
</ select ></ td ></ tr ></ table >
" ;
} elseif ( $drawmode == " CSS " ) {
print t ( " Pointer: " ) . " <select name= \" cssdot \" > " ;
foreach ( $cssdots as $curdot ) {
list ( $filename , $curdot , , ) = split ( " : " , $curdot );
if ( $setcssdot == $filename ) {
print " <option value= \" $filename\ " selected > $curdot " ;
} else {
print " <option value= \" $filename\ " > $curdot " ;
}
}
print " </select><br> " ;
print '
< input type = " hidden " name = " shape " value = " Diamond " >
< input type = " hidden " name = " color " value = " Red " >
< input type = " hidden " name = " size " value = " 3 " >
' ;
}
?>
< br >
2003-09-09 04:02:55 +00:00
< ? php echo t ( " Other Preferences: " ) ?> <br>
< ? php echo t ( " Earth Image: " ) ?>
2002-08-26 08:59:36 +00:00
< select name = " earthimage " >
2003-09-11 13:53:25 +00:00
< ? php
2002-08-26 08:59:36 +00:00
foreach ( $earthimages as $curentry ) {
list ( $curfile , $curname , , ) = split ( " : " , $curentry );
if ( $setearthimage == $curfile ) {
print " <option value= \" $curfile\ " selected > $curname " ;
} else {
print " <option value= \" $curfile\ " > $curname " ;
}
}
?>
</ select >
< br >< br >
2003-09-09 04:02:55 +00:00
< input type = " Submit " name = " button " value = " <?php echo t( " Save " ) ?> " >
2002-08-26 08:59:36 +00:00
< div align = " right " >
2003-09-09 04:02:55 +00:00
[ < a href = " plot.php<?php if(isset( $HTTP_GET_VARS["lastquery"] )) { echo " ? address = $HTTP_GET_VARS [ lastquery ] " ; } ?> " >< ? php echo t ( " main " ) ?> </a> ]<br><br>
2002-08-26 08:59:36 +00:00
</ div >
2003-09-09 04:02:55 +00:00
< ? php include ( " footer.inc " ); ?>
2002-08-26 08:59:36 +00:00
</ body ></ html >