places: hide when not configured/enabled
parent
bae5f99b2b
commit
b25731e9ac
|
@ -376,7 +376,7 @@ class ApiBase extends Controller
|
||||||
*/
|
*/
|
||||||
protected function placesIsEnabled(): bool
|
protected function placesIsEnabled(): bool
|
||||||
{
|
{
|
||||||
return \OCA\Memories\Util::placesGISType() !== 0;
|
return \OCA\Memories\Util::placesGISType() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -132,6 +132,9 @@ class PageController extends Controller
|
||||||
// Video configuration
|
// Video configuration
|
||||||
$initialState->provideInitialState('notranscode', $config->getSystemValue('memories.no_transcode', 'UNSET'));
|
$initialState->provideInitialState('notranscode', $config->getSystemValue('memories.no_transcode', 'UNSET'));
|
||||||
$initialState->provideInitialState('video_default_quality', $config->getSystemValue('memories.video_default_quality', '0'));
|
$initialState->provideInitialState('video_default_quality', $config->getSystemValue('memories.video_default_quality', '0'));
|
||||||
|
|
||||||
|
// Geo configuration
|
||||||
|
$initialState->provideInitialState('places_gis', $config->getSystemValue('memories.gis_type', '-1'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -92,8 +92,9 @@ class TimelineQuery
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$address = null;
|
$gisType = \OCA\Memories\Util::placesGISType();
|
||||||
if (!$basic && \OCA\Memories\Util::placesGISType() !== 0) {
|
$address = -1 === $gisType ? 'Geocoding Unconfigured' : null;
|
||||||
|
if (!$basic && $gisType > 0) {
|
||||||
$qb = $this->connection->getQueryBuilder();
|
$qb = $this->connection->getQueryBuilder();
|
||||||
$qb->select('e.name')
|
$qb->select('e.name')
|
||||||
->from('memories_places', 'mp')
|
->from('memories_places', 'mp')
|
||||||
|
|
|
@ -148,7 +148,7 @@ class Util
|
||||||
*/
|
*/
|
||||||
public static function placesGISType(): int
|
public static function placesGISType(): int
|
||||||
{
|
{
|
||||||
return \OC::$server->get(\OCP\IConfig::class)->getSystemValue('memories.gis_type', 0);
|
return (int) \OC::$server->get(\OCP\IConfig::class)->getSystemValue('memories.gis_type', -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -252,6 +252,7 @@ export default defineComponent({
|
||||||
name: "places",
|
name: "places",
|
||||||
icon: MarkerIcon,
|
icon: MarkerIcon,
|
||||||
title: t("memories", "Places"),
|
title: t("memories", "Places"),
|
||||||
|
if: this.config_placesGis > 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "tags",
|
name: "tags",
|
||||||
|
|
|
@ -39,6 +39,8 @@ export default defineComponent({
|
||||||
config_mapsEnabled: Boolean(loadState("memories", "maps", <string>"")),
|
config_mapsEnabled: Boolean(loadState("memories", "maps", <string>"")),
|
||||||
config_albumsEnabled: Boolean(loadState("memories", "albums", <string>"")),
|
config_albumsEnabled: Boolean(loadState("memories", "albums", <string>"")),
|
||||||
|
|
||||||
|
config_placesGis: Number(loadState("memories", "places_gis", <string>"-1")),
|
||||||
|
|
||||||
config_squareThumbs: localStorage.getItem("memories_squareThumbs") === "1",
|
config_squareThumbs: localStorage.getItem("memories_squareThumbs") === "1",
|
||||||
config_showFaceRect: localStorage.getItem("memories_showFaceRect") === "1",
|
config_showFaceRect: localStorage.getItem("memories_showFaceRect") === "1",
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ declare module "vue" {
|
||||||
config_facerecognitionEnabled: boolean;
|
config_facerecognitionEnabled: boolean;
|
||||||
config_mapsEnabled: boolean;
|
config_mapsEnabled: boolean;
|
||||||
config_albumsEnabled: boolean;
|
config_albumsEnabled: boolean;
|
||||||
|
config_placesGis: number;
|
||||||
config_squareThumbs: boolean;
|
config_squareThumbs: boolean;
|
||||||
config_showFaceRect: boolean;
|
config_showFaceRect: boolean;
|
||||||
config_eventName: string;
|
config_eventName: string;
|
||||||
|
|
Loading…
Reference in New Issue