merge branch ?charactergroupsqueststations?

This commit is contained in:
oliver 2016-01-28 22:33:53 +01:00
commit ba97244b15
13 changed files with 700 additions and 59 deletions

View file

@ -0,0 +1 @@
<?=$file?>

View file

@ -78,27 +78,42 @@
</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">
<?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 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 ?>
<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>

View file

@ -39,6 +39,20 @@
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 ?>
@ -53,7 +67,7 @@
<input type="file" name="icon" />
<p><?=_('Allowed file types')?>:</p>
<ul>
<?php foreach($mimetypes as &$mimetype) : ?>
<?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>
@ -65,6 +79,9 @@
<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) : ?>
@ -80,16 +97,42 @@
</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 />
</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>

View file

@ -39,6 +39,20 @@
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 ?>
@ -53,7 +67,7 @@
<input type="file" name="icon" />
<p><?=_('Allowed file types')?>:</p>
<ul>
<?php foreach($mimetypes as &$mimetype) : ?>
<?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>
@ -65,6 +79,9 @@
<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) : ?>
@ -80,16 +97,75 @@
</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 />
<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" autoplay="false" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url'],'charactergroupsqueststation'))?>"></audio>
<?php else : ?>
<video controls="controls" autoplay="false" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url'],'charactergroupsqueststation'))?>"></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" autoplay="false" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongav']['url'],'charactergroupsqueststation'))?>"></audio>
<?php else : ?>
<video controls="controls" autoplay="false" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongav']['url'],'charactergroupsqueststation'))?>"></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>

View file

@ -13,9 +13,7 @@
</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>
@ -29,6 +27,10 @@
</a>
</li>
<?php endif ?>
<?php if($solved !== false) : ?>
<li>
<i class="fa fa-check-circle fa-fw"></i>
<?php endif ?>
</ul>
<?php if(!empty($station['longitude']) && !empty($station['latitude'])) : ?>
@ -94,8 +96,8 @@
<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']))))?>
<i class="fa fa-check-circle fa-fw"></i>
</span>
<?php endif ?>
</li>
@ -120,10 +122,34 @@
<?php if($solved): ?>
<div class="text">
<?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'],'charactergroupsqueststation'))?>"></audio>
<?php else : ?>
<video controls="controls" autoplay="autoplay" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url'],'charactergroupsqueststation'))?>"></video>
<?php endif ?>
<?php endif ?>
<?=$t->t($station['righttext'])?>
</div>
<?php elseif($tried) : ?>
<div class="text">
<?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'],'charactergroupsqueststation'))?>"></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>
<?php endif ?>
<?php endif ?>
<?=$t->t($station['wrongtext'])?>
</div>
<?php else : ?>