add media to right/wrong text of Character group Quest Stations

This commit is contained in:
oliver 2016-01-24 19:36:05 +01:00
commit efd304833c
8 changed files with 547 additions and 22 deletions

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

@ -122,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 : ?>