implement copying of Stations for Seminary copy feature
This commit is contained in:
commit
40a233fa7d
4342 changed files with 1215466 additions and 0 deletions
90
views/html/charactergroupsquests/create.tpl
Normal file
90
views/html/charactergroupsquests/create.tpl
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
<?=$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>
|
||||
</ul>
|
||||
|
||||
<h1><?=sprintf(_('New %s-Quest'), $groupsgroup['name'])?></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 'xps':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('XPs not set'), $value);
|
||||
break;
|
||||
case 'regex': echo _('XPs contain illegal characters');
|
||||
break;
|
||||
default: echo _('XPs 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>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input type="text" id="title" name="title" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> />
|
||||
<label for="xps"><?=_('XPs')?>:</label>
|
||||
<input type="xps" id="xps" name="xps" placeholder="<?=_('XPs')?>" title="<?=_('XPs')?>" pattern="<?=substr($validationSettings['xps']['regex'],1,strrpos($validationSettings['xps']['regex'],$validationSettings['xps']['regex'][0])-1)?>" value="<?=$xps?>" <?=(array_key_exists('xps', $validation)) ? 'class="invalid"' : null?> />
|
||||
<label for="questgroup"><?=_('Questgroup')?></label>
|
||||
<select id="questgroup" name="questgroup">
|
||||
<?php foreach($questgroups as &$questgroup) : ?>
|
||||
<option value="<?=$questgroup['url']?>" <?php if(array_key_exists('selected', $questgroup) && $questgroup['selected']) : ?>selected="selected"<?php endif ?>><?=$questgroup['title']?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<label for="description"><?=_('Description')?>:</label>
|
||||
<textarea id="description" name="description" placeholder="<?=_('Description')?>"><?=$description?></textarea>
|
||||
<label for="rules"><?=_('Rules')?>:</label>
|
||||
<textarea id="rules" name="rules" placeholder="<?=_('Rules')?>"><?=$rules?></textarea>
|
||||
<label for="wonText"><?=_('Won-text')?>:</label>
|
||||
<textarea id="wonText" name="wonText" placeholder="<?=_('Won-text')?>"><?=$wonText?></textarea>
|
||||
<label for="lostText"><?=_('Lost-text')?>:</label>
|
||||
<textarea id="lostText" name="lostText" placeholder="<?=_('Lost-text')?>"><?=$lostText?></textarea>
|
||||
</fieldset>
|
||||
<input type="submit" name="create" value="<?=_('create')?>" />
|
||||
</form>
|
||||
13
views/html/charactergroupsquests/delete.tpl
Normal file
13
views/html/charactergroupsquests/delete.tpl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?=$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>
|
||||
</ul>
|
||||
|
||||
<h1><?=sprintf(_('Delete %s-Quest'), $groupsgroup['name'])?></h1>
|
||||
<?=sprintf(_('Should the %s-Quest “%s” really be deleted?'), $groupsgroup['name'], $quest['title'])?>
|
||||
<form method="post">
|
||||
<input type="submit" name="delete" value="<?=_('delete')?>" />
|
||||
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
|
||||
</form>
|
||||
99
views/html/charactergroupsquests/edit.tpl
Normal file
99
views/html/charactergroupsquests/edit.tpl
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
<?=$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>
|
||||
</ul>
|
||||
|
||||
<h1><?=sprintf(_('Edit %s-Quest'), $groupsgroup['name'])?></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 'xps':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('XPs not set'), $value);
|
||||
break;
|
||||
case 'regex': echo _('XPs contain illegal characters');
|
||||
break;
|
||||
default: echo _('XPs 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>
|
||||
<img src="<?=$linker->link(array('media','charactergroupsquest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>" /><br />
|
||||
<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>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input type="text" id="title" name="title" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> />
|
||||
<label for="xps"><?=_('XPs')?>:</label>
|
||||
<input type="number" id="xps" name="xps" placeholder="<?=_('XPs')?>" title="<?=_('XPs')?>" pattern="<?=substr($validationSettings['xps']['regex'],1,strrpos($validationSettings['xps']['regex'],$validationSettings['xps']['regex'][0])-1)?>" value="<?=$xps?>" <?=(array_key_exists('xps', $validation)) ? 'class="invalid"' : null?> />
|
||||
<label for="questgroup"><?=_('Questgroup')?></label>
|
||||
<select id="questgroup" name="questgroup">
|
||||
<?php foreach($questgroups as &$questgroup) : ?>
|
||||
<option value="<?=$questgroup['url']?>" <?php if(array_key_exists('selected', $questgroup) && $questgroup['selected']) : ?>selected="selected"<?php endif ?>><?=$questgroup['title']?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<label for="description"><?=_('Description')?>:</label>
|
||||
<textarea id="description" name="description" placeholder="<?=_('Description')?>"><?=$description?></textarea>
|
||||
<label for="rules"><?=_('Rules')?>:</label>
|
||||
<textarea id="rules" name="rules" placeholder="<?=_('Rules')?>"><?=$rules?></textarea>
|
||||
<label for="wonText"><?=_('Won-text')?>:</label>
|
||||
<textarea id="wonText" name="wonText" placeholder="<?=_('Won-text')?>"><?=$wonText?></textarea>
|
||||
<label for="lostText"><?=_('Lost-text')?>:</label>
|
||||
<textarea id="lostText" name="lostText" placeholder="<?=_('Lost-text')?>"><?=$lostText?></textarea>
|
||||
</fieldset>
|
||||
<input type="submit" name="edit" value="<?=_('edit')?>" />
|
||||
</form>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#description").markItUp(mySettings);
|
||||
$("#rules").markItUp(mySettings);
|
||||
$("#wonText").markItUp(mySettings);
|
||||
$("#lostText").markItUp(mySettings);
|
||||
});
|
||||
</script>
|
||||
93
views/html/charactergroupsquests/manage.tpl
Normal file
93
views/html/charactergroupsquests/manage.tpl
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
<?=$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>
|
||||
</ul>
|
||||
|
||||
<div class="gbanner cf">
|
||||
<?php if(!is_null($media)) : ?>
|
||||
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$media['url']))?>" class="grpqimg" />
|
||||
<?php else : ?>
|
||||
<img src="<?=$linker->link(array('grafics','charactergroup.jpg'))?>" class="gbanner">
|
||||
<?php endif ?>
|
||||
<h1><?=$quest['title']?></h1>
|
||||
</div>
|
||||
<ul class="gdata cf">
|
||||
<li><span class="fwb"><?=sprintf(_('%d XPs'), $quest['xps'])?></span></li>
|
||||
<li><?php if($questgroup['entered']) : ?><a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$questgroup['url']))?>"><?=$questgroup['title']?></a><?php else : ?><?=$questgroup['title']?><?php endif ?></li>
|
||||
</ul>
|
||||
|
||||
<section>
|
||||
<h1><i class="fa fa-picture-o fa-fw"></i><?=_('Media')?></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 'media':
|
||||
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 class="mng" method="post" enctype="multipart/form-data">
|
||||
<ul class="gqgllry mnglst">
|
||||
<?php foreach($uploads as &$upload) : ?>
|
||||
<li>
|
||||
<input type="checkbox" id="upload_<?=$upload['upload']['id']?>" name="uploads[]" value="<?=$upload['upload']['id']?>" />
|
||||
<br />
|
||||
<label for="upload_<?=$upload['upload']['id']?>">
|
||||
<a href="<?=$linker->link(array('uploads','seminary',$seminary['url'],$upload['upload']['url']))?>">
|
||||
<img src="<?=$linker->link(array('uploads','seminary',$seminary['url'],$upload['upload']['url'],'thumbnail'))?>" />
|
||||
</a>
|
||||
<label>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<input type="submit" name="deletemedia" value="<?=_('delete selected')?>" />
|
||||
</form>
|
||||
<form class="mng" method="post" enctype="multipart/form-data">
|
||||
<input type="file" name="media" /><br />
|
||||
<p><?=_('Allowed file types')?>: <?php foreach($mimetypes as &$mimetype) : ?><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB) <?php endif ?><?php endforeach ?></p>
|
||||
<input type="submit" name="setmedia" value="<?=_('upload')?>" />
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h1><i class="fa fa-users fa-fw"></i><?=$groupsgroup['name']?></h1>
|
||||
<form method="post">
|
||||
<ul class="grpqlist">
|
||||
<?php foreach($groups as &$group) : ?>
|
||||
<li>
|
||||
<span class="group"><a href="<?=$linker->link(array('charactergroups','group',$seminary['url'],$groupsgroup['url'],$group['url']))?>"><?=$group['name']?></a></span>
|
||||
<span class="xp">
|
||||
<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++) : ?>
|
||||
<option value="<?=$i?>" <?php if(!is_null($group['quest_group']) && $group['quest_group']['xps'] == $i) : ?>selected="selected"<?php endif ?>><?=sprintf(_('%d XPs'), $i)?></option>
|
||||
<?php endfor ?>
|
||||
</select>
|
||||
</span>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<input type="submit" name="setxps" value="<?=_('Set XPs')?>" />
|
||||
</form>
|
||||
</section>
|
||||
221
views/html/charactergroupsquests/quest.tpl
Normal file
221
views/html/charactergroupsquests/quest.tpl
Normal file
|
|
@ -0,0 +1,221 @@
|
|||
<?=$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>
|
||||
</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']),1)?>"><?=sprintf(_('Edit %s-Quest'), $groupsgroup['name'])?></a></li>
|
||||
<li><a href="<?=$linker->link(array('delete',$seminary['url'],$groupsgroup['url'],$quest['url']),1)?>"><?=sprintf(_('Delete %s-Quest'), $groupsgroup['name'])?></a></li>
|
||||
<li><a href="<?=$linker->link(array('manage',$seminary['url'],$groupsgroup['url'],$quest['url']),1)?>"><?=sprintf(_('Manage %s-Quest'), $groupsgroup['name'])?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
|
||||
<div class="gbanner cf">
|
||||
<img src="<?=$linker->link(array('media','charactergroupsquest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>" class="grpqimg" />
|
||||
<h1><?=$quest['title']?></h1>
|
||||
</div>
|
||||
<ul class="gdata cf">
|
||||
<li><span class="fwb"><?=sprintf(_('%d XPs'), $quest['xps'])?></span></li>
|
||||
<li><?php if($questgroup['entered']) : ?><a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$questgroup['url']))?>"><?=$questgroup['title']?></a><?php else : ?><?=$questgroup['title']?><?php endif ?></li>
|
||||
</ul>
|
||||
|
||||
<?php if(count($uploads) > 0) : ?>
|
||||
<section>
|
||||
<h1><i class="fa fa-picture-o fa-fw"></i><?=_('Media')?></h1>
|
||||
<ul class="gqgllry">
|
||||
<?php foreach($uploads as &$upload) : ?>
|
||||
<li>
|
||||
<a href="<?=$linker->link(array('uploads','seminary',$seminary['url'],$upload['upload']['url']))?>">
|
||||
<img src="<?=$linker->link(array('uploads','seminary',$seminary['url'],$upload['upload']['url'],'thumbnail'))?>" />
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
||||
<section>
|
||||
<h1><i class="fa fa-envelope fa-fw"></i><?=_('Description')?></h1>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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 ?>
|
||||
<ol class="grpqlist">
|
||||
<?php foreach($stations as &$station) : ?>
|
||||
<li>
|
||||
<span class="group">
|
||||
<?php if(!array_key_exists('entered', $station) || $station['entered']) : ?>
|
||||
<a href="<?=$linker->link(array('charactergroupsqueststations','station',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']))?>"><?=$station['title']?></a>
|
||||
<?php else : ?>
|
||||
<?=_('Station not yet discovered')?>
|
||||
<?php endif ?>
|
||||
</span>
|
||||
<?php if(array_key_exists('solved', $station) && $station['solved']) : ?>
|
||||
<span class="xp">
|
||||
<i class="fa fa-check-circle fa-fw"></i>
|
||||
</span>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
|
||||
<ol class="grpqslist">
|
||||
<?php foreach($stations as &$station) : ?>
|
||||
<li>
|
||||
<?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(!is_null($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-globe"></i>
|
||||
<?php endif ?>
|
||||
</a>
|
||||
<?php else : ?>
|
||||
<i class="fa fa-question-circle"></i>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h1><i class="fa fa-users fa-fw"></i><?=$groupsgroup['name']?></h1>
|
||||
<ol class="grpqlist">
|
||||
<?php foreach($groups as &$group) : ?>
|
||||
<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(_('%d XPs'), $group['xps'])?></span>
|
||||
</li>
|
||||
<?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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue