hide Stations map if no station has been discovered yet

This commit is contained in:
oliver 2016-02-02 12:02:11 +01:00
parent 1b19187587
commit 4f0c7e2fa8
2 changed files with 5 additions and 0 deletions

View file

@ -90,6 +90,7 @@
// Get Stations
$stations = null;
$stations = $this->Charactergroupsqueststations->getStationsForQuest($quest['id']);
$stationsDiscovered = false;
foreach($stations as &$station)
{
// Icon
@ -104,6 +105,7 @@
$charactergroup['id']
);
if($station['entered']) {
$stationsDiscovered = true;
$station['tried'] = $this->Charactergroupsqueststations->hasCharactergroupTriedStation(
$station['id'],
$charactergroup['id']
@ -147,6 +149,7 @@
$this->set('quest', $quest);
$this->set('questgroup', $questgroup);
$this->set('stations', $stations);
$this->set('stationsDiscovered', $stationsDiscovered);
$this->set('groups', $groups);
$this->set('uploads', $uploads);
}

View file

@ -69,7 +69,9 @@
<section>
<h1 id="stations"><i class="fa fa-map-signs fa-fw"></i><?=_('Character Groups Quest Stations')?></h1>
<?php if($stationsDiscovered || count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
<div id="map" class="map"></div>
<?php endif ?>
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
<nav class="admin">