merge branch ?charactergroupsqueststations?

This commit is contained in:
oliver 2016-02-02 10:38:52 +01:00
commit 76ba31c04e
18 changed files with 351 additions and 84 deletions

View file

@ -12,9 +12,19 @@
floatval($station['latitude'])
);
$coordinates[] = $coordinate;
// Marker
$features[] = array(
'type' => 'Feature',
'id' => $station['id'],
'geometry' => array(
'type' => 'Point',
'coordinates' => $coordinate
)
);
// Label
$features[] = array(
'type' => 'Feature',
'id' => $station['id'].'-label',
'properties' => array(
'name' => $station['title'],
),

View file

@ -78,6 +78,7 @@
<li>
<span class="group"><a href="<?=$linker->link(array('charactergroups','group',$seminary['url'],$groupsgroup['url'],$group['url']))?>"><?=$group['name']?></a></span>
<span class="xp">
<?=sprintf(_('%dStations'), count($group['stations']))?>,
<select name="xps[<?=$group['url']?>]">
<option value="null" <?php if(is_null($group['quest_group'])) : ?>selected="selected"<?php endif ?>><?=_('Not attended')?></option>
<?php for($i=0; $i<=$quest['xps']; $i++) : ?>

View file

@ -88,9 +88,17 @@
<?=_('Station not yet discovered')?>
<?php endif ?>
</span>
<?php if(array_key_exists('solved', $station) && $station['solved']) : ?>
<?php if(array_key_exists('entered', $station) && $station['entered']) : ?>
<span class="xp">
<?php if($station['tried']) : ?>
<?php if($station['solved']) : ?>
<i class="fa fa-check-circle fa-fw"></i>
<?php else : ?>
<i class="fa fa-times-circle fa-fw"></i>
<?php endif ?>
<?php else : ?>
<i class="fa fa-globe fa-fw"></i>
<?php endif ?>
</span>
<?php endif ?>
</li>
@ -100,10 +108,18 @@
<ol class="grpqslist">
<?php foreach($stations as &$station) : ?>
<li>
<?php if(!array_key_exists('entered', $station) || $station['entered']) : ?>
<?php if(array_key_exists('entered', $station) && $station['entered']) : ?>
<a href="<?=$linker->link(array('charactergroupsqueststations','station',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']))?>">
<?php if($station['tried']) : ?>
<?php if($station['solved']) : ?>
<?php if(!is_null($station['stationpicture_id'])) : ?>
<img title="<?=$station['title']?>" src="<?=$linker->link(array('media','charactergroupsqueststation',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']))?>" />
<img title="<?=$station['title']?>" src="<?=$linker->link(array('media','charactergroupsqueststation',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']))?>" />
<?php else : ?>
<i class="fa fa-circle"></i>
<?php endif ?>
<?php else : ?>
<i class="fa fa-times-circle"></i>
<?php endif ?>
<?php else : ?>
<i class="fa fa-globe"></i>
<?php endif ?>
@ -123,7 +139,10 @@
<li>
<span class="date"><?=$dateFormatter->format(new \DateTime($group['created']))?></span>
<span class="group"><a href="<?=$linker->link(array('charactergroups','group',$seminary['url'],$groupsgroup['url'],$group['url']))?>"><?=$group['name']?></a></span>
<span class="xp"><?=sprintf(_('%dXPs'), $group['xps'])?></span>
<span class="xp">
<?=sprintf(_('%dStations'), count($group['stations']))?>,
<?=sprintf(_('%dXPs'), $group['xps'])?>
</span>
</li>
<?php endforeach ?>
</ol>
@ -152,20 +171,36 @@
var styles = [];
var geometry = feature.getGeometry();
if(geometry instanceof ol.geom.Point) {
// Point styling
styles.push(
new ol.style.Style({
text: new ol.style.Text({
//text: '\uf041',
text: '\uf276',
font: 'normal 28px FontAwesome',
textBaseline: 'Bottom',
fill: new ol.style.Fill({
color: '#0F373C'
var name = feature.get('name');
if(name) {
// Label styling
styles.push(
new ol.style.Style({
text: new ol.style.Text({
text: name,
textBaseline: 'Bottom',
offsetY: 14,
scale: 1.2
})
})
})
);
);
}
else {
// Point styling
styles.push(
new ol.style.Style({
text: new ol.style.Text({
//text: '\uf041',
text: '\uf276',
font: 'normal 28px FontAwesome',
textBaseline: 'Bottom',
fill: new ol.style.Fill({
color: '#0F373C'
})
})
})
);
}
}
else if(geometry instanceof ol.geom.LineString) {
// Line styling

View file

@ -119,9 +119,9 @@
</ul>
<?php if(array_key_exists('rightav', $station)) : ?>
<?php if(strpos($station['rightav']['mimetype'], 'audio') !== false) : ?>
<audio controls="controls" autoplay="false" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url'],'charactergroupsqueststation'))?>"></audio>
<audio controls="controls" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url']))?>"></audio>
<?php else : ?>
<video controls="controls" autoplay="false" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url'],'charactergroupsqueststation'))?>"></video>
<video controls="controls" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url']))?>"></video>
<?php endif ?>
<?php else : ?>
<i class="placeholder fa fa-film fa-4x"></i><br />
@ -153,9 +153,9 @@
</ul>
<?php if(array_key_exists('wrongav', $station)) : ?>
<?php if(strpos($station['wrongav']['mimetype'], 'audio') !== false) : ?>
<audio controls="controls" autoplay="false" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongav']['url'],'charactergroupsqueststation'))?>"></audio>
<audio controls="controls" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongav']['url']))?>"></audio>
<?php else : ?>
<video controls="controls" autoplay="false" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongav']['url'],'charactergroupsqueststation'))?>"></video>
<video controls="controls" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongav']['url']))?>"></video>
<?php endif ?>
<?php else : ?>
<i class="placeholder fa fa-film fa-4x"></i><br />

View file

@ -6,6 +6,7 @@
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>"><?=$quest['title']?></a></li>
</ul>
<h1><?=$station['title']?></h1>
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
<nav class="admin">
<li><a href="<?=$linker->link(array('edit',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']),1)?>"><?=_('edit')?></a></li>
@ -13,7 +14,6 @@
</nav>
<?php endif ?>
<h1><?=$station['title']?></h1>
<ul class="gdata cf">
<?php if(!empty($station['longitude']) && !empty($station['latitude'])) : ?>
<li>
@ -27,9 +27,14 @@
</a>
</li>
<?php endif ?>
<?php if($solved !== false) : ?>
<?php if($tried) : ?>
<li>
<?php if($solved) : ?>
<i class="fa fa-check-circle fa-fw"></i>
<?php else : ?>
<i class="fa fa-times-circle fa-fw"></i>
<?php endif ?>
</li>
<?php endif ?>
</ul>
@ -94,12 +99,19 @@
<?=$timeFormatter->format(new \DateTime($group['created']))?>
</span>
<span class="group"><a href="<?=$linker->link(array('charactergroups','group',$seminary['url'],$groupsgroup['url'],$group['url']))?>"><?=$group['name']?></a></span>
<?php if($group['solved'] !== false) : ?>
<span class="xp">
<?php if($group['tried']) : ?>
<?php if($group['solved']) : ?>
<?=_(sprintf('solved at %s', $timeFormatter->format(new \DateTime($group['solved']))))?>
<i class="fa fa-check-circle fa-fw"></i>
<?php else : ?>
<?=_(sprintf('failed at %s', $timeFormatter->format(new \DateTime($group['solved']))))?>
<i class="fa fa-times-circle fa-fw"></i>
<?php endif ?>
<?php else : ?>
<i class="fa fa-globe fa-fw"></i>
<?php endif ?>
</span>
<?php endif ?>
</li>
<?php endforeach ?>
</ol>
@ -120,6 +132,7 @@
<section class="task">
<h1 id="task"><?=_('Task')?></h1>
<?php if($tried) : ?>
<?php if($solved): ?>
<div class="text">
<?php if(array_key_exists('rightimage', $station)) : ?>
@ -129,14 +142,14 @@
<?php endif ?>
<?php if(array_key_exists('rightav', $station)) : ?>
<?php if(strpos($station['rightav']['mimetype'], 'audio') !== false) : ?>
<audio controls="controls" autoplay="autoplay" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url'],'charactergroupsqueststation'))?>"></audio>
<audio controls="controls" autoplay="autoplay" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url']))?>"></audio>
<?php else : ?>
<video controls="controls" autoplay="autoplay" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url'],'charactergroupsqueststation'))?>"></video>
<video controls="controls" autoplay="autoplay" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url']))?>"></video>
<?php endif ?>
<?php endif ?>
<?=$t->t($station['righttext'])?>
</div>
<?php elseif($tried) : ?>
<?php else : ?>
<div class="text">
<?php if(array_key_exists('wrongimage', $station)) : ?>
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongimage']['url']))?>">
@ -145,13 +158,17 @@
<?php endif ?>
<?php if(array_key_exists('wrongav', $station)) : ?>
<?php if(strpos($station['wrongav']['mimetype'], 'audio') !== false) : ?>
<audio controls="controls" autoplay="autoplay" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongav']['url'],'charactergroupsqueststation'))?>"></audio>
<audio controls="controls" autoplay="autoplay" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongav']['url']))?>"></audio>
<?php else : ?>
<video controls="controls" autoplay="autoplay" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongav']['url'],'charactergroupsqueststation'))?>" poster="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongimage']['url']))?>"></video>
<video controls="controls" autoplay="autoplay" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongav']['url']))?>"></video>
<?php endif ?>
<?php endif ?>
<?=$t->t($station['wrongtext'])?>
</div>
<?php endif ?>
<p>
<a class="cta orange" href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>"><?=_('Back to overview')?></a>
</p>
<?php else : ?>
<div class="text">
<?=$t->t($station['task'])?>

View file

@ -106,6 +106,10 @@
<div class="cond">
<input type="checkbox" id="elements_charactergroupsquests" name="elements[charactergroupsquests]" <?php if(array_key_exists('charactergroupsquests', $elements)) : ?>checked="checked"<?php endif ?> />
<label for="elements_charactergroupsquests"><?=_('Character Groups Quests')?></label>
<div class="cond">
<input type="checkbox" id="elements_charactergroupsqueststations" name="elements[charactergroupsqueststations]" <?php if(array_key_exists('charactergroupsqueststations', $elements)) : ?>checked="checked"<?php endif ?> />
<label for="elements_charactergroupsqueststations"><?=_('Character Groups Quest Stations')?></label>
</div>
</div>
<input type="checkbox" id="elements_map" name="elements[map]" <?php if(array_key_exists('map', $elements)) : ?>checked="checked"<?php endif ?> />
<label for="elements_map"><?=_('Map')?></label>