@@ -24,33 +24,33 @@ public static function options()
24
24
);
25
25
}
26
26
27
- /** Maps OKAPI cache type codes to Geocaching.com GPX cache types. */
28
- public static $ cache_GPX_types = array (
29
- 'Traditional ' => ' Traditional Cache ' ,
30
- 'Multi ' => ' Multi-Cache ' ,
31
- 'Quiz ' => ' Unknown Cache ' ,
32
- 'Event ' => ' Event Cache ' ,
33
- 'Virtual ' => ' Virtual Cache ' ,
34
- 'Webcam ' => ' Webcam Cache ' ,
35
- 'Moving ' => ' Unknown Cache ' ,
36
- 'Math/Physics ' => ' Unknown Cache ' ,
37
- 'Drive-In ' => ' Traditional Cache ' ,
38
- 'Podcast ' => ' Unknown Cache ' ,
39
- 'Own ' => ' Unknown Cache ' ,
40
- 'Other ' => ' Unknown Cache '
41
- ) ;
42
-
43
- /** Maps OKAPI's 'size2' values to geocaching.com size codes. */
44
- public static $ cache_GPX_sizes = array (
45
- 'none ' => ' Virtual ' ,
46
- 'nano ' => ' Micro ' ,
47
- 'micro ' => ' Micro ' ,
48
- 'small ' => ' Small ' ,
49
- 'regular ' => ' Regular ' ,
50
- 'large ' => ' Large ' ,
51
- 'xlarge ' => ' Large ' ,
52
- 'other ' => ' Other ' ,
53
- ) ;
27
+ /** Maps OKAPI cache type codes to GPX cache types. */
28
+ public static $ cache_GPX_types = [
29
+ 'Traditional ' => [ ' oc ' => ' Traditional Cache ', ' gc ' => ' Traditional Cache ' ] ,
30
+ 'Multi ' => [ ' oc ' => ' Multi-Cache ', ' gc ' => ' Multi-Cache ' ] ,
31
+ 'Quiz ' => [ ' oc ' => ' Quiz Cache ' , ' gc ' => ' Unknown Cache ' ] ,
32
+ 'Event ' => [ ' oc ' => ' Event Cache ', ' gc ' => ' Event Cache ' ] ,
33
+ 'Virtual ' => [ ' oc ' => ' Virtual Cache ', ' gc ' => ' Virtual Cache ' ] ,
34
+ 'Webcam ' => [ ' oc ' => ' Webcam Cache ', ' gc ' => ' Webcam Cache ' ] ,
35
+ 'Moving ' => [ ' oc ' => ' Moving Cache ' , ' gc ' => ' Unknown Cache ' ] ,
36
+ 'Math/Physics ' => [ ' oc ' => ' Quiz Cache ' , ' gc ' => ' Unknown Cache ' ] ,
37
+ 'Drive-In ' => [ ' oc ' => ' Traditional Cache ', ' gc ' => ' Traditional Cache ' ] ,
38
+ 'Podcast ' => [ ' oc ' => ' Podcast Cache ' , ' gc ' => ' Unknown Cache ' ] ,
39
+ 'Own ' => [ ' oc ' => ' Own Cache ' , ' gc ' => ' Unknown Cache ' ] ,
40
+ 'Other ' => [ ' oc ' => ' Other Cache ' , ' gc ' => ' Unknown Cache ' ],
41
+ ] ;
42
+
43
+ /** Maps OKAPI's 'size2' values to GPX size codes. */
44
+ public static $ cache_GPX_sizes = [
45
+ 'none ' => [ ' oc ' => ' No container ' , ' gc ' => ' Virtual ' ] ,
46
+ 'nano ' => [ ' oc ' => ' Nano ' , ' gc ' => ' Micro ' ] ,
47
+ 'micro ' => [ ' oc ' => ' Micro ', ' gc ' => ' Micro ' ] ,
48
+ 'small ' => [ ' oc ' => ' Small ', ' gc ' => ' Small ' ] ,
49
+ 'regular ' => [ ' oc ' => ' Regular ', ' gc ' => ' Regular ' ] ,
50
+ 'large ' => [ ' oc ' => ' Large ', ' gc ' => ' Large ' ] ,
51
+ 'xlarge ' => [ ' oc ' => ' Very large ' , ' gc ' => ' Large ' ] ,
52
+ 'other ' => [ ' oc ' => ' Other ', ' gc ' => ' Other ' ] ,
53
+ ] ;
54
54
55
55
/**
56
56
* When used in create_gpx() method, enables GGZ index generation.
@@ -95,7 +95,7 @@ public static function create_gpx(OkapiRequest $request, $flags = null)
95
95
$ langpref = $ request ->get_parameter ('langpref ' );
96
96
if (!$ langpref ) $ langpref = "en " ;
97
97
$ langprefs = explode ("| " , $ langpref );
98
- foreach (array ('ns_ground ' , 'ns_gsak ' , 'ns_ox ' , 'latest_logs ' , 'alt_wpts ' , 'mark_found ' ) as $ param )
98
+ foreach (array ('ns_ground ' , 'ns_gsak ' , 'ns_ox ' , 'ns_oc ' , ' latest_logs ' , 'alt_wpts ' , 'mark_found ' ) as $ param )
99
99
{
100
100
$ val = $ request ->get_parameter ($ param );
101
101
if (!$ val ) $ val = "false " ;
@@ -205,7 +205,7 @@ public static function create_gpx(OkapiRequest $request, $flags = null)
205
205
206
206
$ fields = 'code|name|location|date_created|url|type|status|size|size2|oxsize ' .
207
207
'|difficulty|terrain|description|hint2|rating|owner|url|internal_id ' .
208
- '|protection_areas|short_description ' ;
208
+ '|protection_areas|short_description|trip_time|trip_distance|req_passwd|gc_code ' ;
209
209
if ($ vars ['images ' ] != 'none ' )
210
210
$ fields .= "|images " ;
211
211
if (count ($ vars ['attrs ' ]) > 0 )
@@ -233,7 +233,7 @@ public static function create_gpx(OkapiRequest $request, $flags = null)
233
233
'fields ' => $ fields ,
234
234
'lpc ' => $ lpc ,
235
235
'user_uuid ' => $ user_uuid ,
236
- 'log_fields ' => 'uuid|date|user|type|comment|internal_id|was_recommended '
236
+ 'log_fields ' => 'uuid|date|user|type|comment|oc_team_entry| internal_id|was_recommended '
237
237
)
238
238
)
239
239
);
@@ -467,7 +467,7 @@ public static function create_gpx(OkapiRequest $request, $flags = null)
467
467
468
468
$ ggz_entry ['code ' ] = $ cache_ref ['code ' ];
469
469
$ ggz_entry ['name ' ] = isset ($ cache_ref ['name_2 ' ]) ? $ cache_ref ['name_2 ' ] : $ cache_ref ['name ' ];
470
- $ ggz_entry ['type ' ] = $ vars ['cache_GPX_types ' ][$ cache_ref ['type ' ]];
470
+ $ ggz_entry ['type ' ] = $ vars ['cache_GPX_types ' ][$ cache_ref ['type ' ]][ ' gc ' ] ;
471
471
list ($ lat , $ lon ) = explode ("| " , $ cache_ref ['location ' ]);
472
472
$ ggz_entry ['lat ' ] = $ lat ;
473
473
$ ggz_entry ['lon ' ] = $ lon ;
0 commit comments