merge branch ?charactergroupsqueststations?
This commit is contained in:
parent
476c18b6a9
commit
538e1aa8b0
75 changed files with 19305 additions and 959 deletions
|
|
@ -39,26 +39,68 @@
|
|||
|
||||
<section>
|
||||
<h1><i class="fa fa-envelope fa-fw"></i><?=_('Description')?></h1>
|
||||
<p><?=$t->t($quest['description'])?></p>
|
||||
<div class="qtextbox">
|
||||
<p class="qtext"><?=$t->t($quest['description'])?></p>
|
||||
</div>
|
||||
<?php if(!empty($quest['rules'])) : ?>
|
||||
<h1><i class="fa fa-exclamation-triangle fa-fw"></i><?=_('Rules')?></h1>
|
||||
<p><?=$t->t($quest['rules'])?></p>
|
||||
<div class="qtextbox">
|
||||
<p class="qtext"><?=$t->t($quest['rules'])?></p>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</section>
|
||||
|
||||
<?php if(!empty($quest['won_text'])) : ?>
|
||||
<section>
|
||||
<h1><i class="fa fa-thumbs-up fa-fw"></i><?=_('Won Quest')?></h1>
|
||||
<p><?=$t->t($quest['won_text'])?></p>
|
||||
<div class="qtextbox">
|
||||
<p class="qtext"><?=$t->t($quest['won_text'])?></p>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
<?php if(!empty($quest['lost_text'])) : ?>
|
||||
<section>
|
||||
<h1><i class="fa fa-thumbs-down fa-fw"></i><?=_('Lost Quest')?></h1>
|
||||
<p><?=$t->t($quest['lost_text'])?></p>
|
||||
<div class="qtextbox">
|
||||
<p class="qtext"><?=$t->t($quest['lost_text'])?></p>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
||||
<section>
|
||||
<h1 id="stations"><i class="fa fa-map-signs fa-fw"></i><?=_('Stations')?></h1>
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
<nav class="admin">
|
||||
<ul>
|
||||
<li><a href="<?=$linker->link(array('charactergroupsqueststations','create',$seminary['url'],$groupsgroup['url'],$quest['url']))?>"><?=_('Create new station')?></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
<?php if(!empty($stations)) : ?>
|
||||
<ol class="grpqlist">
|
||||
<?php foreach($stations as &$station) : ?>
|
||||
<li>
|
||||
<?php if(array_key_exists('created', $station)) : ?>
|
||||
<span class="date">
|
||||
<?=$dateFormatter->format(new \DateTime($station['created']))?>
|
||||
<?=$timeFormatter->format(new \DateTime($station['created']))?>
|
||||
</span>
|
||||
<?php endif ?>
|
||||
<span class="group">
|
||||
<a href="<?=$linker->link(array('charactergroupsqueststations','station',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']))?>"><?=$station['title']?></a>
|
||||
</span>
|
||||
<?php if(!array_key_exists('created', $station) || $station['solved'] !== false) : ?>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
<?php else : ?>
|
||||
<p><?=sprintf(_('Your %s-group has not discovered any station yet'), $groupsgroup['name'])?>.</p>
|
||||
<?php endif ?>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h1><i class="fa fa-users fa-fw"></i><?=$groupsgroup['name']?></h1>
|
||||
<ol class="grpqlist">
|
||||
|
|
@ -71,3 +113,94 @@
|
|||
<?php endforeach ?>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
var markersSource = new ol.source.Vector({
|
||||
url: '<?=$linker->link(array('charactergroupsqueststations','index',$seminary['url'],$groupsgroup['url'],$quest['url']))?>',
|
||||
format: new ol.format.GeoJSON()
|
||||
});
|
||||
markersSource.on('change', function(e) {
|
||||
map.getView().fit(
|
||||
markersSource.getExtent(),
|
||||
map.getSize(), {
|
||||
padding: [10, 10, 10, 10]
|
||||
}
|
||||
);
|
||||
});
|
||||
/*
|
||||
var pathSource = new ol.source.Vector({
|
||||
url: '<?=$linker->link(array('charactergroupsqueststations','index',$seminary['url'],$groupsgroup['url'],$quest['url']))?>',
|
||||
format: new ol.format.GeoJSON()
|
||||
});
|
||||
*/
|
||||
var styleFunction = function(feature, resolution) {
|
||||
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'
|
||||
})
|
||||
})
|
||||
})
|
||||
);
|
||||
}
|
||||
else if(geometry instanceof ol.geom.LineString) {
|
||||
// Line styling
|
||||
styles.push(
|
||||
new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: '#50A4AB',
|
||||
width: 3
|
||||
})
|
||||
})
|
||||
);
|
||||
// Add arrows
|
||||
geometry.forEachSegment(function(start, end) {
|
||||
var dx = end[0] - start[0];
|
||||
var dy = end[1] - start[1];
|
||||
var rotation = Math.atan2(dy, dx);
|
||||
var cx = (start[0] + end[0]) / 2;
|
||||
var cy = (start[1] + end[1]) / 2;
|
||||
styles.push(new ol.style.Style({
|
||||
geometry: new ol.geom.Point([cx, cy]),
|
||||
text: new ol.style.Text({
|
||||
text: '\uf178',
|
||||
font: 'normal 28px FontAwesome',
|
||||
fill: new ol.style.Fill({
|
||||
color: '#0F373C'
|
||||
}),
|
||||
rotation: -rotation
|
||||
})
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
return styles;
|
||||
};
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
new ol.layer.Vector({
|
||||
source: markersSource,
|
||||
style: styleFunction
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
zoom: 19,
|
||||
maxZoom: 19
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
155
views/html/charactergroupsqueststations/create.tpl
Normal file
155
views/html/charactergroupsqueststations/create.tpl
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
<?=$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;
|
||||
} ?>
|
||||
</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($mimetypes 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>
|
||||
<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 'multiplechoice': echo _('Stationtype multiplechoice');
|
||||
break;
|
||||
case 'keyword': echo _('Stationtype keyword');
|
||||
break;
|
||||
} ?>
|
||||
</option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<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="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 />
|
||||
<label for="rightText"><?=('Right text')?>:</label><br />
|
||||
<textarea id="rightText" name="rightText" placeholder="<?=_('Right text')?>" style="width:100%; height:10em;"><?=$righttext?></textarea><br />
|
||||
<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({
|
||||
center: [0, 0],
|
||||
zoom: 0,
|
||||
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>
|
||||
171
views/html/charactergroupsqueststations/edit.tpl
Normal file
171
views/html/charactergroupsqueststations/edit.tpl
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
<?=$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;
|
||||
} ?>
|
||||
</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($mimetypes 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>
|
||||
<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 'multiplechoice': echo _('Stationtype multiplechoice');
|
||||
break;
|
||||
case 'keyword': echo _('Stationtype keyword');
|
||||
break;
|
||||
} ?>
|
||||
</option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<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="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 />
|
||||
<label for="rightText"><?=('Right text')?>:</label><br />
|
||||
<textarea id="rightText" name="rightText" placeholder="<?=_('Right text')?>" style="width:100%; height:10em;"><?=$righttext?></textarea><br />
|
||||
<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({
|
||||
center: [0, 0],
|
||||
zoom: 0,
|
||||
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([longitude, 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 ?>
|
||||
136
views/html/charactergroupsqueststations/station.tpl
Normal file
136
views/html/charactergroupsqueststations/station.tpl
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
<?=$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>
|
||||
|
||||
<?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 ?>
|
||||
|
||||
<?php if(array_key_exists('picture', $station)) : ?>
|
||||
<h1><?=$station['title']?></h1>
|
||||
<?php endif ?>
|
||||
<ul class="gdata cf">
|
||||
<?php if(!empty($station['longitude']) && !empty($station['latitude'])) : ?>
|
||||
<li>
|
||||
<span class="fwb"><?=sprintf(_('%1.6F°%s %1.6F°%s'), $station['latitude'], ($station['latitude']>0)?'N':'S', $station['longitude'], ($station['longitude']>0)?'E':'W')?></span>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?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>
|
||||
<?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>
|
||||
<?php if($group['solved'] !== false) : ?>
|
||||
<span class="xp">
|
||||
<i class="fa fa-check-square-o fa-fw"></i>
|
||||
<?=_(sprintf('solved at %s', $timeFormatter->format(new \DateTime($group['solved']))))?>
|
||||
</span>
|
||||
<?php endif ?>
|
||||
</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 ?>
|
||||
|
||||
<?php if(!is_null($task)) : ?>
|
||||
<section class="task">
|
||||
<h1 id="task"><?=_('Task')?></h1>
|
||||
|
||||
<?php if($solved): ?>
|
||||
<div class="text">
|
||||
<?=$t->t($station['righttext'])?>
|
||||
</div>
|
||||
<?php elseif($tried) : ?>
|
||||
<div class="text">
|
||||
<?=$t->t($station['wrongtext'])?>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="text">
|
||||
<?=$t->t($station['task'])?>
|
||||
<?=$task?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
<title><?=(isset($title)) ? $title : \nre\configs\AppConfig::$app['name']?></title>
|
||||
<link rel="icon" href="favicon.ico" type="image/x-icon">
|
||||
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet" type="text/css">
|
||||
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
|
||||
<link href="//netdna.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.css" rel="stylesheet">
|
||||
<link rel="stylesheet" type="text/css" href="<?=$linker->link(array('markitup','skins','markitup','style.css'))?>" media="all" />
|
||||
<link rel="stylesheet" type="text/css" href="<?=$linker->link(array('markitup','sets','textile','style.css'))?>" media="all" />
|
||||
<link rel="stylesheet" type="text/css" href="<?=$linker->link(array('css','desktop.css'))?>" media="all" />
|
||||
|
|
|
|||
0
views/html/qr/cgqs.tpl
Normal file
0
views/html/qr/cgqs.tpl
Normal file
|
|
@ -5,6 +5,6 @@
|
|||
<li><a href="<?=$linker->link(array('charactergroups','index',$loggedSeminary['url']))?>"><i class="fa fa-users fa-fw"></i><?=_('Character Groups')?></a></li>
|
||||
<li><a href="<?=$linker->link(array('achievements','index',$loggedSeminary['url']))?>"><i class="fa fa-trophy fa-fw"></i><?=_('Achievements')?></a></li>
|
||||
<li><a href="<?=$linker->link(array('library','index',$loggedSeminary['url']))?>"><i class="fa fa-book fa-fw"></i><?=_('Library')?></a></li>
|
||||
<?php if(!is_null($map) || count(array_intersect(array('admin','moderator'),$loggedCharacter['characterroles']))) : ?><li><a href="<?=$linker->link(array('map','index',$loggedSeminary['url']))?>"><i class="fa fa-map-marker fa-fw"></i><?=_('Map')?></a></li><?php endif ?>
|
||||
<?php if(!is_null($map) || count(array_intersect(array('admin','moderator'),$loggedCharacter['characterroles']))) : ?><li><a href="<?=$linker->link(array('map','index',$loggedSeminary['url']))?>"><i class="fa fa-map fa-fw"></i><?=_('Map')?></a></li><?php endif ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue