hide map for Character groups Quest Stations when there are no stations
This commit is contained in:
commit
df14dfafc3
4371 changed files with 1220224 additions and 0 deletions
205
views/html/charactergroupsqueststations/create.tpl
Normal file
205
views/html/charactergroupsqueststations/create.tpl
Normal file
|
|
@ -0,0 +1,205 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','index',$seminary['url']))?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
<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><?=_('New Station')?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'icon':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during icon upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('Icon has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('Icon exceeds size maximum');
|
||||
break;
|
||||
default: echo _('Icon invalid');
|
||||
}
|
||||
break;
|
||||
case 'title':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Title is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Title is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Title contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Title already exists');
|
||||
break;
|
||||
default: echo _('Title invalid');
|
||||
}
|
||||
break;
|
||||
case 'rightimage':
|
||||
case 'rightav':
|
||||
case 'wrongimage':
|
||||
case 'wrongav':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during file upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('File has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('File exceeds size maximum');
|
||||
break;
|
||||
default: echo _('File invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post" action="" class="logreg" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<legend><?=_('Icon')?></legend>
|
||||
<input type="file" name="icon" />
|
||||
<p><?=_('Allowed file types')?>:</p>
|
||||
<ul>
|
||||
<?php foreach($iconMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Location')?></legend>
|
||||
<div id="map" class="map"></div>
|
||||
<input id="longitude" name="longitude" type="hidden" value="<?=$longitude?>" />
|
||||
<input id="latitude" name="latitude" type="hidden" value="<?=$latitude?>" />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Basic data')?></legend>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input type="text" id="title" name="title" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=($validation !== true && array_key_exists('title', $validation)) ? 'class="invalid"' : null?> />
|
||||
<label for="stationtype"><?=('Stationtype')?>:</label>
|
||||
<select id="stationtype" name="stationtype">
|
||||
<?php foreach($stationtypes as &$stationtype) : ?>
|
||||
<option value="<?=$stationtype['url']?>" <?php if($stationtype['selected']) : ?>selected="selected"<?php endif ?>>
|
||||
<?php switch($stationtype['classname']) {
|
||||
case null: echo _('Stationttype Empty');
|
||||
break;
|
||||
case 'singlechoice': echo _('Stationtype singlechoice');
|
||||
break;
|
||||
case 'multiplechoice': echo _('Stationtype multiplechoice');
|
||||
break;
|
||||
case 'keyword': echo _('Stationtype keyword');
|
||||
break;
|
||||
} ?>
|
||||
</option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<label for="prolog"><?=_('Prolog')?>:</label><br />
|
||||
<textarea id="prolog" name="prolog" placeholder="<?=_('Prolog')?>" style="width:100%; height:10em;"><?=$prolog?></textarea><br />
|
||||
<label for="task"><?=_('Task')?>:</label><br />
|
||||
<textarea id="task" name="task" placeholder="<?=_('Task')?>" style="width:100%; height:10em;"><?=$task?></textarea><br />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Correctly solved')?></legend>
|
||||
<input type="file" name="rightimage" />
|
||||
<ul>
|
||||
<?php foreach($imageMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<input type="file" name="rightav" />
|
||||
<ul>
|
||||
<?php foreach($avMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<label for="rightText"><?=('Right text')?>:</label><br />
|
||||
<textarea id="rightText" name="rightText" placeholder="<?=_('Right text')?>" style="width:100%; height:10em;"><?=$righttext?></textarea><br />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Incorreclty solved')?></legend>
|
||||
<input type="file" name="wrongimage" />
|
||||
<ul>
|
||||
<?php foreach($imageMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<input type="file" name="wrongav" />
|
||||
<ul>
|
||||
<?php foreach($avMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<label for="wrongText"><?=_('Wrong text')?>:</label><br />
|
||||
<textarea id="wrongText" name="wrongText" placeholder="<?=_('Wrong text')?>" style="width:100%; height:10em;"><?=$wrongtext?></textarea><br />
|
||||
</fieldset>
|
||||
<input type="submit" name="create" value="<?=_('create')?>" />
|
||||
</form>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#prolog").markItUp(mySettings);
|
||||
$("#task").markItUp(mySettings);
|
||||
$("#rightText").markItUp(mySettings);
|
||||
$("#wrongText").markItUp(mySettings);
|
||||
});
|
||||
|
||||
var drawSource = new ol.source.Vector({
|
||||
wrapX: false
|
||||
});
|
||||
var drawLayer = new ol.layer.Vector({
|
||||
source: drawSource,
|
||||
style: 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 map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
drawLayer
|
||||
],
|
||||
controls: ol.control.defaults(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
<?php if(!is_null($seminary['latitude']) && !is_null($seminary['longitude'])) : ?>
|
||||
center: ol.proj.transform([<?=$seminary['longitude']?>, <?=$seminary['latitude']?>], 'EPSG:4326', 'EPSG:3857'),
|
||||
zoom: 15,
|
||||
<?php else : ?>
|
||||
center: [0, 0],
|
||||
zoom: 0,
|
||||
<?php endif ?>
|
||||
maxZoom: 19
|
||||
})
|
||||
});
|
||||
var draw = new ol.interaction.Draw({
|
||||
source: drawSource,
|
||||
type: 'Point',
|
||||
maxPoints: 1,
|
||||
});
|
||||
map.addInteraction(draw);
|
||||
|
||||
// Wire events
|
||||
drawSource.on('addfeature', function(event) {
|
||||
var coordinates = event.feature.getGeometry().getCoordinates();
|
||||
coordinates = ol.proj.transform(coordinates, 'EPSG:3857', 'EPSG:4326');
|
||||
$('#longitude').val(coordinates[0]);
|
||||
$('#latitude').val(coordinates[1]);
|
||||
});
|
||||
draw.on('drawstart', function() {
|
||||
drawSource.clear();
|
||||
});
|
||||
</script>
|
||||
14
views/html/charactergroupsqueststations/delete.tpl
Normal file
14
views/html/charactergroupsqueststations/delete.tpl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','index',$seminary['url']))?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
<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><?=_('Delete Station')?></h1>
|
||||
<?=sprintf(_('Should the Station “%s” really be deleted?'), $station['title'])?>
|
||||
<form method="post">
|
||||
<input type="submit" name="delete" value="<?=_('delete')?>" />
|
||||
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
|
||||
</form>
|
||||
254
views/html/charactergroupsqueststations/edit.tpl
Normal file
254
views/html/charactergroupsqueststations/edit.tpl
Normal file
|
|
@ -0,0 +1,254 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','index',$seminary['url']))?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
<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><?=_('Edit Station')?></h1>
|
||||
<?php if($validation !== true && !empty($validation)) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($validation as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'icon':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during icon upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('Icon has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('Icon exceeds size maximum');
|
||||
break;
|
||||
default: echo _('Icon invalid');
|
||||
}
|
||||
break;
|
||||
case 'title':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Title is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Title is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'regex': echo _('Title contains illegal characters');
|
||||
break;
|
||||
case 'exist': echo _('Title already exists');
|
||||
break;
|
||||
default: echo _('Title invalid');
|
||||
}
|
||||
break;
|
||||
case 'rightimage':
|
||||
case 'rightav':
|
||||
case 'wrongimage':
|
||||
case 'wrongav':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during file upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('File has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('File exceeds size maximum');
|
||||
break;
|
||||
default: echo _('File invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post" action="" class="logreg" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<legend><?=_('Icon')?></legend>
|
||||
<input type="file" name="icon" />
|
||||
<p><?=_('Allowed file types')?>:</p>
|
||||
<ul>
|
||||
<?php foreach($iconMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Location')?></legend>
|
||||
<div id="map" class="map"></div>
|
||||
<input id="longitude" name="longitude" type="hidden" value="<?=$longitude?>" />
|
||||
<input id="latitude" name="latitude" type="hidden" value="<?=$latitude?>" />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Basic data')?></legend>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input type="text" id="title" name="title" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=($validation !== true && array_key_exists('title', $validation)) ? 'class="invalid"' : null?> />
|
||||
<label for="stationtype"><?=('Stationtype')?>:</label>
|
||||
<select id="stationtype" name="stationtype">
|
||||
<?php foreach($stationtypes as &$stationtype) : ?>
|
||||
<option value="<?=$stationtype['url']?>" <?php if($stationtype['selected']) : ?>selected="selected"<?php endif ?>>
|
||||
<?php switch($stationtype['classname']) {
|
||||
case null: echo _('Stationttype Empty');
|
||||
break;
|
||||
case 'singlechoice': echo _('Stationtype singlechoice');
|
||||
break;
|
||||
case 'multiplechoice': echo _('Stationtype multiplechoice');
|
||||
break;
|
||||
case 'keyword': echo _('Stationtype keyword');
|
||||
break;
|
||||
} ?>
|
||||
</option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<label for="prolog"><?=_('Prolog')?>:</label><br />
|
||||
<textarea id="prolog" name="prolog" placeholder="<?=_('Prolog')?>" style="width:100%; height:10em;"><?=$prolog?></textarea><br />
|
||||
<label for="task"><?=_('Task')?>:</label><br />
|
||||
<textarea id="task" name="task" placeholder="<?=_('Task')?>" style="width:100%; height:10em;"><?=$task?></textarea><br />
|
||||
<fieldset>
|
||||
<legend><?=_('Correctly solved')?></legend>
|
||||
<?php if(array_key_exists('rightimage', $station)) : ?>
|
||||
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightimage']['url']))?>">
|
||||
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightimage']['url'],'charactergroupsqueststation'))?>" />
|
||||
</a>
|
||||
<?php else : ?>
|
||||
<i class="placeholder fa fa-picture-o fa-4x"></i><br />
|
||||
<?php endif ?>
|
||||
<br />
|
||||
<input type="file" name="rightimage" />
|
||||
<ul>
|
||||
<?php foreach($imageMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php if(array_key_exists('rightav', $station)) : ?>
|
||||
<?php if(strpos($station['rightav']['mimetype'], 'audio') !== false) : ?>
|
||||
<audio controls="controls" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url']))?>"></audio>
|
||||
<?php else : ?>
|
||||
<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 />
|
||||
<?php endif ?>
|
||||
<input type="file" name="rightav" />
|
||||
<ul>
|
||||
<?php foreach($avMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<label for="rightText"><?=('Right text')?>:</label><br />
|
||||
<textarea id="rightText" name="rightText" placeholder="<?=_('Right text')?>" style="width:100%; height:10em;"><?=$righttext?></textarea><br />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Incorreclty solved')?></legend>
|
||||
<?php if(array_key_exists('wrongimage', $station)) : ?>
|
||||
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongimage']['url']))?>">
|
||||
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongimage']['url'],'charactergroupsqueststation'))?>" />
|
||||
</a>
|
||||
<?php else : ?>
|
||||
<i class="placeholder fa fa-picture-o fa-4x"></i><br />
|
||||
<?php endif ?>
|
||||
<br />
|
||||
<input type="file" name="wrongimage" />
|
||||
<ul>
|
||||
<?php foreach($imageMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php if(array_key_exists('wrongav', $station)) : ?>
|
||||
<?php if(strpos($station['wrongav']['mimetype'], 'audio') !== false) : ?>
|
||||
<audio controls="controls" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongav']['url']))?>"></audio>
|
||||
<?php else : ?>
|
||||
<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 />
|
||||
<?php endif ?>
|
||||
<input type="file" name="wrongav" />
|
||||
<ul>
|
||||
<?php foreach($avMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<label for="wrongText"><?=_('Wrong text')?>:</label><br />
|
||||
<textarea id="wrongText" name="wrongText" placeholder="<?=_('Wrong text')?>" style="width:100%; height:10em;"><?=$wrongtext?></textarea><br />
|
||||
</fieldset>
|
||||
<?php if(!is_null($stationtype['classname'])) : ?>
|
||||
<input type="submit" name="edit-task" value="<?=_('edit task')?>" />
|
||||
<?php endif ?>
|
||||
<input type="submit" name="edit" value="<?=_('save')?>" />
|
||||
</form>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#prolog").markItUp(mySettings);
|
||||
$("#task").markItUp(mySettings);
|
||||
$("#rightText").markItUp(mySettings);
|
||||
$("#wrongText").markItUp(mySettings);
|
||||
});
|
||||
|
||||
var drawSource = new ol.source.Vector({
|
||||
wrapX: false
|
||||
});
|
||||
var drawLayer = new ol.layer.Vector({
|
||||
source: drawSource,
|
||||
style: 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 map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
drawLayer
|
||||
],
|
||||
controls: ol.control.defaults(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
<?php if(!is_null($latitude) && !is_null($longitude)) : ?>
|
||||
center: ol.proj.transform([<?=$longitude?>, <?=$latitude?>], 'EPSG:4326', 'EPSG:3857'),
|
||||
zoom: 17,
|
||||
<?php else : ?>
|
||||
center: [0, 0],
|
||||
zoom: 0,
|
||||
<?php endif ?>
|
||||
maxZoom: 19
|
||||
})
|
||||
});
|
||||
var draw = new ol.interaction.Draw({
|
||||
source: drawSource,
|
||||
type: 'Point',
|
||||
maxPoints: 1,
|
||||
});
|
||||
map.addInteraction(draw);
|
||||
|
||||
// Add existing point
|
||||
var longitude = $('#longitude').val();
|
||||
var latitude = $('#latitude').val();
|
||||
if(longitude && latitude) {
|
||||
drawSource.addFeature(
|
||||
new ol.Feature({
|
||||
geometry: new ol.geom.Point(
|
||||
ol.proj.transform([parseFloat(longitude), parseFloat(latitude)], 'EPSG:4326', 'EPSG:3857')
|
||||
)
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
// Wire events
|
||||
drawSource.on('addfeature', function(event) {
|
||||
var coordinates = event.feature.getGeometry().getCoordinates();
|
||||
coordinates = ol.proj.transform(coordinates, 'EPSG:3857', 'EPSG:4326');
|
||||
$('#longitude').val(coordinates[0]);
|
||||
$('#latitude').val(coordinates[1]);
|
||||
});
|
||||
draw.on('drawstart', function() {
|
||||
drawSource.clear();
|
||||
});
|
||||
</script>
|
||||
12
views/html/charactergroupsqueststations/edittask.tpl
Normal file
12
views/html/charactergroupsqueststations/edittask.tpl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','index',$seminary['url']))?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
<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><?=_('Edit Station task')?></h1>
|
||||
<?php if(!is_null($task)) : ?>
|
||||
<?=$task?>
|
||||
<?php endif ?>
|
||||
223
views/html/charactergroupsqueststations/station.tpl
Normal file
223
views/html/charactergroupsqueststations/station.tpl
Normal file
|
|
@ -0,0 +1,223 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','index',$seminary['url']))?>"><?=_('Character Groups')?></a></li>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroups','groupsgroup',$seminary['url'],$groupsgroup['url']))?>"><?=$groupsgroup['name']?></a></li>
|
||||
<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>
|
||||
|
||||
<div class="grpqsicon">
|
||||
<?php if($entered) : ?>
|
||||
<?php if($tried) : ?>
|
||||
<?php if($solved) : ?>
|
||||
<?php if($station['stationpicture_id']) : ?>
|
||||
<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 : ?>
|
||||
<?php if(!is_null($stationgroup)) : ?>
|
||||
<img title="<?=$station['title']?>" src="<?=$linker->link(array('media','charactergroupsqueststation',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']),0,true,array('stationgroup'=>$stationgroup['id']))?>" />
|
||||
<?php else : ?>
|
||||
<img title="<?=$station['title']?>" src="<?=$linker->link(array('media','charactergroupsqueststation',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']),0,true)?>" />
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<i class="fa fa-question-circle"></i>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<li><a href="<?=$linker->link(array('delete',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']),1)?>"><?=_('delete')?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
|
||||
<ul class="gdata cf">
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<li>
|
||||
<a href="<?=$linker->link(array('qrcodes','charactergroupsqueststation',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url'],'50'))?>">
|
||||
<i class="fa fa-qrcode"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<?php if(count($stationgroups) > 1) : ?>
|
||||
<form method="get">
|
||||
<select id="stationgroup" name="stationgroup" onchange="this.form.submit();">
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<option><?=sprintf(_('Select %s-Group'), $groupsgroup['name'])?></option>
|
||||
<?php endif ?>
|
||||
<?php foreach($stationgroups as &$group) : ?>
|
||||
<option value="<?=$group['id']?>" <?php if($group['id'] == $stationgroup['id']) : ?>selected="selected"<?php endif ?>><?=$group['name']?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</form>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php if($entered) : ?>
|
||||
<li>
|
||||
<?php if($tried) : ?>
|
||||
<?php if($solved) : ?>
|
||||
<i class="fa fa-check-circle fa-fw"></i>
|
||||
<?=$dateFormatter->format(new \DateTime($solved))?>
|
||||
<?=$timeFormatter->format(new \DateTime($solved))?>
|
||||
<?php else : ?>
|
||||
<i class="fa fa-times-circle fa-fw"></i>
|
||||
<?=$dateFormatter->format(new \DateTime($tried))?>
|
||||
<?=$timeFormatter->format(new \DateTime($tried))?>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<i class="fa fa-globe fa-fw"></i>
|
||||
<?=$dateFormatter->format(new \DateTime($entered))?>
|
||||
<?=$timeFormatter->format(new \DateTime($entered))?>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
|
||||
<?php if(!empty($station['longitude']) && !empty($station['latitude'])) : ?>
|
||||
<section>
|
||||
<div id="map" class="map"></div>
|
||||
<script type="text/javascript">
|
||||
var center = ol.proj.transform([<?=$station['longitude']?>, <?=$station['latitude']?>], 'EPSG:4326', 'EPSG:3857');
|
||||
|
||||
var markersSource = new ol.source.Vector();
|
||||
markersSource.addFeature(
|
||||
new ol.Feature({
|
||||
geometry: new ol.geom.Point(
|
||||
ol.proj.transform([<?=$station['longitude']?>, <?=$station['latitude']?>], 'EPSG:4326', 'EPSG:3857')
|
||||
),
|
||||
name: '<?=$station['title']?>'
|
||||
})
|
||||
);
|
||||
var markersStyle = 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 markersLayer = new ol.layer.Vector({
|
||||
source: markersSource,
|
||||
style: markersStyle
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
markersLayer
|
||||
],
|
||||
controls: ol.control.defaults(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: center,
|
||||
zoom: 18,
|
||||
maxZoom: 19
|
||||
})
|
||||
});
|
||||
</script>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if(!empty($groups)) : ?>
|
||||
<section>
|
||||
<h1><?=_('Character Groups')?></h1>
|
||||
<ol class="grpqlist">
|
||||
<?php foreach($groups as &$group) : ?>
|
||||
<li>
|
||||
<span class="date">
|
||||
<?=$dateFormatter->format(new \DateTime($group['created']))?>
|
||||
<?=$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>
|
||||
<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>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if(!empty($station['prolog'])) : ?>
|
||||
<section>
|
||||
<div class="qtextbox">
|
||||
<p class="qtext cf">
|
||||
<?=str_replace('<p>', '', str_replace('</p>', '', $t->t($station['prolog'])))?>
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
||||
<section class="task">
|
||||
<?php if(!is_null($task)) : ?>
|
||||
<h1 id="task"><?=_('Task')?></h1>
|
||||
|
||||
<?php if($solved) : ?>
|
||||
<div class="success">
|
||||
<p class="fwb"><i class="fa fa-check-circle fa-fw"></i><?=_('solved')?></p>
|
||||
<p><small><?=$t->t($station['righttext'])?></small></p>
|
||||
<?php if(array_key_exists('rightimage', $station)) : ?>
|
||||
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightimage']['url']))?>">
|
||||
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightimage']['url'],'charactergroupsqueststation'))?>" />
|
||||
</a><br />
|
||||
<?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']))?>"></audio>
|
||||
<?php else : ?>
|
||||
<video controls="controls" autoplay="autoplay" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url']))?>"></video>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php elseif($tried) : ?>
|
||||
<div class="error">
|
||||
<p class="fwb"><i class="fa fa-times-circle fa-fw"></i><?=_('unsolved')?></p>
|
||||
<p><small><?=$t->t($station['wrongtext'])?></small></p>
|
||||
<?php if(array_key_exists('wrongimage', $station)) : ?>
|
||||
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongimage']['url']))?>">
|
||||
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongimage']['url'],'charactergroupsqueststation'))?>" />
|
||||
</a><br />
|
||||
<?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']))?>"></audio>
|
||||
<?php else : ?>
|
||||
<video controls="controls" autoplay="autoplay" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongav']['url']))?>"></video>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<div>
|
||||
<?=$t->t($station['task'])?>
|
||||
<?=$task?>
|
||||
</div>
|
||||
<?php if($tried) : ?>
|
||||
<p><a class="cta orange" href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>"><?=_('Back to overview')?></a></p>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<p><a class="cta orange" href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>"><?=_('Back to overview')?></a></p>
|
||||
<?php endif ?>
|
||||
</section>
|
||||
Loading…
Add table
Add a link
Reference in a new issue