File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
services/apisrv/installation Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ class OkapiServiceRunner
4343 'services/caches/formatters/garmin ' ,
4444 'services/caches/formatters/ggz ' ,
4545 'services/caches/map/tile ' ,
46+ 'services/draftlogs/upload_fieldnotes ' ,
4647 'services/logs/capabilities ' ,
4748 'services/logs/delete ' ,
4849 'services/logs/edit ' ,
Original file line number Diff line number Diff line change @@ -33,7 +33,38 @@ public static function call(OkapiRequest $request)
3333 $ result ['has_image_positions ' ] = Settings::get ('OC_BRANCH ' ) == 'oc.de ' ;
3434 $ result ['has_ratings ' ] = Settings::get ('OC_BRANCH ' ) == 'oc.pl ' ;
3535 $ result ['geocache_passwd_max_length ' ] = Db::field_length ('caches ' , 'logpw ' );
36+ if (Settings::get ('OC_BRANCH ' ) == 'oc.de ' ) {
37+ $ result ['has_draft_logs ' ] = true ;
38+ $ result ['has_lists ' ] = true ;
39+ $ result ['cache_types ' ] = self ::getCacheTypes ();
40+ $ result ['log_types ' ] = self ::getLogTypes ();
41+
42+ }
3643
3744 return Okapi::formatted_response ($ request , $ result );
3845 }
46+
47+ private static function getCacheTypes () {
48+ $ rs = Db::query ("
49+ SELECT name
50+ FROM cache_type;
51+ " );
52+ $ cache_types = [];
53+ while ($ row = Db::fetch_assoc ($ rs )) {
54+ $ cache_types [] = $ row ['name ' ];
55+ }
56+ return $ cache_types ;
57+ }
58+
59+ private static function getLogTypes () {
60+ $ rs = Db::query ("
61+ SELECT name
62+ FROM log_types;
63+ " );
64+ $ log_types = [];
65+ while ($ row = Db::fetch_assoc ($ rs )) {
66+ $ log_types [] = $ row ['name ' ];
67+ }
68+ return $ log_types ;
69+ }
3970}
You can’t perform that action at this time.
0 commit comments