add Agent for Character groups Achievements (implements #123)
This commit is contained in:
parent
bf0d324655
commit
73c378d9f3
15 changed files with 1493 additions and 6 deletions
29
views/html/charactergroupsachievements/achievement.tpl
Normal file
29
views/html/charactergroupsachievements/achievement.tpl
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?=$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)?>"><?=_('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><?=$achievement['title']?></h1>
|
||||
<ul class="achmnts">
|
||||
<li class="cf">
|
||||
<?php if(!is_null($achievement['achievementsmedia_id'])) : ?>
|
||||
<img src="<?=$linker->link(array('media','charactergroupsachievement',$seminary['url'],$groupsgroup['url'],$achievement['url']))?>" />
|
||||
<?php endif ?>
|
||||
<p class="desc"><?=\hhu\z\Utils::t($achievement['description'])?></p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<form method="post" action="<?=$linker->link(null, 5, true)?>">
|
||||
<fieldset>
|
||||
<label for="charactergroup"><?=sprintf(_('%s-Group to show'), $groupsgroup['name'])?>:</label>
|
||||
<br />
|
||||
<select id="charactergroup" name="charactergroup">
|
||||
<?php foreach($charactergroups as &$group) : ?>
|
||||
<option value="<?=$group['id']?>"><?=$group['name']?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</fieldset>
|
||||
<input type="submit" value="<?=_('proceed')?>" />
|
||||
</form>
|
||||
67
views/html/charactergroupsachievements/create.tpl
Normal file
67
views/html/charactergroupsachievements/create.tpl
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
<?=$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)?>"><?=_('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(_('Create %s-Achievement'), $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;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post" 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 id="title" type="text" name="title" placeholder="<?=_('Title')?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> /><br />
|
||||
<label for="description"><?=_('Description')?>:</label>
|
||||
<textarea id="description" name="description"><?=$description?></textarea><br />
|
||||
</fieldset>
|
||||
<input type="submit" name="create" value="<?=_('create')?>" />
|
||||
</form>
|
||||
13
views/html/charactergroupsachievements/delete.tpl
Normal file
13
views/html/charactergroupsachievements/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('index',$seminary['url']),1)?>"><?=_('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-Achievement'), $groupsgroup['name'])?></h1>
|
||||
<?=sprintf(_('Should the %s-Achievement “%s” really be deleted?'), $groupsgroup['name'], $achievement['title'])?>
|
||||
<form method="post">
|
||||
<input type="submit" name="delete" value="<?=_('delete')?>" />
|
||||
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
|
||||
</form>
|
||||
70
views/html/charactergroupsachievements/edit.tpl
Normal file
70
views/html/charactergroupsachievements/edit.tpl
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
<?=$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)?>"><?=_('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-Achievement'), $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;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<form method="post" class="logreg" enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<legend><?=_('Icon')?></legend>
|
||||
<?php if(!is_null($achievement['achievementsmedia_id'])) : ?>
|
||||
<img src="<?=$linker->link(array('media','charactergroupsachievement',$seminary['url'],$groupsgroup['url'],$achievement['url']))?>" />
|
||||
<?php endif ?>
|
||||
<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 id="title" type="text" name="title" placeholder="<?=_('Title')?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> /><br />
|
||||
<label for="description"><?=_('Description')?>:</label>
|
||||
<textarea id="description" name="description"><?=$description?></textarea><br />
|
||||
</fieldset>
|
||||
<input type="submit" name="edit" value="<?=_('save')?>" />
|
||||
</form>
|
||||
33
views/html/charactergroupsachievements/manage.tpl
Normal file
33
views/html/charactergroupsachievements/manage.tpl
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?=$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)?>"><?=_('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>
|
||||
<nav class="admin">
|
||||
<li><a href="<?=$linker->link(array('create', $seminary['url'], $groupsgroup['url']), 1)?>"><?=sprintf(_('Create new %s-Achievement'), $groupsgroup['name'])?></a></li>
|
||||
</nav>
|
||||
|
||||
<h1><i class="fa fa-trophy fa-fw"></i><?=sprintf(_('Manage %s-Achievements'), $groupsgroup['name'])?></h1>
|
||||
<ul class="achmnts">
|
||||
<?php foreach($achievements as $index => &$achievement) : ?>
|
||||
<li class="cf">
|
||||
<?php if(!is_null($achievement['achievementsmedia_id'])) : ?>
|
||||
<img src="<?=$linker->link(array('media','charactergroupsachievement',$seminary['url'],$groupsgroup['url'],$achievement['url']))?>" />
|
||||
<?php endif ?>
|
||||
<h3 id="<?=$achievement['url']?>"><?=$achievement['title']?></h3>
|
||||
<p class="desc"><?=\hhu\z\Utils::t($achievement['description'])?></p>
|
||||
<ul class="admin">
|
||||
<li><a href="<?=$linker->link(array('edit',$seminary['url'],$groupsgroup['url'],$achievement['url']),1)?>"><?=_('edit')?></a></li>
|
||||
<li><a href="<?=$linker->link(array('delete',$seminary['url'],$groupsgroup['url'],$achievement['url']),1)?>"><?=_('delete')?></a></li>
|
||||
<?php if($index > 0) : ?><li><a href="<?=$linker->link(array('moveup',$seminary['url'],$groupsgroup['url'],$achievement['url']),1)?>">↑</a></li><?php endif ?>
|
||||
<?php if($index < count($achievements)-1) : ?><li><a href="<?=$linker->link(array('movedown',$seminary['url'],$groupsgroup['url'],$achievement['url']),1)?>">↓</a></li><?php endif ?>
|
||||
<li>
|
||||
<a href="<?=$linker->link(array('qrcodes','charactergroupsachievements',$seminary['url'],$groupsgroup['url'],$achievement['url'],'50'))?>">
|
||||
<i class="fa fa-qrcode"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach?>
|
||||
</ul>
|
||||
0
views/html/charactergroupsachievements/movedown.tpl
Normal file
0
views/html/charactergroupsachievements/movedown.tpl
Normal file
0
views/html/charactergroupsachievements/moveup.tpl
Normal file
0
views/html/charactergroupsachievements/moveup.tpl
Normal file
Loading…
Add table
Add a link
Reference in a new issue