Projet

Général

Profil

Révision d4e538ff

Ajouté par Jocelyn Delande il y a environ 11 ans

can set the title of the panorama from the form

Voir les différences:

uploadReceive.php
39 39

  
40 40
function existant_and_set($list, $keys) {
41 41
  /** For HTTP data : keys of $keys are set within $list and they are not empty
42
  * or false nor empty
42
  * nor false.
43 43
  */
44 44
  foreach($keys as $key) {
45 45
    if (!isset($list[$key]) || !$list[$key]) {
......
55 55
                     'lon'         => array('numeric', 'positive'),
56 56
                     'alt'  => array('numeric', 'positive'),
57 57
                     'loop'  => array('boolean'),
58
                     'titre'  => array('required'),
58 59
);
59 60

  
60 61
$validator = new FormValidator($fields_spec);
......
84 85
  $vals = $validator->sane_values();
85 86
  // There is no point setting a part of the parameters only ; check that all
86 87
  // are present.  
87
  if (existant_and_set($vals, array('lat', 'alt', 'lon'))) {
88
  if (existant_and_set($vals, array('lat', 'alt', 'lon', 'titre'))) {
88 89
    try {
89 90
      $panorama = site_point::create($uploaded_filepath);
90 91
      $panorama->set_param('titre', 'Sans nom 1');//FIXME
......
92 93
      $panorama->set_param('longitude', $vals['lon']);
93 94
      $panorama->set_param('altitude',  $vals['alt']);
94 95
      $panorama->set_param('image_loop', $vals['loop']);
96
      $panorama->set_param('titre', $vals['titre']);
95 97
      $panorama->save_params();
96 98
      $params_success = true;
97 99
    } catch (Exception $e) {

Formats disponibles : Unified diff