Exemple #1
0
 if (isset($_POST['view_direction']) && strlen($_POST['view_direction'])) {
     $smarty->assign('view_direction', $_POST['view_direction']);
 } else {
     $smarty->assign('view_direction', -1);
 }
 if (!empty($_POST['use6fig'])) {
     $smarty->assign('use6fig', $_POST['use6fig']);
 }
 //ensure the submitted reference is valid
 if (!empty($_POST['grid_reference']) && empty($_POST['setpos2'])) {
     #$ok= $square->setByFullGridRef($_POST['grid_reference'], false, false, true);
     $ok = $square->setByFullGridRef($_POST['grid_reference'], false, false, empty($_POST['setpos2']) && empty($_POST['setpos']));
     //preserve inputs in smarty
     $smarty->assign('grid_reference', $grid_reference = $_POST['grid_reference']);
 } else {
     $ok = $square->setGridPos($_POST['gridsquare'], $_POST['eastings'], $_POST['northings']);
     if ($ok) {
         //preserve inputs in smarty
         $smarty->assign('grid_reference', $grid_reference = $square->grid_reference);
         $selectedtab = 2;
     }
 }
 if ($ok) {
     $uploadmanager->setSquare($square);
     $square->rememberInSession();
     if (isset($_POST['picnik'])) {
         if ($_POST['picnik'] == 'return') {
             unset($_POST['picnik']);
             $smarty->assign('_post', $_POST);
             $smarty->display('submit_picnik.tpl');
             exit;
Exemple #2
0
}
//set by grid components?
if (isset($_GET['p'])) {
    $grid_given = true;
    //p=900y + (900-x);
    $p = intval($_GET['p']);
    $x = $p % 900;
    $y = ($p - $x) / 900;
    $x = 900 - $x;
    $grid_ok = $square->loadFromPosition($x, $y, true);
    $grid_given = true;
    $smarty->assign('gridrefraw', $square->grid_reference);
    $smarty->assign('gridref2', strlen($square->grid_reference) <= 2 + $CONF['gridpreflen'][$square->reference_index]);
} elseif (isset($_GET['setpos'])) {
    $grid_given = true;
    $grid_ok = $square->setGridPos($_GET['gridsquare'], $_GET['eastings'], $_GET['northings'], true);
    $smarty->assign('gridrefraw', $square->grid_reference);
    $smarty->assign('gridref2', strlen($square->grid_reference) <= 2 + $CONF['gridpreflen'][$square->reference_index]);
} elseif (isset($_GET['gridref']) && strlen($_GET['gridref'])) {
    $grid_given = true;
    $grid_ok = $square->setByFullGridRef($_GET['gridref'], false, true);
    //preserve inputs in smarty
    if ($grid_ok) {
        $smarty->assign('gridrefraw', stripslashes($_GET['gridref']));
        $smarty->assign('gridref2', strlen($square->grid_reference) <= 2 + $CONF['gridpreflen'][$square->reference_index]);
    } else {
        //preserve the input at least
        $smarty->assign('gridref', stripslashes($_GET['gridref']));
    }
}
$cacheid = '';