Révision ffa856dc
Ajouté par Jocelyn Delande il y a environ 11 ans
class/site_point.class.php | ||
---|---|---|
1 | 1 |
<?php |
2 | 2 |
require_once(dirname(__FILE__).'/../constants.inc.php'); |
3 | 3 |
require_once(dirname(__FILE__).'/utils.class.php'); |
4 |
|
|
4 |
utils::init(); |
|
5 | 5 |
// |
6 | 6 |
class PanoramaFormatException extends Exception { |
7 | 7 |
/** If the files organization is not correct for a panorama, we can't let it go... |
... | ... | |
206 | 206 |
return new site_point($pano_dir); |
207 | 207 |
} |
208 | 208 |
|
209 |
public static function create($filepath) { |
|
210 |
/** creates a new panorama, given its name, from an uploaded file. |
|
211 |
*/ |
|
212 |
$name = utils::strip_extension(basename($filepath)); |
|
213 |
$pano_dir = PANORAMA_PATH.'/'.$name; |
|
214 |
$pano = new site_point($pano_dir); |
|
215 |
if (!mkdir($pano->tiles_path())) { |
|
216 |
return false; |
|
217 |
} else { |
|
218 |
return $pano; |
|
219 |
} |
|
220 |
} |
|
209 | 221 |
|
210 | 222 |
public function to_geoJSON() { |
211 | 223 |
$prm = $this->get_params(); |
... | ... | |
229 | 241 |
|
230 | 242 |
public static function get_all($only_with_params=false) { |
231 | 243 |
/** |
232 |
* @param $only_with_params : filters out the panoramas which are not parametrized |
|
244 |
* @param $only_with_params : filters out the panoramas which |
|
245 |
* are not parametrized |
|
233 | 246 |
*/ |
234 | 247 |
$panos = array_diff(scandir(PANORAMA_PATH), array('..', '.')); |
235 | 248 |
$pano_instances = array(); |
Formats disponibles : Unified diff
added params generation to upload