implement copying of Stations for Seminary copy feature
This commit is contained in:
commit
40a233fa7d
4342 changed files with 1215466 additions and 0 deletions
41
views/html/charactertypes/create.tpl
Normal file
41
views/html/charactertypes/create.tpl
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?=$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('index',$seminary['url']),1)?>"><?=_('Charactertypes')?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Create new Charactertype')?></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 'charactertypename':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Name is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Name is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'exist': echo _('Name already exists');
|
||||
break;
|
||||
default: echo _('Name invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post">
|
||||
<fieldset>
|
||||
<label for="name"><?=_('Name')?>:</legend>
|
||||
<input id="name" type="text" name="charactertypename" placeholder="<?=_('Name')?>" title="<?=_('Name')?>" required="required" maxlength="<?=$validationSettings['charactertypename']['maxlength']?>" value="<?=$name?>" <?=($validation !== true && array_key_exists('name', $validation)) ? 'class="invalid"' : null?> />
|
||||
</fieldset>
|
||||
<input type="submit" name="create" value="<?=_('create')?>" />
|
||||
</form>
|
||||
12
views/html/charactertypes/delete.tpl
Normal file
12
views/html/charactertypes/delete.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('index',$seminary['url']),1)?>"><?=_('Charactertypes')?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Delete Charactertype')?></h1>
|
||||
<?=sprintf(_('Should the Characterytpe “%s” really be deleted?'), $charactertype['name'])?>
|
||||
<form method="post">
|
||||
<input type="submit" name="delete" value="<?=_('delete')?>" />
|
||||
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
|
||||
</form>
|
||||
139
views/html/charactertypes/edit.tpl
Normal file
139
views/html/charactertypes/edit.tpl
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
<?=$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('index',$seminary['url']),1)?>"><?=_('Charactertypes')?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Edit Charactertype')?></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 'charactertypename':
|
||||
switch($setting) {
|
||||
case 'minlength': printf(_('Name is too short (min. %d chars)'), $value);
|
||||
break;
|
||||
case 'maxlength': printf(_('Name is too long (max. %d chars)'), $value);
|
||||
break;
|
||||
case 'exist': echo _('Name already exists');
|
||||
break;
|
||||
default: echo _('Name invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<label for="name"><?=_('Name')?>:</label>
|
||||
<input id="name" type="text" name="charactertypename" placeholder="<?=_('Name')?>" title="<?=_('Name')?>" required="required" maxlength="<?=$validationSettings['charactertypename']['maxlength']?>" value="<?=$name?>" <?=($validation !== true && array_key_exists('name', $validation)) ? 'class="invalid"' : null?> />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Avatars')?></legend>
|
||||
<table class="avatars">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Level</th>
|
||||
<th>Portrait</th>
|
||||
<th>Avatar</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($xplevels as &$xplevel) : ?>
|
||||
<?php if($avatarsValidation !== true && array_key_exists($xplevel['id'], $avatarsValidation)) : ?>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<?php if(array_key_exists('portrait', $avatarsValidation[$xplevel['id']])) : ?>
|
||||
<ul class="validation">
|
||||
<?php foreach($avatarsValidation[$xplevel['id']]['portrait'] as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'avatar':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during avatar portrait upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('Avatar portrait has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('Avatar portrait exceeds size maximum');
|
||||
break;
|
||||
default: echo _('Avatar portrait invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<?php if(array_key_exists('avatar', $avatarsValidation[$xplevel['id']])) : ?>
|
||||
<?php foreach($avatarsValidation[$xplevel['id']]['avatar'] as $field => &$settings) : ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php foreach($settings as $setting => $value) : ?>
|
||||
<li>
|
||||
<?php switch($field) {
|
||||
case 'avatar':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during avatar upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('Avatar has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('Avatar exceeds size maximum');
|
||||
break;
|
||||
default: echo _('Avatar invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif ?>
|
||||
<tr>
|
||||
<!--<th><?=_('Level')?> <?=$xplevel['level']?>:</th>-->
|
||||
<th><?=$xplevel['level']?></th>
|
||||
<td>
|
||||
<!--<label for="avatar-<?=$xplevel['id']?>-portrait"><?=_('Protrait')?>:</label><br />-->
|
||||
<?php if(array_key_exists('avatar', $xplevel) && !is_null($xplevel['avatar']['small_avatarpicture_id'])) : ?>
|
||||
<img id="avatar" src="<?=$linker->link(array('media','avatar',$seminary['url'],$charactertype['url'],$xplevel['level'],'portrait'))?>" />
|
||||
<?php endif ?>
|
||||
<input id="avatar-<?=$xplevel['id']?>-portrait" type="file" name="avatars[<?=$xplevel['id']?>][portrait]" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" />
|
||||
</td>
|
||||
<td>
|
||||
<!--<label for="avatar-<?=$xplevel['id']?>-avatar"><?=_('Avatar')?>:</label><br />-->
|
||||
<?php if(array_key_exists('avatar', $xplevel) && !is_null($xplevel['avatar']['avatarpicture_id'])) : ?>
|
||||
<img id="avatar" src="<?=$linker->link(array('media','avatar',$seminary['url'],$charactertype['url'],$xplevel['level']))?>" />
|
||||
<?php endif ?>
|
||||
<input id="avatar-<?=$xplevel['id']?>-avatar" type="file" name="avatars[<?=$xplevel['id']?>][avatar]" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<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>
|
||||
25
views/html/charactertypes/index.tpl
Normal file
25
views/html/charactertypes/index.tpl
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?=$moodpic?>
|
||||
<ul class="breadcrumbs">
|
||||
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Charactertypes')?></h1>
|
||||
<?php if($seminary['created_user_id'] == \hhu\z\controllers\IntermediateController::$user['id'] || (!is_null(\hhu\z\controllers\SeminaryController::$character) && in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles']))) : ?>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('create',$seminary['url']),1)?>"><?=_('Create new Character type')?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
<ul class="avatar">
|
||||
<?php foreach($charactertypes as &$type) : ?>
|
||||
<li>
|
||||
<p><?=$type['name']?></p>
|
||||
<?php if(array_key_exists('avatar', $type) && !is_null($type['avatar']['small_avatarpicture_id'])) : ?>
|
||||
<img id="avatar" src="<?=$linker->link(array('media','avatar',$seminary['url'],$type['url'],$xplevels[0]['level'],'portrait'))?>" />
|
||||
<?php endif ?>
|
||||
<ul class="admin">
|
||||
<li><a href="<?=$linker->link(array('edit',$seminary['url'],$type['url']),1)?>"><?=_('edit')?></a></li>
|
||||
<li><a href="<?=$linker->link(array('delete',$seminary['url'],$type['url']),1)?>"><?=_('delete')?></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
Loading…
Add table
Add a link
Reference in a new issue