Projet

Général

Profil

Révision c5f89cd9

Ajouté par Jocelyn Delande il y a environ 11 ans

webservice to reference ref_points is ready

Voir les différences:

ajax/add_reference.php
6 6
$fields_spec = array('x'         => array('required', 'numeric', 'positive'),
7 7
                     'y'         => array('required', 'numeric', 'positive'),
8 8
                     'panorama'  => array('required'),
9
                     'ref_point' => array('required'));
9
                     'ref_point' => array('required'),
10
);
10 11

  
11 12

  
12 13
$validator = new FormValidator($fields_spec);
......
14 15
  $vals = $validator->sane_values();
15 16

  
16 17
  // temp test code
17
  echo '<h1>pano !</h1>';
18 18
  $pano = site_point::get($vals['panorama']);
19
  var_dump($pano->get_params());
20 19

  
21
  echo '<h1>ref point !</h1>';
22 20
  $ref_point_name = urldecode($vals['ref_point']);
23
  var_dump(RefPoint::get($ref_point_name));
21
  $ref_point = RefPoint::get($ref_point_name);
22

  
23
  $pano->set_reference($ref_point, $vals['x'], $vals['y']);
24
  $pano->save_params();
24 25

  
25 26
 } else {
27
   // Set our response code
28
   http_response_code(400);
26 29
   echo var_dump($validator->errors());
27 30
 }
28 31

  

Formats disponibles : Unified diff