Projet

Général

Profil

« Précédent | Suivant » 

Révision 6dea1698

ID6dea1698af13d51920c19f8fc8cdd9a2617a9d7a
Parent 9f05628b
Enfant ffebe856

Ajouté par Jocelyn Dealande il y a environ 10 ans

Use propper RefPoint::get_all() instead of requiring ref_points.local.php

Fichiers

  • ajouté
  • modifié
  • copié
  • renommé
  • supprimé

Voir les différences

Révisions

class/RefPoint.class.php
29 29
   return self::$all_ref_points_cache;
30 30
  }
31 31

  
32
  public static function get_all() {
33
    self::load_if_needed();
34
    $ref_points_objs = array();
35
    foreach (self::$all_ref_points_cache as $name => $vals) {
36
      $ref_points_objs[] = new RefPoint($name, $vals);
37
    }
38
    return $ref_points_objs;
39
  }
40

  
32 41
  public static function get($name) {
33 42
    self::load_if_needed();
34 43
    $values = self::$all_ref_points_cache[$name];
panorama.php
94 94
     }
95 95
   }
96 96

  
97
   $ref_points = array ();
98
   if (file_exists(REF_POINTS_PATH)) {
99
     include REF_POINTS_PATH;
100
   }
97
   $ref_points = RefPoint::get_all();
101 98
   $extra_names = array();
102 99
   $ref_names = array();
103
   if (is_array($ref_points)) {
104
     foreach ($ref_points as $name => $vals) {
105
       $extra_names[] = $name;
106
       list($dist, $cap, $ele) = $pt->coordsToCap($vals[0], $vals[1], $vals[2]);
107
       $ref_names[$name] = array($dist, $cap, $ele);
108
       printf('point_list[%d] = new Array("%s", %03lf, %03lf, %03lf, "");'."\n", $ipt++, $name, $dist, $cap, $ele);
100
   foreach ($ref_points as $ref) {
101
     $extra_names[] = $ref->name;
102
     list($dist, $cap, $ele) = $pt->coordsToCap($ref->lon, $ref->lat,
103
                                                $ref->ele);
104
     $ref_names[$name] = array($dist, $cap, $ele);
105
     printf('point_list[%d] = new Array("%s", %03lf, %03lf, %03lf, "");'."\n", $ipt++, $ref->name, $dist, $cap, $ele);
109 106
     }
110
   }
111

  
112 107

  
113 108
   if (isset($params['reference'])) {
114 109
     echo "ref_points = new Array();\n";