improve map implementation including edit functionality
This commit is contained in:
parent
d561cc78ed
commit
1f1d91850e
10 changed files with 341 additions and 10 deletions
51
views/html/map/edit.tpl
Normal file
51
views/html/map/edit.tpl
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
<?php if(!is_null($seminary['seminarymedia_id'])) : ?>
|
||||
<div class="moodpic">
|
||||
<img src="<?=$linker->link(array('media','seminarymoodpic',$seminary['url'], 'map'))?>">
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<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('index',$seminary['url']),1)?>"><?=_('Map')?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><i class="fa fa-map-marker fa-fw"></i><?=_('Map')?></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 method="post" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<input type="file" name="media" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" />
|
||||
<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>
|
||||
<input type="submit" name="edit" value="<?=_('save')?>" />
|
||||
</form>
|
||||
|
|
@ -1,13 +1,19 @@
|
|||
<?php if(!is_null($seminary['seminarymedia_id'])) : ?>
|
||||
<div class="moodpic">
|
||||
<img src="<?=$linker->link(array('media','seminarymoodpic',$seminary['url']))?>">
|
||||
<img src="<?=$linker->link(array('media','seminarymoodpic',$seminary['url'], 'map'))?>">
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><i class="fa fa-map-marker fa-fw"></i><?=_('Map')?></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']), 1)?>"><?=_('Edit Map')?></a></li>
|
||||
<li><a href="<?=$linker->link(array('delete',$seminary['url']), 1)?>"><?=_('Delete Map')?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
<div id="map" class="map" style="background-image:url('<?=$linker->link(array('grafics','paper.jpg'))?>')"></div>
|
||||
<script type="text/javascript">
|
||||
var extent = [0, 0, <?=$map['width']?>, <?=$map['height']?>];
|
||||
|
|
|
|||
|
|
@ -111,6 +111,8 @@
|
|||
<input type="checkbox" id="elements_charactergroupsquests" name="elements[charactergroupsquests]" <?php if(array_key_exists('charactergroupsquests', $elements)) : ?>checked="checked"<?php endif ?> />
|
||||
<label for="elements_charactergroupsquests"><?=_('Character Groups Quests')?></label>
|
||||
</div>
|
||||
<input type="checkbox" id="elements_map" name="elements[map]" <?php if(array_key_exists('map', $elements)) : ?>checked="checked"<?php endif ?> />
|
||||
<label for="elements_map"><?=_('Map')?></label>
|
||||
</fieldset>
|
||||
<input type="submit" name="edit" value="<?=_('copy')?>" />
|
||||
</form>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue