Skip to content
This repository has been archived by the owner on May 19, 2021. It is now read-only.

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
KyrneDev committed Sep 27, 2018
1 parent 520ea63 commit de9e8d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions locale/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ reflar-geotags:
admin:
permissions:
add_geotags_label: Add geotags
settings:
modal:
modal_title: Geotags Settings
api_label: Google Maps Api-key
lat: Default Latitude
long: Default Longitude

forum:
create_modal:
Expand Down
3 changes: 3 additions & 0 deletions src/Listener/AddGeotagsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ public function configureApiRoutes(ConfigureApiRoutes $event)
*/
public function prepareApiAttributes(PrepareApiAttributes $event)
{
$settings = app()->make(SettingsRepositoryInterface::class);
if ($event->isSerializer(ForumSerializer::class)) {
$event->attributes['canAddGeotags'] = $event->actor->can('reflar.geotags.create');
$event->attributes['defaultLat'] = $settings->get('reflar.geotags-default-lat');
$event->attributes['defaultLong'] = $settings->get('reflar.geotags-default-long');
}
}
}

0 comments on commit de9e8d4

Please sign in to comment.