add basic CRUD for Character groups Quest Stations
This commit is contained in:
parent
5f25a0a383
commit
e03dea0d80
9 changed files with 816 additions and 11 deletions
|
|
@ -67,9 +67,8 @@
|
|||
</section>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if(!empty($stations)) : ?>
|
||||
<section>
|
||||
<h1><i class="fa fa-map-signs fa-fw"></i><?=_('Stations')?></h1>
|
||||
<h1 id="stations"><i class="fa fa-map-signs fa-fw"></i><?=_('Stations')?></h1>
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
|
||||
|
|
@ -79,6 +78,7 @@
|
|||
</ul>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
<?php if(!empty($stations)) : ?>
|
||||
<ol class="grpqlist">
|
||||
<?php foreach($stations as &$station) : ?>
|
||||
<li>
|
||||
|
|
@ -96,8 +96,10 @@
|
|||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
<?php else : ?>
|
||||
<p><?=sprintf(_('Your %s-group has not discovered any station yet'), $groupsgroup['name'])?>.</p>
|
||||
<?php endif ?>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
|
||||
<section>
|
||||
<h1><i class="fa fa-users fa-fw"></i><?=$groupsgroup['name']?></h1>
|
||||
|
|
|
|||
99
views/html/charactergroupsqueststations/create.tpl
Normal file
99
views/html/charactergroupsqueststations/create.tpl
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
<?=$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('charactergroups','index',$seminary['url']))?>"><?=_('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>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>"><?=$quest['title']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('New Station')?></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" action="" 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>
|
||||
<legend><?=_('Location')?></legend>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label for="stationtype"><?=('Stationtype')?>:</label>
|
||||
<select id="stationtype" name="stationtype">
|
||||
<?php foreach($stationtypes as &$stationtype) : ?>
|
||||
<option value="<?=$stationtype['url']?>" <?php if($stationtype['selected']) : ?>selected="selected"<?php endif ?>>
|
||||
<?php switch($stationtype['classname']) {
|
||||
case null: echo _('Stationttype Empty');
|
||||
break;
|
||||
case 'multiplechoice': echo _('Stationtype multiplechoice');
|
||||
break;
|
||||
case 'keyword': echo _('Stationtype keyword');
|
||||
break;
|
||||
} ?>
|
||||
</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="task"><?=_('Task')?>:</label><br />
|
||||
<textarea id="task" name="task" placeholder="<?=_('Task')?>" style="width:100%; height:10em;"><?=$task?></textarea><br />
|
||||
<label for="rightText"><?=('Right text')?>:</label><br />
|
||||
<textarea id="rightText" name="rightText" placeholder="<?=_('Right text')?>" style="width:100%; height:10em;"><?=$righttext?></textarea><br />
|
||||
<label for="wrongText"><?=_('Wrong text')?>:</label><br />
|
||||
<textarea id="wrongText" name="wrongText" placeholder="<?=_('Wrong text')?>" style="width:100%; height:10em;"><?=$wrongtext?></textarea><br />
|
||||
</fieldset>
|
||||
<input type="submit" name="create" value="<?=_('create')?>" />
|
||||
</form>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#task").markItUp(mySettings);
|
||||
$("#rightText").markItUp(mySettings);
|
||||
$("#wrongText").markItUp(mySettings);
|
||||
});
|
||||
</script>
|
||||
14
views/html/charactergroupsqueststations/delete.tpl
Normal file
14
views/html/charactergroupsqueststations/delete.tpl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?=$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('charactergroups','index',$seminary['url']))?>"><?=_('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>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>"><?=$quest['title']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Delete Station')?></h1>
|
||||
<?=sprintf(_('Should the Station “%s” really be deleted?'), $station['title'])?>
|
||||
<form method="post">
|
||||
<input type="submit" name="delete" value="<?=_('delete')?>" />
|
||||
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
|
||||
</form>
|
||||
99
views/html/charactergroupsqueststations/edit.tpl
Normal file
99
views/html/charactergroupsqueststations/edit.tpl
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
<?=$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('charactergroups','index',$seminary['url']))?>"><?=_('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>
|
||||
<li><i class="fa fa-chevron-right fa-fw"></i><a href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>"><?=$quest['title']?></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><?=_('Edit Station')?></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" action="" 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>
|
||||
<legend><?=_('Location')?></legend>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label for="stationtype"><?=('Stationtype')?>:</label>
|
||||
<select id="stationtype" name="stationtype">
|
||||
<?php foreach($stationtypes as &$stationtype) : ?>
|
||||
<option value="<?=$stationtype['url']?>" <?php if($stationtype['selected']) : ?>selected="selected"<?php endif ?>>
|
||||
<?php switch($stationtype['classname']) {
|
||||
case null: echo _('Stationttype Empty');
|
||||
break;
|
||||
case 'multiplechoice': echo _('Stationtype multiplechoice');
|
||||
break;
|
||||
case 'keyword': echo _('Stationtype keyword');
|
||||
break;
|
||||
} ?>
|
||||
</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="task"><?=_('Task')?>:</label><br />
|
||||
<textarea id="task" name="task" placeholder="<?=_('Task')?>" style="width:100%; height:10em;"><?=$task?></textarea><br />
|
||||
<label for="rightText"><?=('Right text')?>:</label><br />
|
||||
<textarea id="rightText" name="rightText" placeholder="<?=_('Right text')?>" style="width:100%; height:10em;"><?=$righttext?></textarea><br />
|
||||
<label for="wrongText"><?=_('Wrong text')?>:</label><br />
|
||||
<textarea id="wrongText" name="wrongText" placeholder="<?=_('Wrong text')?>" style="width:100%; height:10em;"><?=$wrongtext?></textarea><br />
|
||||
</fieldset>
|
||||
<input type="submit" name="edit" value="<?=_('edit')?>" />
|
||||
</form>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#task").markItUp(mySettings);
|
||||
$("#rightText").markItUp(mySettings);
|
||||
$("#wrongText").markItUp(mySettings);
|
||||
});
|
||||
</script>
|
||||
|
|
@ -8,9 +8,8 @@
|
|||
|
||||
<?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'],$groupsgroup['url'],$quest['url'],$station['url']),1)?>"><?=_('Edit')?></a></li>
|
||||
<li><a href="<?=$linker->link(array('delete',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']),1)?>"><?=_('Delete')?></a></li>
|
||||
<li><a href="<?=$linker->link(array('manage',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']),1)?>"><?=_('Manage')?></a></li>
|
||||
<li><a href="<?=$linker->link(array('edit',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']),1)?>"><?=_('edit')?></a></li>
|
||||
<li><a href="<?=$linker->link(array('delete',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']),1)?>"><?=_('delete')?></a></li>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue