implement copying of Stations for Seminary copy feature

This commit is contained in:
oliver 2016-01-30 20:15:13 +01:00
commit 40a233fa7d
4342 changed files with 1215466 additions and 0 deletions

View file

@ -0,0 +1,148 @@
<?=$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('achievements','index',$seminary['url']))?>"><?=_('Achievements')?></a></li>
</ul>
<h1><?=_('Edit Achievement conditions')?></h1>
<form method="post">
<fieldset>
<legend><?=_('Conditions')?></legend>
<ul>
<?php foreach($conditions as &$condition) : ?>
<li>
<?php if($achievement['condition'] == 'date') : ?>
<label for="condition-<?=$condition['id']?>-select"><?=_('Date')?>:</label>
<input id="condition-<?=$condition['id']?>-select" type="text" name="conditions[<?=$condition['id']?>][select]" placeholder="SELECT" value="<?=$condition['select']?>" />
<?php elseif($achievement['condition'] == 'character') : ?>
<label for="condition-<?=$condition['id']?>-value"><?=_('Field')?>:</label>
<select id="condition-<?=$condition['id']?>-field" name="conditions[<?=$condition['id']?>][field]">
<?php foreach($characterFields as &$field) : ?>
<option value="<?=$field?>" <?php if($condition['field'] == $field) : ?>selected="selected"<?php endif ?>><?=$field?></option>
<?php endforeach ?>
</select><br />
<label for="condition-<?=$condition['id']?>-value"><?=_('Value')?>:</label>
<input id="condition-<?=$condition['id']?>-value" type="text" name="conditions[<?=$condition['id']?>][value]" placeholder="<?=_('Value')?>" value="<?=$condition['value']?>" />
<?php elseif($achievement['condition'] == 'quest') : ?>
<label for="condition-<?=$condition['id']?>-value"><?=_('Field')?>:</label>
<select id="condition-<?=$condition['id']?>-field" name="conditions[<?=$condition['id']?>][field]">
<?php foreach($questFields as &$field) : ?>
<option value="<?=$field?>" <?php if($condition['field'] == $field) : ?>selected="selected"<?php endif ?>><?=$field?></option>
<?php endforeach ?>
</select><br />
<input id="condition-<?=$condition['id']?>-count" type="checkbox" name="conditions[<?=$condition['id']?>][count]" <?php if($condition['count']) : ?>checked="checked"<?php endif ?> />
<label for="condition-<?=$condition['id']?>-count"><?=_('Count')?></label><br />
<label for="condition-<?=$condition['id']?>-value"><?=_('Value')?>:</label>
<input id="condition-<?=$condition['id']?>-value" type="text" name="conditions[<?=$condition['id']?>][value]" placeholder="<?=_('Value')?>" value="<?=$condition['value']?>" /><br />
<label for="condition-<?=$condition['id']?>-quest"><?=_('Quest')?>:</label>
<select id="condition-<?=$condition['id']?>-quest" name="conditions[<?=$condition['id']?>][quest]">
<option value="" <?php if(is_null($condition['quest_id'])) : ?>selected="selected"<?php endif ?>><?=_('unset')?><option>
<?php foreach($quests as &$quest) : ?>
<option value="<?=$quest['url']?>" <?php if($condition['quest_id'] == $quest['id']) : ?>selected="selected"<?php endif ?>><?=$quest['title']?></option>
<?php endforeach ?>
</select><br />
<label for="condition-<?=$condition['id']?>-status"><?=_('Status')?>:</label>
<select id="condition-<?=$condition['id']?>-status" name="conditions[<?=$condition['id']?>][status]">
<option value="" <?php if(is_null($condition['status'])) : ?>selected="selected"<?php endif ?>><?=_('unset')?></option>
<option value="0" <?php if(!is_null($condition['status']) && $condition['status'] == 0) : ?>selected="selected"<?php endif ?>><?=_('entered')?></option>
<option value="1" <?php if($condition['status'] == 1) : ?>selected="selected"<?php endif ?>><?=_('submitted')?></option>
<option value="2" <?php if($condition['status'] == 2) : ?>selected="selected"<?php endif ?>><?=_('unsolved')?></option>
<option value="3" <?php if($condition['status'] == 3) : ?>selected="selected"<?php endif ?>><?=_('solved')?></option>
</select><br />
<label for="condition-<?=$condition['id']?>-groupby"><?=_('Group by')?>:</label>
<input id="condition-<?=$condition['id']?>-groupby" type="text" name="conditions[<?=$condition['id']?>][groupby]" placeholder="<?=_('Group by')?>" value="<?=$condition['groupby']?>" />
<?php elseif($achievement['condition'] == 'achievement') : ?>
<label for="condition-<?=$condition['id']?>-value"><?=_('Field')?>:</label>
<select id="condition-<?=$condition['id']?>-field" name="conditions[<?=$condition['id']?>][field]">
<?php foreach($achievementFields as &$field) : ?>
<option value="<?=$field?>" <?php if($condition['field'] == $field) : ?>selected="selected"<?php endif ?>><?=$field?></option>
<?php endforeach ?>
</select><br />
<input id="condition-<?=$condition['id']?>-count" type="checkbox" name="conditions[<?=$condition['id']?>][count]" <?php if($condition['count']) : ?>checked="checked"<?php endif ?> />
<label for="condition-<?=$condition['id']?>-count"><?=_('Count')?></label><br />
<label for="condition-<?=$condition['id']?>-value"><?=_('Value')?>:</label>
<input id="condition-<?=$condition['id']?>-value" type="text" name="conditions[<?=$condition['id']?>][value]" placeholder="<?=_('Value')?>" value="<?=$condition['value']?>" /><br />
<label for="condition-<?=$condition['id']?>-achievement"><?=_('Achievement')?>:</label>
<select id="condition-<?=$condition['id']?>-achievement" name="conditions[<?=$condition['id']?>][achievement]">
<option value="" <?php if(is_null($condition['meta_achievement_id'])) : ?>selected="selected"<?php endif ?>><?=_('unset')?><option>
<?php foreach($achievements as &$a) : ?>
<option value="<?=$a['url']?>" <?php if($condition['meta_achievement_id'] == $a['id']) : ?>selected="selected"<?php endif ?>><?=$a['title']?></option>
<?php endforeach ?>
</select><br />
<label for="condition-<?=$condition['id']?>-groupby"><?=_('Group by')?>:</label>
<input id="condition-<?=$condition['id']?>-groupby" type="text" name="conditions[<?=$condition['id']?>][groupby]" placeholder="<?=_('Group by')?>" value="<?=$condition['groupby']?>" />
<?php endif ?>
<br />
<input id="delete-<?=$condition['id']?>" type="checkbox" name="deletes[<?=$condition['id']?>]" <?php if(array_key_exists($condition['id'], $deletes)) : ?>checked="checked"<?php endif ?> />
<label for="delete-<?=$condition['id']?>"><?=_('delete')?></label>
</li>
<?php endforeach ?>
<li>
<?php if($achievement['condition'] == 'date') : ?>
<label for="condition-new-select"><?=_('Date')?>:</label>
<input id="condition-new-select" type="text" name="conditions[new][select]" placeholder="<?=_('New condition')?>" value="" />
<?php elseif($achievement['condition'] == 'character') : ?>
<label for="condition-new-field"><?=_('Field')?>:</label>
<select id="condition-new-field" name="conditions[new][field]">
<?php foreach($characterFields as &$field) : ?>
<option value="<?=$field?>"><?=$field?></option>
<?php endforeach ?>
</select><br />
<label for="condition-new-value"><?=_('Value')?>:</label>
<input id="condition-new-value" type="text" name="conditions[new][value]" placeholder="<?=_('New condition')?>" value="" />
<?php elseif($achievement['condition'] == 'quest') : ?>
<label for="condition-new-field"><?=_('Field')?>:</label>
<select id="condition-new-field" name="conditions[new][field]">
<?php foreach($questFields as &$field) : ?>
<option value="<?=$field?>"><?=$field?></option>
<?php endforeach ?>
</select><br />
<input id="condition-new-count" type="checkbox" name="conditions[new][count]" />
<label for="condition-new-count"><?=_('Count')?></label><br />
<label for="condition-value"><?=_('Value')?>:</label>
<input id="condition-new-value" type="number" name="conditions[new][value]" placeholder="<?=_('Value')?>" value="" /><br />
<label for="condition-new-quest"><?=_('Quest')?>:</label>
<select id="condition-new-quest" name="conditions[new][quest]">
<option value=""><?=_('unset')?><option>
<?php foreach($quests as &$quest) : ?>
<option value="<?=$quest['url']?>"><?=$quest['title']?></option>
<?php endforeach ?>
</select><br />
<label for="condition-new-status"><?=_('Status')?>:</label>
<select id="condition-new-status" name="conditions[new][status]">
<option value=""><?=_('unset')?></option>
<option value="0"><?=_('entered')?></option>
<option value="1"><?=_('submitted')?></option>
<option value="2"><?=_('unsolved')?></option>
<option value="3"><?=_('solved')?></option>
</select><br />
<label for="condition-new-groupby"><?=_('Group by')?>:</label>
<input id="condition-new-groupby" type="text" name="conditions[new][groupby]" placeholder="<?=_('Group by')?>" value="" />
<?php elseif($achievement['condition'] == 'achievement') : ?>
<label for="condition-new-field"><?=_('Field')?>:</label>
<select id="condition-new-field" name="conditions[new][field]">
<?php foreach($achievementFields as &$field) : ?>
<option value="<?=$field?>"><?=$field?></option>
<?php endforeach ?>
</select><br />
<input id="condition-new-count" type="checkbox" name="conditions[new][count]" />
<label for="condition-new-count"><?=_('Count')?></label><br />
<label for="condition-new-value"><?=_('Value')?>:</label>
<input id="condition-new-value" type="number" name="conditions[new][value]" placeholder="<?=_('Value')?>" value="" /><br />
<label for="condition-new-achievement"><?=_('Achievement')?>:</label>
<select id="condition-new-achievement" name="conditions[new][achievement]">
<option value=""><?=_('unset')?><option>
<?php foreach($achievements as &$a) : ?>
<option value="<?=$a['url']?>"><?=$a['title']?></option>
<?php endforeach ?>
</select><br />
<label for="condition-new-groupby"><?=_('Group by')?>:</label>
<input id="condition-new-groupby" type="text" name="conditions[new][groupby]" placeholder="<?=_('Group by')?>" value="" />
<?php else : ?>
hallo
<?php endif ?>
</li>
</ul>
</fieldset>
<input type="submit" name="edit" value="<?=_('save')?>" />
</form>

View file

@ -0,0 +1,105 @@
<?=$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('achievements','index',$seminary['url']))?>"><?=_('Achievements')?></a></li>
</ul>
<h1><?=_('Create Achievement')?></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 picture upload: %s'), $value);
break;
case 'mimetype': printf(_('Picture has wrong type “%s”'), $value);
break;
case 'size': echo _('Picture exceeds size maximum');
break;
default: echo _('Picture 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;
case 'deadline':
switch($setting) {
case 'regex': echo _('Deadline has wrong format');
break;
default: echo _('Deadline invalid');
}
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<form method="post" class="logreg" enctype="multipart/form-data">
<fieldset>
<legend><?=_('Images')?></legend>
<label for="unachievedImage"><?=_('Unachieved')?></label>
<input id="unachievedImage" type="file" name="unachieved_image" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" /><br />
<label for="achievedImage"><?=_('Achieved')?></label>
<input id="achievedImage" type="file" name="achieved_image" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" /><br />
<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 />
<input id="progress" type="checkbox" name="progress" <?php if($progress) : ?>checked="checked"<?php endif ?> />
<label for="progress"><?=_('Show progress')?></label><br />
<input id="hidden" type="checkbox" name="hidden" <?php if($hidden) : ?>checked="checked"<?php endif ?> />
<label for="hidden"><?=_('Secret Achievement')?></label><br />
<input id="onlyOnce" type="checkbox" name="only_once" <?php if($onlyOnce) : ?>checked="checked"<?php endif ?> />
<label for="onlyOnce"><?=_('Only achieveable by one Character')?></label><br />
<input id="allConditions" type="checkbox" name="all_conditions" <?php if($allConditions) : ?>checked="checked"<?php endif ?> />
<label for="allConditions"><?=_('All conditions')?></label><br />
<label for="deadline"><?=_('Deadline')?>:</label>
<input id="deadline" type="datetime" name="deadline" placeholder="YYYY-MM-DD HH:MM:SS" pattern="<?=substr($validationSettings['deadline']['regex'],1,strrpos($validationSettings['deadline']['regex'],$validationSettings['deadline']['regex'][0])-1)?>" value="<?=$deadline?>" <?=(array_key_exists('deadline', $validation)) ? 'class="invalid"' : null?> />
</fieldset>
<fieldset>
<legend><?=_('Conditions')?></legend>
<select name="condition">
<?php foreach($conditions as &$c) : ?>
<option value="<?=$c['condition']?>" <?php if($c['condition'] == $condition) : ?>selected="selected"<?php endif ?>>
<?php switch($c['condition']) {
case 'date': echo _('Achievement conditions date');
break;
case 'character': echo _('Achievement conditions Character');
break;
case 'quest': echo _('Achievement conditions Quest');
break;
case 'achievement': echo _('Achievement conditions Achievement');
break;
} ?>
</option>
<?php endforeach ?>
</select>
</fieldset>
<input type="submit" name="edit" value="<?=_('save and edit conditions')?>" />
</form>

View 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('achievements','index',$seminary['url']))?>"><?=_('Achievements')?></a></li>
</ul>
<h1><?=_('Delete Achievement')?></h1>
<?=sprintf(_('Should the Achievement “%s” really be deleted?'), $achievement['title'])?>
<form method="post">
<input type="submit" name="delete" value="<?=_('delete')?>" />
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
</form>

View file

@ -0,0 +1,113 @@
<?=$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('achievements','index',$seminary['url']))?>"><?=_('Achievements')?></a></li>
</ul>
<h1><?=_('Edit Achievement')?></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 picture upload: %s'), $value);
break;
case 'mimetype': printf(_('Picture has wrong type “%s”'), $value);
break;
case 'size': echo _('Picture exceeds size maximum');
break;
default: echo _('Picture 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;
case 'deadline':
switch($setting) {
case 'regex': echo _('Deadline has wrong format');
break;
default: echo _('Deadline invalid');
}
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<form method="post" class="logreg" enctype="multipart/form-data">
<fieldset>
<legend><?=_('Images')?></legend>
<?php if(!is_null($achievement['unachieved_achievementsmedia_id'])) : ?>
<img src="<?=$linker->link(array('media','achievement',$seminary['url'],$achievement['url'],'locked'))?>" />
<?php endif ?>
<label for="unachievedImage"><?=_('Unachieved')?></label>
<input id="unachievedImage" type="file" name="unachieved_image" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" /><br />
<?php if(!is_null($achievement['achieved_achievementsmedia_id'])) : ?>
<img src="<?=$linker->link(array('media','achievement',$seminary['url'],$achievement['url']))?>" />
<?php endif ?>
<label for="achievedImage"><?=_('Achieved')?></label>
<input id="achievedImage" type="file" name="achieved_image" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" /><br />
<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 />
<input id="progress" type="checkbox" name="progress" <?php if($progress) : ?>checked="checked"<?php endif ?> />
<label for="progress"><?=_('Show progress')?></label><br />
<input id="hidden" type="checkbox" name="hidden" <?php if($hidden) : ?>checked="checked"<?php endif ?> />
<label for="hidden"><?=_('Secret Achievement')?></label><br />
<input id="onlyOnce" type="checkbox" name="only_once" <?php if($onlyOnce) : ?>checked="checked"<?php endif ?> />
<label for="onlyOnce"><?=_('Only achieveable by one Character')?></label><br />
<input id="allConditions" type="checkbox" name="all_conditions" <?php if($allConditions) : ?>checked="checked"<?php endif ?> />
<label for="allConditions"><?=_('All conditions')?></label><br />
<label for="deadline"><?=_('Deadline')?>:</label>
<input id="deadline" type="datetime" name="deadline" placeholder="YYYY-MM-DD HH:MM:SS" pattern="<?=substr($validationSettings['deadline']['regex'],1,strrpos($validationSettings['deadline']['regex'],$validationSettings['deadline']['regex'][0])-1)?>" value="<?=$deadline?>" <?=(array_key_exists('deadline', $validation)) ? 'class="invalid"' : null?> />
</fieldset>
<fieldset>
<legend><?=_('Condition')?></legend>
<select name="condition">
<?php foreach($conditions as &$c) : ?>
<option value="<?=$c['condition']?>" <?php if($c['condition'] == $condition) : ?>selected="selected"<?php endif ?>>
<?php switch($c['condition']) {
case 'date': echo _('Achievement conditions date');
break;
case 'character': echo _('Achievement conditions Character');
break;
case 'quest': echo _('Achievement conditions Quest');
break;
case 'achievement': echo _('Achievement conditions Achievement');
break;
} ?>
</option>
<?php endforeach ?>
</select>
<i><?=_('Changing the condition will delete all current conditions')?>.</i>
</fieldset>
<input type="submit" name="edit-conditions" value="<?=_('edit conditions')?>" />
<input type="submit" name="edit" value="<?=_('save')?>" />
</form>

View file

@ -0,0 +1,93 @@
<?=$moodpic?>
<ul class="breadcrumbs">
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
</ul>
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
<nav class="admin">
<li><a href="<?=$linker->link('create', 3)?>"><?=_('Create new Achievement')?></a></li>
<li><a href="<?=$linker->link('manage', 3)?>"><?=_('Manage Achievements')?></a></li>
</nav>
<?php endif ?>
<h1><i class="fa fa-trophy fa-fw"></i><?=_('Achievements')?></h1>
<p><?=_('Achievement description')?></p>
<div class="cf">
<section class="rare">
<h2><?=_('Seldom Achievements')?></h2>
<ol>
<?php foreach($seldomAchievements as &$achievement) : ?>
<li class="cf">
<?php if($achievement['achieved'] !== false) : ?>
<?php if(!is_null($achievement['achieved_achievementsmedia_id'])) : ?>
<img src="<?=$linker->link(array('media','achievement',$seminary['url'],$achievement['url']))?>" />
<?php endif ?>
<?php else : ?>
<?php if(!is_null($achievement['unachieved_achievementsmedia_id'])) : ?>
<img src="<?=$linker->link(array('media','achievement',$seminary['url'],$achievement['url'],'locked'))?>" />
<?php endif ?>
<?php endif ?>
<p class="fwb"><?=(!$achievement['hidden']) ? $achievement['title'] : _('Secret Achievement')?></p>
<p><small><?=sprintf(_('Achievement has been achieved only %d times'), $achievement['c'])?></small></p>
</li>
<?php endforeach ?>
</ol>
</section>
<section class="rare hunter">
<h2><?=_('Most successful collectors')?></h2>
<ol>
<?php foreach($successfulCharacters as $successfulCharacter) : ?>
<li class="cf">
<img src="<?=$linker->link(array('media','avatar',$seminary['url'],$successfulCharacter['charactertype_url'],$successfulCharacter['xplevel'],'portrait'))?>" />
<p class="fwb"><?=$successfulCharacter['name']?></p>
<p><small>
<?php if($successfulCharacter['c'] == 1) : ?>
<?=sprintf(_('Character has achieved %d Achievement'), $successfulCharacter['c'])?>
<?php else : ?>
<?=sprintf(_('Character has achieved %d Achievements'), $successfulCharacter['c'])?>
<?php endif ?>
</small></p>
</li>
<?php endforeach ?>
</ol>
</section>
</div>
<h2><?=_('Personal Achievements')?></h2>
<div class="libindxpr cf">
<p><small><?=sprintf(_('Own progress: %d%%'), ($achievementsCount > 0 ? round(count($achievedAchievements) / $achievementsCount * 100) : 0))?></small></p>
<div class="xpbar">
<span style="width:<?=($achievementsCount > 0) ? round(count($achievedAchievements) / $achievementsCount * 100) : 0?>%"></span>
</div>
</div>
<p><small><b><?=$character['rank']?>. <?=_('Rank')?>:</b> <?=sprintf(_('You achieved %d of %d Achievements so far'), count($achievedAchievements), $achievementsCount)?>.</small></p>
<ul class="achmnts">
<?php foreach($achievedAchievements as &$achievement) : ?>
<li class="cf">
<?php if(!is_null($achievement['achieved_achievementsmedia_id'])) : ?>
<img src="<?=$linker->link(array('media','achievement',$seminary['url'],$achievement['url']))?>" />
<?php endif ?>
<h3 id="<?=$achievement['url']?>"><?=$achievement['title']?><span class="unlcked"><?=sprintf(_('achieved at: %s'), $dateFormatter->format(new \DateTime($achievement['created'])))?></span></h3>
<p class="desc"><?=\hhu\z\Utils::t($achievement['description'])?></p>
</li>
<?php endforeach?>
<?php foreach($unachievedAchievements as &$achievement) : ?>
<li class="cf">
<?php if(!is_null($achievement['unachieved_achievementsmedia_id'])) : ?>
<img src="<?=$linker->link(array('media','achievement',$seminary['url'],$achievement['url'],'locked'))?>" />
<?php endif ?>
<h3 id="<?=$achievement['url']?>"><?=(!$achievement['hidden']) ? $achievement['title'] : _('Secret Achievement')?></h3>
<?php if(!$achievement['hidden']) : ?>
<p class="desc"><?=\hhu\z\Utils::t($achievement['description'])?></p>
<?php else : ?>
<p class="desc"><?=_('Continue playing to unlock this secret Achievement')?></p>
<?php endif ?>
<?php if(array_key_exists('characterProgress', $achievement)) : ?>
<div class="prgrss cf">
<div class="xpbar">
<span style="width:<?=round($achievement['characterProgress']*100)?>%"></span>
</div>
<p class="xpnumeric"><?=round($achievement['characterProgress']*100)?>%</p>
</div>
<?php endif ?>
</li>
<?php endforeach?>
</ul>

View file

@ -0,0 +1,27 @@
<?=$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('achievements','index',$seminary['url']))?>"><?=_('Achievements')?></a></li>
</ul>
<nav class="admin">
<li><a href="<?=$linker->link(array('create', $seminary['url']), 1)?>"><?=_('Create new Achievement')?></a></li>
</nav>
<h1><i class="fa fa-trophy fa-fw"></i><?=_('Manage Achievements')?></h1>
<ul class="achmnts">
<?php foreach($achievements as $index => &$achievement) : ?>
<li class="cf">
<?php if(!is_null($achievement['achieved_achievementsmedia_id'])) : ?>
<img src="<?=$linker->link(array('media','achievement',$seminary['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'],$achievement['url']),1)?>"><?=_('edit')?></a></li>
<li><a href="<?=$linker->link(array('delete',$seminary['url'],$achievement['url']),1)?>"><?=_('delete')?></a></li>
<?php if($index > 0) : ?><li><a href="<?=$linker->link(array('moveup',$seminary['url'],$achievement['url']),1)?>">↑</a></li><?php endif ?>
<?php if($index < count($achievements)-1) : ?><li><a href="<?=$linker->link(array('movedown',$seminary['url'],$achievement['url']),1)?>">↓</a></li><?php endif ?>
</ul>
</li>
<?php endforeach?>
</ul>

View file

View file

View file

@ -0,0 +1,74 @@
<?=$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('groupsgroup',$seminary['url'],$groupsgroup['url']),1)?>"><?=$groupsgroup['name']?></a></li>
</ul>
<h1><?=sprintf(_('New %s Character group'), $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 'charactergroupname':
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 'regex': echo _('Name contains illegal characters');
break;
case 'exist': echo _('Name already exists');
break;
default: echo _('Name invalid');
}
break;
case 'motto':
switch($setting) {
case 'maxlength': printf(_('Motto is too long (max. %d chars)'), $value);
break;
default: echo _('Motto 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>
<label for="charactergroupname"><?=_('Name')?>:</label>
<input type="text" id="charactergroupname" name="charactergroupname" placeholder="<?=_('Name')?>" title="<?=_('Name')?>" required="required" maxlength="<?=$validationSettings['charactergroupname']['maxlength']?>" value="<?=$charactergroupname?>" <?=(array_key_exists('charactergroupname', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="motto"><?=_('Motto')?>:</label>
<input type="text" id="motto" name="motto" placeholder="<?=_('Motto')?>" title="<?=_('Motto')?>" maxlength="<?=$validationSettings['motto']['maxlength']?>" value="<?=$motto?>" <?=(array_key_exists('motto', $validation)) ? 'class="invalid"' : null?> /><br />
</fieldset>
<input type="submit" name="create" value="<?=_('create')?>" />
</form>

View file

@ -0,0 +1,47 @@
<?=$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>
</ul>
<h1><?=_('New Character groups-group')?></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 'charactergroupsgroupname':
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 'regex': echo _('Name contains illegal characters');
break;
case 'exist': echo _('Name already exists');
break;
default: echo _('Name invalid');
}
break;
default:
echo $exception->getMessage();
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<form method="post" action="" class="logreg">
<fieldset>
<label for="charactergroupsgroupname"><?=_('Name')?>:</label>
<input type="text" name="charactergroupsgroupname" placeholder="<?=_('Name')?>" title="<?=_('Name')?>" required="required" maxlength="<?=$validationSettings['charactergroupsgroupname']['maxlength']?>" value="<?=$charactergroupsgroupname?>" <?=(array_key_exists('charactergroupsgroupname', $validation)) ? 'class="invalid"' : null?> /><br />
<div class="inlbl"><input type="checkbox" id="preferred" name="preferred" <?php if($preferred) : ?>checked="checked"<?php endif ?> /><label for="preferred"><?=_('preferred')?></label></div>
</fieldset>
<input type="submit" name="create" value="<?=_('create')?>" />
</form>

View 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('groupsgroup',$seminary['url'],$groupsgroup['url']),1)?>"><?=$groupsgroup['name']?></a></li>
</ul>
<h1><?=sprintf(_('Delete %s Character group'), $groupsgroup['name'])?></h1>
<?=sprintf(_('Should the %s Character group “%s” really be deleted?'), $groupsgroup['name'], $group['name'])?>
<form method="post">
<input type="submit" name="delete" value="<?=_('delete')?>" />
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
</form>

View 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)?>"><?=_('Character Groups')?></a></li>
</ul>
<h1><?=_('Delete Character groups-group')?></h1>
<?=sprintf(_('Should the Character groups-group “%s” really be deleted?'), $groupsgroup['name'])?>
<form method="post">
<input type="submit" name="delete" value="<?=_('delete')?>" />
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
</form>

View file

@ -0,0 +1,80 @@
<?=$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('groupsgroup',$seminary['url'],$groupsgroup['url']),1)?>"><?=$groupsgroup['name']?></a></li>
</ul>
<h1><?=sprintf(_('Edit %s Character group'), $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 'charactergroupname':
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 'regex': echo _('Name contains illegal characters');
break;
case 'exist': echo _('Name already exists');
break;
default: echo _('Name invalid');
}
break;
case 'motto':
switch($setting) {
case 'maxlength': printf(_('Motto is too long (max. %d chars)'), $value);
break;
default: echo _('Motto 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>
<img src="<?=$linker->link(array('media','charactergroup',$seminary['url'],$groupsgroup['url'],$group['url']))?>" class="gbanner"><br />
<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="charactergroupname"><?=_('Name')?>:</label>
<?php if(count(array_intersect(array('admin','moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
<input type="text" id="charactergroupname" name="charactergroupname" placeholder="<?=_('Name')?>" title="<?=_('Name')?>" required="required" maxlength="<?=$validationSettings['charactergroupname']['maxlength']?>" value="<?=$charactergroupname?>" <?=(array_key_exists('charactergroupname', $validation)) ? 'class="invalid"' : null?> /><br />
<?php else : ?>
<input type="text" id="charactergroupname" name="charactergroupname" disabled="disabled" value="<?=$charactergroupname?>" <?=(array_key_exists('charactergroupname', $validation)) ? 'class="invalid"' : null?> /><br />
<input type="hidden" name="charactergroupname" value="<?=$charactergroupname?>" />
<?php endif ?>
<label for="motto"><?=_('Motto')?>:</label>
<input type="text" id="motto" name="motto" placeholder="<?=_('Motto')?>" title="<?=_('Motto')?>" maxlength="<?=$validationSettings['motto']['maxlength']?>" value="<?=$motto?>" <?=(array_key_exists('motto', $validation)) ? 'class="invalid"' : null?> /><br />
</fieldset>
<input type="submit" name="edit" value="<?=_('edit')?>" />
</form>

View file

@ -0,0 +1,47 @@
<?=$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>
</ul>
<h1><?=_('Edit Character groups-group')?></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 'charactergroupsgroupname':
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 'regex': echo _('Name contains illegal characters');
break;
case 'exist': echo _('Name already exists');
break;
default: echo _('Name invalid');
}
break;
default:
echo $exception->getMessage();
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<form method="post" action="" class="logreg">
<fieldset>
<label for="charactergroupsgroupname"><?=_('Name')?>:</label>
<input type="text" name="charactergroupsgroupname" placeholder="<?=_('Name')?>" title="<?=_('Name')?>" required="required" maxlength="<?=$validationSettings['charactergroupsgroupname']['maxlength']?>" value="<?=$charactergroupsgroupname?>" <?=(array_key_exists('charactergroupsgroupname', $validation)) ? 'class="invalid"' : null?> /><br />
<div class="inlbl"><input type="checkbox" id="preferred" name="preferred" <?php if($preferred) : ?>checked="checked"<?php endif ?> /><label for="preferred"><?=_('preferred')?></label></div>
</fieldset>
<input type="submit" name="edit" value="<?=_('edit')?>" />
</form>

View file

@ -0,0 +1,61 @@
<?=$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('groupsgroup',$seminary['url'],$groupsgroup['url']),1)?>"><?=$groupsgroup['name']?></a></li>
</ul>
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0 || in_array(\hhu\z\controllers\SeminaryController::$character['id'], array_map(function($c) { return $c['id']; }, $group['characters']))) : ?>
<nav class="admin">
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0 || in_array(\hhu\z\controllers\SeminaryController::$character['id'], array_map(function($c) { return $c['id']; }, $group['characters']))) : ?>
<li><a href="<?=$linker->link(array('editgroup',$seminary['url'],$groupsgroup['url'],$group['url']),1)?>"><?=sprintf(_('Edit %s Character group'), $groupsgroup['name'])?></a></li>
<?php endif ?>
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
<li><a href="<?=$linker->link(array('deletegroup',$seminary['url'],$groupsgroup['url'],$group['url']),1)?>"><?=sprintf(_('Delete %s Character group'), $groupsgroup['name'])?></a></li>
<li><a href="<?=$linker->link(array('managegroup',$seminary['url'],$groupsgroup['url'],$group['url']),1)?>"><?=sprintf(_('Manage %s Character group'), $groupsgroup['name'])?></a></li>
<?php endif ?>
</nav>
<?php endif ?>
<div class="gbanner cf">
<img src="<?=$linker->link(array('media','charactergroup',$seminary['url'],$groupsgroup['url'],$group['url']))?>" class="gbanner">
<h1><?=$group['name']?></h1>
<?php if(!empty($group['motto'])) : ?>
<p>"<?=$group['motto']?>"</p>
<?php endif ?>
</div>
<ul class="gdata cf">
<li><?=$group['rank']?>. <?=_('Rank')?></li>
<li><?=sprintf(_('%dXPs'), $group['xps'])?></li>
<li><?=count($group['characters'])?> <?=(count($group['characters']) == 0 || count($group['characters']) > 1) ? _('Members') : _('Member')?></li>
</ul>
<section>
<h1><i class="fa fa-users fa-fw"></i><?=_('Characters')?></h1>
<ul class="gchars cf">
<?php foreach($group['characters'] as &$character) : ?>
<li>
<?php if(array_key_exists('small_avatar', $character)) : ?>
<p><img src="<?=$linker->link(array('media','seminary',$seminary['url'],$character['small_avatar']['url']))?>"></p>
<?php endif ?>
<p><a href="<?=$linker->link(array('characters','character',$seminary['url'],$character['url']))?>"><?=$character['name']?></a></p>
<p><small><?=sprintf(_('%dXPs'), $character['xps'])?></small></p>
</li>
<?php endforeach ?>
</ul>
</section>
<section>
<h1><i class="fa fa-pencil-square-o fa-fw"></i><?=sprintf(_('%s-Quests'),$groupsgroup['name'])?></h1>
<ul class="gquests">
<?php foreach($quests as &$quest) : ?>
<li class="cf">
<p>
<span class="date"><?=$dateFormatter->format(new \DateTime($quest['created']))?></span>
<a href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>" class="fwb"><?=$quest['title']?></a>
<span class="xp"><?=$quest['group_xps']?> / <?=$quest['xps']?> <?=_('XPs')?></span>
</p>
</li>
<?php endforeach ?>
</ul>
</section>

View file

@ -0,0 +1,46 @@
<?=$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>
</ul>
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
<nav class="admin">
<li><a href="<?=$linker->link(array('editgroupsgroup',$seminary['url'],$groupsgroup['url']), 1)?>"><?=_('Edit Character groups-group')?></a></li>
<li><a href="<?=$linker->link(array('deletegroupsgroup',$seminary['url'],$groupsgroup['url']), 1)?>"><?=_('Delete Character groups-group')?></a></li>
</nav>
<?php endif ?>
<h1><?=$groupsgroup['name']?></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('creategroup',$seminary['url'],$groupsgroup['url']), 1)?>"><?=sprintf(_('Create new %s Character group'), $groupsgroup['name'])?></a></li>
</nav>
<?php endif ?>
<ol class="cglist rnkng">
<?php foreach($groups as $index => &$group) : ?>
<li>
<?php if($index < 3) : ?>
<img src="<?=$linker->link(array('media','charactergroup',$seminary['url'],$groupsgroup['url'],$group['url']))?>" class="gbanner">
<?php endif ?>
<p><a href="<?=$linker->link(array('group',$seminary['url'],$groupsgroup['url'],$group['url']),1)?>"><?=$group['name']?></a><span class="xp"><?=$group['xps']?> XP</span></p>
</li>
<?php endforeach ?>
</ol>
<h2><?=sprintf(_('%s-Quests'),$groupsgroup['name'])?></h2>
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
<nav class="admin">
<li><a href="<?=$linker->link(array('charactergroupsquests','create',$seminary['url'],$groupsgroup['url']))?>"><?=sprintf(_('Create new %s-Quest'), $groupsgroup['name'])?></a></li>
</nav>
<?php endif ?>
<ul class="cgqlist cf">
<?php foreach($quests as &$quest) : ?>
<li class="cf">
<img src="<?=$linker->link(array('media','charactergroupsquest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>" />
<p><a href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>"><?=$quest['title']?></a></p>
</li>
<?php endforeach ?>
</ul>

View file

@ -0,0 +1,17 @@
<?=$moodpic?>
<ul class="breadcrumbs">
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
</ul>
<h1><?=_('Character Groups')?></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('creategroupsgroup',$seminary['url']),1)?>"><?=_('Create new Character groups-group')?></a></li>
</nav>
<?php endif ?>
<ul class="cglist">
<?php foreach($groupsgroups as &$group) : ?>
<li><a href="<?=$linker->link(array('groupsgroup',$seminary['url'],$group['url']),1)?>"><?=$group['name']?></a></li>
<?php endforeach ?>
</ul>

View file

@ -0,0 +1,107 @@
<?=$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('groupsgroup',$seminary['url'],$groupsgroup['url']),1)?>"><?=$groupsgroup['name']?></a></li>
</ul>
<div class="gbanner cf">
<img src="<?=$linker->link(array('media','charactergroup',$seminary['url'],$groupsgroup['url'],$group['url']))?>" class="gbanner">
<h1><?=$group['name']?></h1>
<?php if(!empty($group['motto'])) : ?>
<p>"<?=$group['motto']?>"</p>
<?php endif ?>
</div>
<ul class="gdata cf">
<li><?=$group['rank']?>. <?=_('Rank')?></li>
<li><?=$group['xps']?> XP</li>
<li><?=count($group['characters'])?> <?=(count($group['characters']) > 1) ? _('Members') : _('Member')?></li>
</ul>
<section>
<h1><i class="fa fa-users fa-fw"></i><?=_('Characters')?></h1>
<form method="post">
<fieldset>
<ul class="gchars cf">
<?php foreach($group['characters'] as &$character) : ?>
<li>
<input type="checkbox" id="characters-<?=$character['id']?>" name="characters[]" value="<?=$character['id']?>" <?php if($character['id'] == \hhu\z\controllers\SeminaryController::$character['id']) : ?>disabled="disabled"<?php endif ?>/>
<label for="characters-<?=$character['id']?>">
<?php if(array_key_exists('small_avatar', $character)) : ?>
<p><img src="<?=$linker->link(array('media','seminary',$seminary['url'],$character['small_avatar']['url']))?>"></p>
<?php endif ?>
<p><a href="<?=$linker->link(array('characters','character',$seminary['url'],$character['url']))?>"><?=$character['name']?></a></p>
<p><small><?=$character['xps']?> XP</small></p>
</label>
</li>
<?php endforeach ?>
</ul>
<input type="submit" name="actions[removecharacters]" value="<?=_('Remove Characters')?>" />
</fieldset>
<fieldset class="filter add">
<p class="fwb"><small>Charaktere der Gruppe hinzufügen:</small></p>
<input type="text" id="filter_input" placeholder="<?=_('Filter Characters')?>" />
<select id="characters" name="characters[]" size="10" multiple="multiple">
<?php foreach($characters as &$character) : ?>
<option value="<?=$character['id']?>"><?=$character['name']?></option>
<?php endforeach ?>
</select>
<input type="submit" name="actions[addcharacters]" value="<?=_('Add Characters')?>" />
</fieldset>
</form>
</section>
<section>
<h1><i class="fa fa-pencil-square-o fa-fw"></i><?=_('Quests')?></h1>
<ul class="gquests">
<?php foreach($quests as &$quest) : ?>
<li class="cf">
<p>
<span class="date"><?=$dateFormatter->format(new \DateTime($quest['created']))?></span>
<a href="<?=$linker->link(array('charactergroupsquests','quest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>" class="fwb"><?=$quest['title']?></a>
<span class="xp"><?=$quest['group_xps']?> / <?=$quest['xps']?> XP</span>
</p>
</li>
<?php endforeach ?>
</ul>
</section>
<script>
/**
* Hide select elements that include the value string from the given input
* element.
*
* @author Lessan Vaezi (http://stackoverflow.com/a/6647367)
*/
jQuery.fn.filterByText = function(textbox) {
return this.each(function() {
var select = this;
var options = [];
$(select).find('option').each(function() {
options.push({value: $(this).val(), text: $(this).text()});
});
$(select).data('options', options);
$(textbox).bind('change keyup', function() {
var options = $(select).empty().data('options');
var search = $.trim($(this).val());
var regex = new RegExp(search,"gi");
$.each(options, function(i) {
var option = options[i];
if(option.text.match(regex) !== null) {
$(select).append(
$('<option>').text(option.text).val(option.value)
);
}
});
});
});
};
$(function() {
$('#characters').filterByText($('#filter_input'));
});
</script>

View file

@ -0,0 +1,90 @@
<?=$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>
</ul>
<h1><?=sprintf(_('New %s-Quest'), $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;
case 'xps':
switch($setting) {
case 'minlength': printf(_('XPs not set'), $value);
break;
case 'regex': echo _('XPs contain illegal characters');
break;
default: echo _('XPs 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>
<label for="title"><?=_('Title')?>:</label>
<input type="text" id="title" name="title" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> />
<label for="xps"><?=_('XPs')?>:</label>
<input type="xps" id="xps" name="xps" placeholder="<?=_('XPs')?>" title="<?=_('XPs')?>" pattern="<?=substr($validationSettings['xps']['regex'],1,strrpos($validationSettings['xps']['regex'],$validationSettings['xps']['regex'][0])-1)?>" value="<?=$xps?>" <?=(array_key_exists('xps', $validation)) ? 'class="invalid"' : null?> />
<label for="questgroup"><?=_('Questgroup')?></label>
<select id="questgroup" name="questgroup">
<?php foreach($questgroups as &$questgroup) : ?>
<option value="<?=$questgroup['url']?>" <?php if(array_key_exists('selected', $questgroup) && $questgroup['selected']) : ?>selected="selected"<?php endif ?>><?=$questgroup['title']?></option>
<?php endforeach ?>
</select>
<label for="description"><?=_('Description')?>:</label>
<textarea id="description" name="description" placeholder="<?=_('Description')?>"><?=$description?></textarea>
<label for="rules"><?=_('Rules')?>:</label>
<textarea id="rules" name="rules" placeholder="<?=_('Rules')?>"><?=$rules?></textarea>
<label for="wonText"><?=_('Won-text')?>:</label>
<textarea id="wonText" name="wonText" placeholder="<?=_('Won-text')?>"><?=$wonText?></textarea>
<label for="lostText"><?=_('Lost-text')?>:</label>
<textarea id="lostText" name="lostText" placeholder="<?=_('Lost-text')?>"><?=$lostText?></textarea>
</fieldset>
<input type="submit" name="create" value="<?=_('create')?>" />
</form>

View 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('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>
</ul>
<h1><?=sprintf(_('Delete %s-Quest'), $groupsgroup['name'])?></h1>
<?=sprintf(_('Should the %s-Quest “%s” really be deleted?'), $groupsgroup['name'], $quest['title'])?>
<form method="post">
<input type="submit" name="delete" value="<?=_('delete')?>" />
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
</form>

View 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>
</ul>
<h1><?=sprintf(_('Edit %s-Quest'), $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;
case 'xps':
switch($setting) {
case 'minlength': printf(_('XPs not set'), $value);
break;
case 'regex': echo _('XPs contain illegal characters');
break;
default: echo _('XPs 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>
<img src="<?=$linker->link(array('media','charactergroupsquest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>" /><br />
<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 type="text" id="title" name="title" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> />
<label for="xps"><?=_('XPs')?>:</label>
<input type="number" id="xps" name="xps" placeholder="<?=_('XPs')?>" title="<?=_('XPs')?>" pattern="<?=substr($validationSettings['xps']['regex'],1,strrpos($validationSettings['xps']['regex'],$validationSettings['xps']['regex'][0])-1)?>" value="<?=$xps?>" <?=(array_key_exists('xps', $validation)) ? 'class="invalid"' : null?> />
<label for="questgroup"><?=_('Questgroup')?></label>
<select id="questgroup" name="questgroup">
<?php foreach($questgroups as &$questgroup) : ?>
<option value="<?=$questgroup['url']?>" <?php if(array_key_exists('selected', $questgroup) && $questgroup['selected']) : ?>selected="selected"<?php endif ?>><?=$questgroup['title']?></option>
<?php endforeach ?>
</select>
<label for="description"><?=_('Description')?>:</label>
<textarea id="description" name="description" placeholder="<?=_('Description')?>"><?=$description?></textarea>
<label for="rules"><?=_('Rules')?>:</label>
<textarea id="rules" name="rules" placeholder="<?=_('Rules')?>"><?=$rules?></textarea>
<label for="wonText"><?=_('Won-text')?>:</label>
<textarea id="wonText" name="wonText" placeholder="<?=_('Won-text')?>"><?=$wonText?></textarea>
<label for="lostText"><?=_('Lost-text')?>:</label>
<textarea id="lostText" name="lostText" placeholder="<?=_('Lost-text')?>"><?=$lostText?></textarea>
</fieldset>
<input type="submit" name="edit" value="<?=_('edit')?>" />
</form>
<script>
$(function() {
$("#description").markItUp(mySettings);
$("#rules").markItUp(mySettings);
$("#wonText").markItUp(mySettings);
$("#lostText").markItUp(mySettings);
});
</script>

View file

@ -0,0 +1,93 @@
<?=$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>
</ul>
<div class="gbanner cf">
<?php if(!is_null($media)) : ?>
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$media['url']))?>" class="grpqimg" />
<?php else : ?>
<img src="<?=$linker->link(array('grafics','charactergroup.jpg'))?>" class="gbanner">
<?php endif ?>
<h1><?=$quest['title']?></h1>
</div>
<ul class="gdata cf">
<li><span class="fwb"><?=sprintf(_('%dXPs'), $quest['xps'])?></span></li>
<li><?php if($questgroup['entered']) : ?><a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$questgroup['url']))?>"><?=$questgroup['title']?></a><?php else : ?><?=$questgroup['title']?><?php endif ?></li>
</ul>
<section>
<h1><i class="fa fa-picture-o fa-fw"></i><?=_('Media')?></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 class="mng" method="post" enctype="multipart/form-data">
<ul class="gqgllry mnglst">
<?php foreach($uploads as &$upload) : ?>
<li>
<input type="checkbox" id="upload_<?=$upload['upload']['id']?>" name="uploads[]" value="<?=$upload['upload']['id']?>" />
<br />
<label for="upload_<?=$upload['upload']['id']?>">
<a href="<?=$linker->link(array('uploads','seminary',$seminary['url'],$upload['upload']['url']))?>">
<img src="<?=$linker->link(array('uploads','seminary',$seminary['url'],$upload['upload']['url'],'thumbnail'))?>" />
</a>
<label>
</li>
<?php endforeach ?>
</ul>
<input type="submit" name="deletemedia" value="<?=_('delete selected')?>" />
</form>
<form class="mng" method="post" enctype="multipart/form-data">
<input type="file" name="media" /><br />
<p><?=_('Allowed file types')?>: <?php foreach($mimetypes as &$mimetype) : ?><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?>MiB) <?php endif ?><?php endforeach ?></p>
<input type="submit" name="setmedia" value="<?=_('upload')?>" />
</form>
</section>
<section>
<h1><i class="fa fa-users fa-fw"></i><?=$groupsgroup['name']?></h1>
<form method="post">
<ul class="grpqlist">
<?php foreach($groups as &$group) : ?>
<li>
<span class="group"><a href="<?=$linker->link(array('charactergroups','group',$seminary['url'],$groupsgroup['url'],$group['url']))?>"><?=$group['name']?></a></span>
<span class="xp">
<select name="xps[<?=$group['url']?>]">
<option value="null" <?php if(is_null($group['quest_group'])) : ?>selected="selected"<?php endif ?>><?=_('Not attended')?></option>
<?php for($i=0; $i<=$quest['xps']; $i++) : ?>
<option value="<?=$i?>" <?php if(!is_null($group['quest_group']) && $group['quest_group']['xps'] == $i) : ?>selected="selected"<?php endif ?>><?=sprintf(_('%dXPs'), $i)?></option>
<?php endfor ?>
</select>
</span>
</li>
<?php endforeach ?>
</ul>
<input type="submit" name="setxps" value="<?=_('Set XPs')?>" />
</form>
</section>

View file

@ -0,0 +1,221 @@
<?=$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>
</ul>
<?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']),1)?>"><?=sprintf(_('Edit %s-Quest'), $groupsgroup['name'])?></a></li>
<li><a href="<?=$linker->link(array('delete',$seminary['url'],$groupsgroup['url'],$quest['url']),1)?>"><?=sprintf(_('Delete %s-Quest'), $groupsgroup['name'])?></a></li>
<li><a href="<?=$linker->link(array('manage',$seminary['url'],$groupsgroup['url'],$quest['url']),1)?>"><?=sprintf(_('Manage %s-Quest'), $groupsgroup['name'])?></a></li>
</nav>
<?php endif ?>
<div class="gbanner cf">
<img src="<?=$linker->link(array('media','charactergroupsquest',$seminary['url'],$groupsgroup['url'],$quest['url']))?>" class="grpqimg" />
<h1><?=$quest['title']?></h1>
</div>
<ul class="gdata cf">
<li><span class="fwb"><?=sprintf(_('%dXPs'), $quest['xps'])?></span></li>
<li><?php if($questgroup['entered']) : ?><a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$questgroup['url']))?>"><?=$questgroup['title']?></a><?php else : ?><?=$questgroup['title']?><?php endif ?></li>
</ul>
<?php if(count($uploads) > 0) : ?>
<section>
<h1><i class="fa fa-picture-o fa-fw"></i><?=_('Media')?></h1>
<ul class="gqgllry">
<?php foreach($uploads as &$upload) : ?>
<li>
<a href="<?=$linker->link(array('uploads','seminary',$seminary['url'],$upload['upload']['url']))?>">
<img src="<?=$linker->link(array('uploads','seminary',$seminary['url'],$upload['upload']['url'],'thumbnail'))?>" />
</a>
</li>
<?php endforeach ?>
</ul>
</section>
<?php endif ?>
<section>
<h1><i class="fa fa-envelope fa-fw"></i><?=_('Description')?></h1>
<div class="qtextbox">
<p class="qtext"><?=$t->t($quest['description'])?></p>
</div>
<?php if(!empty($quest['rules'])) : ?>
<h1><i class="fa fa-exclamation-triangle fa-fw"></i><?=_('Rules')?></h1>
<div class="qtextbox">
<p class="qtext"><?=$t->t($quest['rules'])?></p>
</div>
<?php endif ?>
</section>
<?php if(!empty($quest['won_text'])) : ?>
<section>
<h1><i class="fa fa-thumbs-up fa-fw"></i><?=_('Won Quest')?></h1>
<div class="qtextbox">
<p class="qtext"><?=$t->t($quest['won_text'])?></p>
</div>
</section>
<?php endif ?>
<?php if(!empty($quest['lost_text'])) : ?>
<section>
<h1><i class="fa fa-thumbs-down fa-fw"></i><?=_('Lost Quest')?></h1>
<div class="qtextbox">
<p class="qtext"><?=$t->t($quest['lost_text'])?></p>
</div>
</section>
<?php endif ?>
<section>
<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) : ?>
<nav class="admin">
<ul>
<li><a href="<?=$linker->link(array('charactergroupsqueststations','create',$seminary['url'],$groupsgroup['url'],$quest['url']))?>"><?=_('Create new station')?></a></li>
</ul>
</nav>
<?php endif ?>
<ol class="grpqlist">
<?php foreach($stations as &$station) : ?>
<li>
<span class="group">
<?php if(!array_key_exists('entered', $station) || $station['entered']) : ?>
<a href="<?=$linker->link(array('charactergroupsqueststations','station',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']))?>"><?=$station['title']?></a>
<?php else : ?>
<?=_('Station not yet discovered')?>
<?php endif ?>
</span>
<?php if(array_key_exists('solved', $station) && $station['solved']) : ?>
<span class="xp">
<i class="fa fa-check-circle fa-fw"></i>
</span>
<?php endif ?>
</li>
<?php endforeach ?>
</ol>
<ol class="grpqslist">
<?php foreach($stations as &$station) : ?>
<li>
<?php if(!array_key_exists('entered', $station) || $station['entered']) : ?>
<a href="<?=$linker->link(array('charactergroupsqueststations','station',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']))?>">
<?php if(!is_null($station['stationpicture_id'])) : ?>
<img title="<?=$station['title']?>" src="<?=$linker->link(array('media','charactergroupsqueststation',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']))?>" />
<?php else : ?>
<i class="fa fa-globe"></i>
<?php endif ?>
</a>
<?php else : ?>
<i class="fa fa-question-circle"></i>
<?php endif ?>
</li>
<?php endforeach ?>
</ol>
</section>
<section>
<h1><i class="fa fa-users fa-fw"></i><?=$groupsgroup['name']?></h1>
<ol class="grpqlist">
<?php foreach($groups as &$group) : ?>
<li>
<span class="date"><?=$dateFormatter->format(new \DateTime($group['created']))?></span>
<span class="group"><a href="<?=$linker->link(array('charactergroups','group',$seminary['url'],$groupsgroup['url'],$group['url']))?>"><?=$group['name']?></a></span>
<span class="xp"><?=sprintf(_('%dXPs'), $group['xps'])?></span>
</li>
<?php endforeach ?>
</ol>
</section>
<script>
var markersSource = new ol.source.Vector({
url: '<?=$linker->link(array('charactergroupsqueststations','index',$seminary['url'],$groupsgroup['url'],$quest['url']))?>',
format: new ol.format.GeoJSON()
});
markersSource.on('change', function(e) {
map.getView().fit(
markersSource.getExtent(),
map.getSize(), {
padding: [10, 10, 10, 10]
}
);
});
/*
var pathSource = new ol.source.Vector({
url: '<?=$linker->link(array('charactergroupsqueststations','index',$seminary['url'],$groupsgroup['url'],$quest['url']))?>',
format: new ol.format.GeoJSON()
});
*/
var styleFunction = function(feature, resolution) {
var styles = [];
var geometry = feature.getGeometry();
if(geometry instanceof ol.geom.Point) {
// Point styling
styles.push(
new ol.style.Style({
text: new ol.style.Text({
//text: '\uf041',
text: '\uf276',
font: 'normal 28px FontAwesome',
textBaseline: 'Bottom',
fill: new ol.style.Fill({
color: '#0F373C'
})
})
})
);
}
else if(geometry instanceof ol.geom.LineString) {
// Line styling
styles.push(
new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#50A4AB',
width: 3
})
})
);
// Add arrows
geometry.forEachSegment(function(start, end) {
var dx = end[0] - start[0];
var dy = end[1] - start[1];
var rotation = Math.atan2(dy, dx);
var cx = (start[0] + end[0]) / 2;
var cy = (start[1] + end[1]) / 2;
styles.push(new ol.style.Style({
geometry: new ol.geom.Point([cx, cy]),
text: new ol.style.Text({
text: '\uf178',
font: 'normal 28px FontAwesome',
fill: new ol.style.Fill({
color: '#0F373C'
}),
rotation: -rotation
})
}));
});
}
return styles;
};
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
}),
new ol.layer.Vector({
source: markersSource,
style: styleFunction
})
],
target: 'map',
view: new ol.View({
center: [0, 0],
zoom: 19,
maxZoom: 19
})
});
</script>

View file

@ -0,0 +1,198 @@
<?=$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;
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 ?>
</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($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>
</fieldset>
<fieldset>
<legend><?=_('Location')?></legend>
<div id="map" class="map"></div>
<input id="longitude" name="longitude" type="hidden" value="<?=$longitude?>" />
<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) : ?>
<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>
<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>
<input type="submit" name="create" value="<?=_('create')?>" />
</form>
<script>
$(function() {
$("#prolog").markItUp(mySettings);
$("#task").markItUp(mySettings);
$("#rightText").markItUp(mySettings);
$("#wrongText").markItUp(mySettings);
});
var drawSource = new ol.source.Vector({
wrapX: false
});
var drawLayer = new ol.layer.Vector({
source: drawSource,
style: new ol.style.Style({
text: new ol.style.Text({
//text: '\uf041',
text: '\uf276',
font: 'normal 28px FontAwesome',
textBaseline: 'Bottom',
fill: new ol.style.Fill({
color: '#0F373C'
})
})
})
});
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
}),
drawLayer
],
controls: ol.control.defaults(),
target: 'map',
view: new ol.View({
center: [0, 0],
zoom: 0,
maxZoom: 19
})
});
var draw = new ol.interaction.Draw({
source: drawSource,
type: 'Point',
maxPoints: 1,
});
map.addInteraction(draw);
// Wire events
drawSource.on('addfeature', function(event) {
var coordinates = event.feature.getGeometry().getCoordinates();
coordinates = ol.proj.transform(coordinates, 'EPSG:3857', 'EPSG:4326');
$('#longitude').val(coordinates[0]);
$('#latitude').val(coordinates[1]);
});
draw.on('drawstart', function() {
drawSource.clear();
});
</script>

View 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>

View file

@ -0,0 +1,247 @@
<?=$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;
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 ?>
</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($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>
</fieldset>
<fieldset>
<legend><?=_('Location')?></legend>
<div id="map" class="map"></div>
<input id="longitude" name="longitude" type="hidden" value="<?=$longitude?>" />
<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) : ?>
<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>
<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>
<?php if(!is_null($stationtype['classname'])) : ?>
<input type="submit" name="edit-task" value="<?=_('edit task')?>" />
<?php endif ?>
<input type="submit" name="edit" value="<?=_('save')?>" />
</form>
<script>
$(function() {
$("#prolog").markItUp(mySettings);
$("#task").markItUp(mySettings);
$("#rightText").markItUp(mySettings);
$("#wrongText").markItUp(mySettings);
});
var drawSource = new ol.source.Vector({
wrapX: false
});
var drawLayer = new ol.layer.Vector({
source: drawSource,
style: new ol.style.Style({
text: new ol.style.Text({
//text: '\uf041',
text: '\uf276',
font: 'normal 28px FontAwesome',
textBaseline: 'Bottom',
fill: new ol.style.Fill({
color: '#0F373C'
})
})
})
});
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
}),
drawLayer
],
controls: ol.control.defaults(),
target: 'map',
view: new ol.View({
center: [0, 0],
zoom: 0,
maxZoom: 19
})
});
var draw = new ol.interaction.Draw({
source: drawSource,
type: 'Point',
maxPoints: 1,
});
map.addInteraction(draw);
// Add existing point
var longitude = $('#longitude').val();
var latitude = $('#latitude').val();
if(longitude && latitude) {
drawSource.addFeature(
new ol.Feature({
geometry: new ol.geom.Point(
ol.proj.transform([longitude, latitude], 'EPSG:4326', 'EPSG:3857')
)
})
);
}
// Wire events
drawSource.on('addfeature', function(event) {
var coordinates = event.feature.getGeometry().getCoordinates();
coordinates = ol.proj.transform(coordinates, 'EPSG:3857', 'EPSG:4326');
$('#longitude').val(coordinates[0]);
$('#latitude').val(coordinates[1]);
});
draw.on('drawstart', function() {
drawSource.clear();
});
</script>

View 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('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 task')?></h1>
<?php if(!is_null($task)) : ?>
<?=$task?>
<?php endif ?>

View file

@ -0,0 +1,162 @@
<?=$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>
<?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>
</nav>
<?php endif ?>
<h1><?=$station['title']?></h1>
<ul class="gdata cf">
<?php if(!empty($station['longitude']) && !empty($station['latitude'])) : ?>
<li>
<span class="fwb"><?=sprintf(_('%1.6F°%s %1.6F°%s'), $station['latitude'], ($station['latitude']>0)?'N':'S', $station['longitude'], ($station['longitude']>0)?'E':'W')?></span>
</li>
<?php endif ?>
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
<li>
<a href="<?=$linker->link(array('qrcodes','charactergroupsqueststation',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url'],'50'))?>">
<i class="fa fa-qrcode"></i>
</a>
</li>
<?php endif ?>
<?php if($solved !== false) : ?>
<li>
<i class="fa fa-check-circle fa-fw"></i>
<?php endif ?>
</ul>
<?php if(!empty($station['longitude']) && !empty($station['latitude'])) : ?>
<section>
<div id="map" class="map"></div>
<script type="text/javascript">
var center = ol.proj.transform([<?=$station['longitude']?>, <?=$station['latitude']?>], 'EPSG:4326', 'EPSG:3857');
var markersSource = new ol.source.Vector();
markersSource.addFeature(
new ol.Feature({
geometry: new ol.geom.Point(
ol.proj.transform([<?=$station['longitude']?>, <?=$station['latitude']?>], 'EPSG:4326', 'EPSG:3857')
),
name: '<?=$station['title']?>'
})
);
var markersStyle = new ol.style.Style({
text: new ol.style.Text({
//text: '\uf041',
text: '\uf276',
font: 'normal 28px FontAwesome',
textBaseline: 'Bottom',
fill: new ol.style.Fill({
color: '#0F373C'
})
})
});
var markersLayer = new ol.layer.Vector({
source: markersSource,
style: markersStyle
});
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
}),
markersLayer
],
controls: ol.control.defaults(),
target: 'map',
view: new ol.View({
center: center,
zoom: 18,
maxZoom: 19
})
});
</script>
</section>
<?php endif ?>
<?php if(!empty($groups)) : ?>
<section>
<h1><?=_('Character Groups')?></h1>
<ol class="grpqlist">
<?php foreach($groups as &$group) : ?>
<li>
<span class="date">
<?=$dateFormatter->format(new \DateTime($group['created']))?>
<?=$timeFormatter->format(new \DateTime($group['created']))?>
</span>
<span class="group"><a href="<?=$linker->link(array('charactergroups','group',$seminary['url'],$groupsgroup['url'],$group['url']))?>"><?=$group['name']?></a></span>
<?php if($group['solved'] !== false) : ?>
<span class="xp">
<?=_(sprintf('solved at %s', $timeFormatter->format(new \DateTime($group['solved']))))?>
<i class="fa fa-check-circle fa-fw"></i>
</span>
<?php endif ?>
</li>
<?php endforeach ?>
</ol>
</section>
<?php endif ?>
<?php if(!empty($station['prolog'])) : ?>
<section>
<div class="qtextbox">
<p class="qtext cf">
<?=str_replace('<p>', '', str_replace('</p>', '', $t->t($station['prolog'])))?>
</p>
</div>
</section>
<?php endif ?>
<?php if(!is_null($task)) : ?>
<section class="task">
<h1 id="task"><?=_('Task')?></h1>
<?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 : ?>
<div class="text">
<?=$t->t($station['task'])?>
<?=$task?>
</div>
<?php endif ?>
</section>
<?php endif ?>

View file

@ -0,0 +1,152 @@
<?=$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>
<?php if(count(array_intersect(array('admin','moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
<a href="<?=$linker->link(array('index',$seminary['url']), 1)?>"><?=_('Characters')?></a>
<?php else : ?>
<?=_('Characters')?>
<?php endif ?>
</li>
</ul>
<h1><i class="fa fa-user fa-fw"></i><?=$character['name']?></h1>
<nav class="admin">
<?php if(count(array_intersect(array('admin','moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0 || $character['id'] == \hhu\z\controllers\SeminaryController::$character['id']) : ?>
<li><a href="<?=$linker->link(array('edit',$seminary['url'],$character['url']),1)?>"><?=_('Edit Character')?></a></li>
<?php endif ?>
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
<li><a href="<?=$linker->link(array('delete',$seminary['url'],$character['url']),1)?>"><?=_('Delete Character')?></a></li>
<?php endif ?>
</nav>
<section class="cf">
<div class="cinfo">
<div class="cdata">
<div class="xpbar">
<span style="width:<?=($seminary['achievable_xps'] > 0) ? round($character['quest_xps']*100/$seminary['achievable_xps']) : 0?>%"></span>
</div>
<p><small><?=_('Total progress')?>: <?=($seminary['achievable_xps'] > 0) ? round($character['quest_xps']*100/$seminary['achievable_xps']) : 0?>%</small></p>
</div>
<?php if(array_key_exists('xplevel', $character) && !is_null($character['xplevel'])) : ?>
<div class="cdata square">
<p class="value"><?=$character['xplevel']['level']?></p>
<p><small><?=_('Level')?></small></p>
</div>
<?php endif ?>
<div class="cdata square">
<p class="value"><?=$character['xps']?></p>
<p><small>XP</small></p>
</div>
<div class="cdata square blue">
<p class="value"><?=$character['rank']?>.</p>
<p><small><?=_('Rank')?></small></p>
</div>
<h2><i class="fa fa-bookmark fa-fw"></i><?=_('Milestones')?></h2>
<ul class="crewards">
<?php foreach($milestones as &$milestone) : ?>
<li>
<?php if($milestone['achieved']) : ?>
<p class="unlocked fwb"><i class="fa fa-check-circle fa-fw"></i><?=$milestone['title']?></p>
<?php elseif($milestone['deadline'] < date('Y-m-d H:i:s')) : ?>
<p class="passed fwb"><i class="fa fa-times-circle fa-fw"></i><?=$milestone['title']?></p>
<?php else : ?>
<p class="fwb"><i class="fa fa-lock fa-fw"></i><?=$milestone['title']?></p>
<?php endif ?>
<p><?=\hhu\z\Utils::t($milestone['description'])?></p>
</li>
<?php endforeach ?>
</ul>
</div>
<?php if(array_key_exists('xplevel', $character) && !is_null($character['xplevel'])) : ?>
<div class="cportrait">
<?php if(array_key_exists('avatar', $character) && !is_null($character['avatar']['avatarpicture_id'])) : ?>
<img src="<?=$linker->link(array('media','avatar',$seminary['url'],$character['charactertype_url'],$character['xplevel']['level']))?>" />
<?php endif ?>
</div>
<?php endif ?>
</section>
<div class="cf">
<section class="fll48">
<h2><i class="fa fa-list fa-fw"></i><?=_('Ranking')?></h2>
<ul class="cranks">
<?php foreach($ranking['superior'] as $index => &$rankCharacter) : ?>
<li>
<a href="<?=$linker->link($rankCharacter['url'],3)?>"><img src="<?=$linker->link(array('media','avatar',$seminary['url'],$rankCharacter['charactertype_url'],$rankCharacter['xplevel'],'portrait'))?>"></a>
<p><?=$character['rank']-count($ranking['superior'])+$index?>. <a href="<?=$linker->link($rankCharacter['url'],3)?>"><?=$rankCharacter['name']?></a></p>
<p><small>
<?php if(array_key_exists('xplevel', $rankCharacter) && !is_null($rankCharacter['xplevel'])) : ?>
<?=_('Level')?> <?=$rankCharacter['xplevel']?> (<?=sprintf(_('%dXPs'), $rankCharacter['xps'])?>)
<?php else : ?>
<?=sprintf(_('%dXPs'), $rankCharacter['xps'])?>
<?php endif ?>
</small></p>
</li>
<?php endforeach ?>
<li>
<?php if(array_key_exists('avatar', $character) && !is_null($character['avatar']['avatarpicture_id'])) : ?>
<img src="<?=$linker->link(array('media','avatar',$seminary['url'],$character['charactertype_url'],$character['xplevel']['level'],'portrait'))?>">
<?php endif ?>
<p class="fwb"><?=$character['rank']?>. <?=$character['name']?></p>
<p><small>
<?php if(array_key_exists('xplevel', $character) && !is_null($character['xplevel'])) : ?>
<?=_('Level')?> <?=$character['xplevel']['level']?> (<?=sprintf(_('%dXPs'), $character['xps'])?>)
<?php else : ?>
<?=sprintf(_('%dXPs'), $character['xps'])?>
<?php endif ?>
</small></p>
</li>
<?php foreach($ranking['inferior'] as $index => &$rankCharacter) : ?>
<li>
<a href="<?=$linker->link($rankCharacter['url'],3)?>"><img src="<?=$linker->link(array('media','avatar',$seminary['url'],$rankCharacter['charactertype_url'],$rankCharacter['xplevel'],'portrait'))?>"></a>
<p><?=$character['rank']+$index+1?>. <a href="<?=$linker->link($rankCharacter['url'],3)?>"><?=$rankCharacter['name']?></a></p>
<p><small>
<?php if(array_key_exists('xplevel', $rankCharacter) && !is_null($rankCharacter['xplevel'])) : ?>
<?=_('Level')?> <?=$rankCharacter['xplevel']?> (<?=sprintf(_('%dXPs'), $rankCharacter['xps'])?>)
<?php else : ?>
<?=sprintf(_('%dXPs'), $rankCharacter['xps'])?>
<?php endif ?>
</small></p>
</li>
<?php endforeach ?>
</ul>
</section>
<section class="flr48">
<h2><i class="fa fa-users fa-fw"></i><?=_('Character Groups')?></h2>
<ul class="cranks">
<?php foreach($groups as &$group) : ?>
<li>
<a href="<?=$linker->link(array('charactergroups','group',$seminary['url'],$group['charactergroupsgroup_url'],$group['url']))?>">
<img src="<?=$linker->link(array('media','charactergroup',$seminary['url'],$group['groupsgroup']['url'],$group['url']))?>" class="gbanner">
</a>
<p><a href="<?=$linker->link(array('charactergroups','group',$seminary['url'],$group['charactergroupsgroup_url'],$group['url']))?>"><?=$group['name']?></a></p>
<p><small><?=sprintf(_('%dXPs'), $group['xps'])?></small></p>
</li>
<?php endforeach ?>
</ul>
</section>
</div>
<?php if(!is_null($lastQuest)) : ?>
<section>
<h2><i class="fa fa-share-square fa-fw"></i><?=_('Last Quest')?></h2>
<p><i class="fa fa-pencil-square-o fa-fw"></i><a href="<?=$linker->link(array('quests','quest',$seminary['url'],$lastQuest['questgroup']['url'],$lastQuest['url']))?>"><?=$lastQuest['title']?></a></p>
</section>
<?php endif ?>
<section>
<h2><i class="fa fa-book fa-fw"></i><?=_('Topic progress')?></h2>
<ul class="ctopics cf">
<?php foreach($questtopics as &$topic) : ?>
<li>
<p><small><a href="<?=$linker->link(array('library','topic',$seminary['url'],$topic['url']))?>"><?=$topic['title']?></a> (<?=$topic['characterQuestcount']?>/<?=$topic['questcount']?>)</small></p>
<div class="xpbar">
<span style="width:<?=round($topic['characterQuestcount']/$topic['questcount']*100)?>%"></span>
</div>
</li>
<?php endforeach ?>
</ul>
</section>

View file

@ -0,0 +1,15 @@
<?=$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('characters','index',$seminary['url']))?>"><?=_('Characters')?></a>
</li>
</ul>
<h1><?=_('Delete Character')?></h1>
<?=sprintf(_('Should the Character “%s” of user “%s” (%s) really be deleted?'), $character['name'], $user['username'], $user['email'])?>
<form method="post">
<input type="submit" name="delete" value="<?=_('delete')?>" />
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
</form>

View file

@ -0,0 +1,105 @@
<?=$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>
<?php if(count(array_intersect(array('admin','moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
<a href="<?=$linker->link(array('index',$seminary['url']), 1)?>"><?=_('Characters')?></a>
<?php else : ?>
<?=_('Characters')?>
<?php endif ?>
</li>
</ul>
<h1><?=_('Edit Character')?></h1>
<form method="post" action="" class="logreg">
<?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 'charactername':
switch($setting) {
case 'minlength': printf(_('Character name is too short (min. %d chars)'), $value);
break;
case 'maxlength': printf(_('Character name is too long (max. %d chars)'), $value);
break;
case 'regex': echo _('Character name contains illegal characters');
break;
case 'exist': echo _('Character name already exists');
break;
default: echo _('Character name invalid');
}
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<fieldset>
<legend class="fwb"><?=_('Character properties')?></legend>
<label for="charactername"><?=_('Character name')?>:</label>
<?php if(count(array_intersect(array('admin','moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
<input type="text" name="charactername" placeholder="<?=_('Character name')?>" required="required" value="<?=$charactername?>" maxlength="<?=$validationSettings['charactername']['maxlength']?>" <?=(array_key_exists('charactername', $validation)) ? 'class="invalid"' : null ?>/>
<?php else : ?>
<input type="text" name="charactername" placeholder="<?=_('Character name')?>" disabled="disabled" value="<?=$charactername?>" />
<input type="hidden" name="charactername" value="<?=$charactername?>" />
<?php endif ?><br />
<ul class="avatar">
<?php foreach($types as &$type) : ?>
<li>
<label for="type-<?=$type['id']?>">
<p><?=$type['name']?></p>
<img id="avatar" src="<?=$linker->link(array('media','avatar',$seminary['url'],$type['url'],$xplevels[0]['level'],'portrait'))?>" />
</label>
<?php if(count(array_intersect(array('admin','moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
<input id="type-<?=$type['id']?>" name="type" type="radio" value="<?=$type['url']?>" <?php if(array_key_exists('selected', $type) && $type['selected']) : ?>checked="checked"<?php endif ?> />
<?php else : ?>
<input id="type-<?=$type['id']?>" name="type" type="radio" disabled="disabled" value="<?=$type['url']?>" <?php if(array_key_exists('selected', $type) && $type['selected']) : ?>checked="checked"<?php endif ?> />
<?php if(array_key_exists('selected', $type) && $type['selected']) : ?>
<input name="type" type="hidden" value="<?=$type['url']?>" />
<?php endif ?>
<?php endif ?>
</li>
<?php endforeach ?>
</ul>
</fieldset>
<?php if($fieldsValidation !== true) : ?>
<ul>
<?php foreach($fieldsValidation as $field => &$settings) : ?>
<li><?=sprintf(_('The Seminary field “%s” is invalid'), $field)?></li>
<?php endforeach ?>
</ul>
<?php endif ?>
<fieldset>
<legend class="fwb"><?=_('Seminary fields')?></legend>
<?php foreach($fields as &$field) : ?>
<label for="fields[<?=$field['url']?>]"><?=$field['title']?>:</label>
<?php switch($field['type_title']) {
case 'Number':
case 'Varchar': ?>
<input type="text" name="fields[<?=$field['url']?>]" pattern="<?=(!empty($field['regex'])) ? substr($field['regex'],1,strrpos($field['regex'],$field['regex'][0])-1) : ''?>" <?php if(array_key_exists('uservalue', $field)) : ?>value="<?=$field['uservalue']?>"<?php endif ?> <?php if($field['required']) : ?>required="required"<?php endif ?>/>
<?php break;
case 'Text': ?>
<textarea name="fields[<?=$field['url']?>]"><?=(array_key_exists('uservalue', $field) ? $field['uservalue'] : null)?></textarea>
<?php break;
case 'List': ?>
<select name="fields[<?=$field['url']?>]">
<?php foreach(explode('|', substr($field['regex'],1,strrpos($field['regex'],$field['regex'][0])-1)) as $option) : ?>
<option value="<?=mb_eregi_replace('\\\\','',$option)?>" <?php if(array_key_exists('uservalue', $field) && $field['uservalue'] == mb_eregi_replace('\\\\','',$option)) : ?>selected="selected"<?php endif ?>><?=mb_eregi_replace('\\\\','',$option)?></option>
<?php endforeach?>
</select>
<?php break;
} ?>
<br />
<?php endforeach ?>
</fieldset>
<input type="submit" name="edit" value="<?=_('edit')?>" />
</form>

View file

@ -0,0 +1,113 @@
<?=$moodpic?>
<ul class="breadcrumbs">
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
</ul>
<h1><?=_('Characters')?></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('xplevels','manage',$seminary['url']))?>"><?=_('Manage XP-levels')?></a></li>
<li><a href="<?=$linker->link(array('charactertypes','index',$seminary['url']))?>"><?=_('Manage Charactertypes')?></a></li>
</nav>
<nav class="admin">
<li><a href="<?=$linker->link(array('manage',$seminary['url']),1)?>"><?=_('Manage Characters')?></a></li>
</nav>
<?php endif ?>
<form method="get" class="logreg admnqf">
<fieldset>
<legend><?=_('Filters')?></legend>
<small><?=_('Sortorder')?>:</small>
<select name="sortorder" onchange="this.form.submit();">
<option value="name" <?php if($sortorder == 'name') : ?>selected="selected"<?php endif ?>><?=_('Character name')?></option>
<option value="xps" <?php if($sortorder == 'xps') : ?>selected="selected"<?php endif ?>><?=_('XPs')?></option>
<option value="role" <?php if($sortorder == 'role') : ?>selected="selected"<?php endif ?>><?=_('Role')?></option>
<option value="created" <?php if($sortorder == 'created') : ?>selected="selected"<?php endif ?>><?=_('Date of registration')?></option>
<?php foreach($characterfields as &$characterfield) : ?>
<option value="<?=$characterfield['url']?>" <?php if($sortorder == $characterfield['url']) : ?>selected="selected"<?php endif ?>><?=$characterfield['title']?></option>
<?php endforeach ?>
</select>
<label for="charactername"><?=_('Character name')?>:</label>
<input id="charactername" type="text" name="charactername" placeholder="<?=_('Character name')?>" value="<?=$charactername?>" />
</fieldset>
<input type="submit" value="<?=_('Apply filters')?>" />
</form>
<ul id="characterlist" class="admnql">
<?php foreach($characters as &$character) : ?>
<li class="cf">
<?php if(array_key_exists('avatar', $character) && !is_null($character['avatar']['small_avatarpicture_id'])) : ?>
<img src="<?=$linker->link(array('media','avatar',$seminary['url'],$character['charactertype_url'],$character['xplevel']['level'],'portrait'))?>">
<?php endif ?>
<p><a href="<?=$linker->link(array('characters','character',$seminary['url'],$character['url']))?>"><?=$character['name']?></a><span><?=$character['xps']?> XP</span></p>
<p><small><a href="<?=$linker->link(array('users','user',$character['user']['url']))?>"><?=$character['user']['username']?></a></small>
<?php if(in_array('admin', $character['characterroles'])) : ?><small>(<?=_('Admin')?>)</small><?php endif ?>
<?php if(in_array('moderator', $character['characterroles'])) : ?><small>(<?=_('Moderator')?>)</small><?php endif ?>
<?php if(in_array('user', $character['characterroles'])) : ?><small>(<?=_('User')?>)</small><?php endif ?>
</p>
<?php foreach($character['characterfields'] as &$characterfield) : ?>
<p class="chrflds"><?=$characterfield['value']?></p>
<?php endforeach ?>
</li>
<?php endforeach ?>
</ul>
<?php if(is_null($all) && ($page*$limit) < $charactersCount) : ?>
<nav class="admin">
<li><a id="show-more" href="<?=$linker->link(null,3,true,array('page'=>$page+1,'sortorder'=>$sortorder))?>"><?=_('Show more')?></a></li>
<li><a id="show-all" href="<?=$linker->link('all',3,true,array('sortorder'=>$sortorder))?>"><?=_('Show all')?></a></li>
</nav>
<?php endif ?>
<script>
var page = 1;
var request;
var linkAvatar = "<?=$linker->link(array('media','avatar','SEMINARY','CHARACTERTYPE','XPLEVEL','portrait'))?>";
var linkCharacter = "<?=$linker->link(array('character','SEMINARY','CHARACTER'),1)?>";
var linkUser = "<?=$linker->link(array('users','user','USER'))?>";
var linkPage = "<?=$linker->link(null,3,true,array('page'=>'PAGE','sortorder'=>$sortorder))?>";
$("#show-more").click(function(event) {
if(request) {
request.abort();
}
page++;
request = $.getJSON(linkPage.replace('PAGE', page), function(data) {
linkAvatar = linkAvatar.replace('SEMINARY', data['seminary']['url']);
linkCharacter = linkCharacter.replace('SEMINARY', data['seminary']['url']);
$.each(data['characters'], function(key, character) {
var urlAvatar = linkAvatar.replace('CHARACTERTYPE', character['charactertype_url']).replace('XPLEVEL', character['xplevel']['level']);
var urlCharacter = linkCharacter.replace('CHARACTER', character['url']);
var urlUser = linkUser.replace('USER', character['user']['url']);
$("#characterlist").append(
"<li class=\"cf\">" +
"<img src=\"" + urlAvatar + "\" />" +
"<p><a href=\"" + urlCharacter + "\">" + character['name'] + "</a><span>" + character['xps'] + " <?=_('XPs')?></span></p>" +
"<p>" +
"<small><a href=\"" + urlUser + "\">" + character['user']['username'] + "</a></small>\n" +
(character['characterroles'].length > 0 ? "<small>(" + character['characterroles'].join(', ') + ")</small>" : '') +
"</p>" +
"<p class=\"chrflds\">" + $.map(character['characterfields'], function(val, i) {
return val['value'];
}).join('</p>\n<p class="chrflds">') + "</p>" +
"</li>"
);
});
if(data['more']) {
$("#show-more").attr('href', linkPage.replace('PAGE', page+1));
}
else {
$("#show-more").remove();
$("#show-all").remove();
}
});
request.fail(function (jqXHR, textStatus, errorThrown) {
window.location.href = linkPage.replace('PAGE', page);
});
event.preventDefault();
return false;
});
</script>

View file

@ -0,0 +1,61 @@
<?=$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('characters','index',$seminary['url']))?>"><?=_('Characters')?></a></li>
</ul>
<h1><?=_('Manage Characters')?></h1>
<form method="post">
<fieldset class="filter">
<p><small>Sortierung:</small></p>
<select name="sortorder" onchange="this.form.submit();">
<option value="name" <?php if($sortorder == 'charactername') : ?>selected="selected"<?php endif ?>><?=_('Character name')?></option>
<option value="xps" <?php if($sortorder == 'xps') : ?>selected="selected"<?php endif ?>><?=_('XPs')?></option>
<option value="role" <?php if($sortorder == 'role') : ?>selected="selected"<?php endif ?>><?=_('Role')?></option>
<option value="created" <?php if($sortorder == 'date') : ?>selected="selected"<?php endif ?>><?=_('Date of registration')?></option>
<?php foreach($characterfields as &$characterfield) : ?>
<option value="<?=$characterfield['url']?>" <?php if($sortorder == $characterfield['url']) : ?>selected="selected"<?php endif ?>><?=$characterfield['title']?></option>
<?php endforeach ?>
</select>
<noscript><input type="submit" value="<?=_('Sort list')?>" /></noscript>
</fieldset>
<fieldset>
<ul class="admnql">
<?php foreach($characters as &$character) : ?>
<li class="cf">
<input type="checkbox" id="characters-<?=$character['id']?>" name="characters[]" value="<?=$character['id']?>" <?php if(in_array($character['id'], $selectedCharacters)) : ?>checked="checked"<?php endif ?> <?php if($character['id'] == \hhu\z\controllers\SeminaryController::$character['id']) : ?>disabled="disabled"<?php endif ?>/>
<label for="characters-<?=$character['id']?>">
<?php if(array_key_exists('avatar', $character) && !is_null($character['avatar']['small_avatarpicture_id'])) : ?>
<img src="<?=$linker->link(array('media','avatar',$seminary['url'],$character['charactertype_url'],$character['xplevel']['level'],'portrait'))?>">
<?php endif ?>
<p><a href="<?=$linker->link(array('characters','character',$seminary['url'],$character['url']))?>"><?=$character['name']?></a><span><?=$character['xps']?> XP</span></p>
<p><small><a href="<?=$linker->link(array('users','user',$character['user']['url']))?>"><?=$character['user']['username']?></a></small>
<?php if(in_array('admin', $character['characterroles'])) : ?><small>(<?=_('Admin')?>)</small><?php endif ?>
<?php if(in_array('moderator', $character['characterroles'])) : ?><small>(<?=_('Moderator')?>)</small><?php endif ?>
<?php if(in_array('user', $character['characterroles'])) : ?><small>(<?=_('User')?>)</small><?php endif ?>
</p>
<?php foreach($character['characterfields'] as &$characterfield) : ?>
<p class="chrflds"><?=$characterfield['value']?></p>
<?php endforeach ?>
</label>
</li>
<?php endforeach ?>
</ul>
</fieldset>
<fieldset>
<legend><?=_('Add role')?></legend>
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) > 0 || !in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?>
<input type="submit" name="actions[addrole]" value="<?=_('Admin')?>" />
<input type="submit" name="actions[addrole]" value="<?=_('Moderator')?>" />
<?php endif ?>
<input type="submit" name="actions[addrole]" value="<?=_('User')?>" />
</fieldset>
<fieldset>
<legend><?=_('Remove role')?></legend>
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) > 0 || !in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?>
<input type="submit" name="actions[removerole]" value="<?=_('Admin')?>" />
<input type="submit" name="actions[removerole]" value="<?=_('Moderator')?>" />
<?php endif ?>
<input type="submit" name="actions[removerole]" value="<?=_('User')?>" />
</fieldset>
</form>

View file

@ -0,0 +1,93 @@
<?=$moodpic?>
<ul class="breadcrumbs">
<li><?=$seminary['title']?></li>
<li><i class="fa fa-chevron-right fa-fw"></i><?=_('Characters')?></li>
</ul>
<h1><?=_('Create Character')?></h1>
<form method="post" action="" class="logreg">
<?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 'charactername':
switch($setting) {
case 'minlength': printf(_('Character name is too short (min. %d chars)'), $value);
break;
case 'maxlength': printf(_('Character name is too long (max. %d chars)'), $value);
break;
case 'regex': echo _('Character name contains illegal characters');
break;
case 'exist': echo _('Character name already exists');
break;
default: echo _('Character name invalid');
}
break;
case 'type':
switch($setting) {
case 'exist': echo _('Please choose an avatar');
break;
}
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<fieldset>
<legend class="fwb"><?=_('Character properties')?></legend>
<label for="charactername"><?=_('Character name')?>:</label>
<input type="text" name="charactername" placeholder="<?=_('Character name')?>" required="required" value="<?=$charactername?>" /><br />
<ul class="avatar">
<?php foreach($types as &$type) : ?>
<li>
<label for="type-<?=$type['id']?>">
<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 ?>
</label>
<input id="type-<?=$type['id']?>" name="type" type="radio" value="<?=$type['url']?>" <?php if(array_key_exists('selected', $type) && $type['selected']) : ?>checked="checked"<?php endif ?> />
</li>
<?php endforeach ?>
</ul>
</fieldset>
<?php if($fieldsValidation !== true) : ?>
<ul>
<?php foreach($fieldsValidation as $field => &$settings) : ?>
<li><?=sprintf(_('The Seminary field “%s” is invalid'), $field)?></li>
<?php endforeach ?>
</ul>
<?php endif ?>
<fieldset>
<legend class="fwb"><?=_('Seminary fields')?></legend>
<?php foreach($fields as &$field) : ?>
<label for="fields[<?=$field['url']?>]"><?=$field['title']?>:</label>
<?php switch($field['type_title']) {
case 'Number':
case 'Varchar': ?>
<input type="text" name="fields[<?=$field['url']?>]" pattern="<?=(!empty($field['regex'])) ? substr($field['regex'],1,strrpos($field['regex'],$field['regex'][0])-1) : ''?>" <?php if(array_key_exists('uservalue', $field)) : ?>value="<?=$field['uservalue']?>"<?php endif ?> <?php if($field['required']) : ?>required="required"<?php endif ?>/>
<?php break;
case 'Text': ?>
<textarea name="fields[<?=$field['url']?>]"><?=(array_key_exists('uservalue', $field) ? $field['uservalue'] : null)?></textarea>
<?php break;
case 'List': ?>
<select name="fields[<?=$field['url']?>]">
<?php foreach(explode('|', substr($field['regex'],1,strrpos($field['regex'],$field['regex'][0])-1)) as $option) : ?>
<option value="<?=mb_eregi_replace('\\\\','',$option)?>" <?php if(array_key_exists('uservalue', $field) && $field['uservalue'] == mb_eregi_replace('\\\\','',$option)) : ?>selected="selected"<?php endif ?>><?=mb_eregi_replace('\\\\','',$option)?></option>
<?php endforeach?>
</select>
<?php break;
} ?>
<br />
<?php endforeach ?>
</fieldset>
<input type="submit" name="create" value="<?=_('create')?>" />
</form>

View 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>

View 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>

View 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>

View 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>

View file

@ -0,0 +1,17 @@
<h1><?=_('Error')?></h1>
<p class="error"><?=$code?>: <?=$string?></p>
<?php if($code == 403 && $userId <= 0) : ?>
<h2><?=_('Login')?></h2>
<form method="post" action="<?=$linker->link(array('users','login'))?>" class="logreg">
<fieldset>
<label for="username"><?=_('Username')?>:</label>
<input name="username" type="text" placeholder="<?=_('Username')?>" title="<?=_('Username')?>" required="required" autofocus="autofocus" /><br />
<label for="password"><?=_('Password')?>:</label>
<input name="password" type="password" placeholder="<?=_('Password')?>" title="<?=_('Password')?>" required="required" /><br />
</fieldset>
<input type="hidden" name="referrer" value="<?=$linker->link(null, null, false)?>" />
<input type="submit" name="login" class="cta" value="<?=_('Login')?>" />
<?=_('or')?> <a href="<?=$linker->link(array('users','register'))?>"><?=_('register yourself')?></a>
</form>
<?php endif ?>

126
views/html/html.tpl Normal file
View file

@ -0,0 +1,126 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="description" content="">
<meta name="robots" content="noindex,follow">
<title><?=(isset($title)) ? $title : \nre\configs\AppConfig::$app['name']?></title>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet" type="text/css">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="<?=$linker->link(array('markitup','skins','markitup','style.css'))?>" media="all" />
<link rel="stylesheet" type="text/css" href="<?=$linker->link(array('markitup','sets','textile','style.css'))?>" media="all" />
<link rel="stylesheet" type="text/css" href="<?=$linker->link(array('css','desktop.css'))?>" media="all" />
<link rel="stylesheet" type="text/css" href="<?=$linker->link(array('css','ol.css'))?>" media="all" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="<?=$linker->link(array('js','jquery-ui.min.js'))?>"></script>
<script type="text/javascript" src="<?=$linker->link(array('js','jquery.nicescroll.min.js'))?>"></script>
<script type="text/javascript" src="<?=$linker->link(array('js','ol.js'))?>"></script>
<script type="text/javascript" src="<?=$linker->link(array('js','imagelightbox.min.js'))?>"></script>
<!--[if lt IE 9]>
<script type="text/javascript" src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js"></script>
<![endif]-->
<script type="text/javascript" src="<?=$linker->link(array('markitup','jquery.markitup.js'))?>"></script>
<script type="text/javascript" src="<?=$linker->link(array('markitup','sets','textile','set.js'))?>"></script>
<script type="text/javascript" src="<?=$linker->link(array('js','scripts.js'))?>"></script>
</head>
<body>
<header>
<nav class="cf">
<input type="checkbox" id="toggle">
<label for="toggle" class="toggle" onclick><i class="fa fa-bars"></i>Menü</label>
<div id="home">
<a href="<?=$linker->link(array(), 0, true, array(), true)?>"><?=\nre\configs\AppConfig::$app['name']?></a>
<?php if(!empty($mailcontact)) : ?>
<a class="contact" href="mailto:<?=$mailcontact?>"><?=$mailcontact?></a>
<?php endif ?>
</div>
<?php if(!is_null($loggedUser)) : ?>
<div id="profile" class="cf">
<?php if(!is_null($loggedCharacter)) : ?>
<a href="<?=$linker->link(array('characters','character',$loggedSeminary['url'],$loggedCharacter['url']))?>">
<?php if(array_key_exists('avatar', $loggedCharacter) && !is_null($loggedCharacter['avatar']['small_avatarpicture_id'])) : ?>
<img src="<?=$linker->link(array('media','avatar',$loggedSeminary['url'],$loggedCharacter['charactertype_url'],$loggedCharacter['xplevel']['level'],'portrait'))?>" />
<?php endif ?>
<span><?=$loggedCharacter['name']?></span><span class="lvlname">Level <?=$loggedCharacter['xplevel']['level']?></span>
</a>
<?php else : ?>
<a href="<?=$linker->link(array('users',$loggedUser['url']))?>"><?=$loggedUser['username']?><span class="lvlname"><?=$loggedUser['prename']?> <?=$loggedUser['surname']?></span></a>
<?php endif ?>
</div>
<?php endif ?>
<div id="mainmenu">
<ul>
<?=$menu?>
</ul>
<div id="promoLogo" class="promo">
<a href="http://www.questlab.zone">
<img src="<?=$linker->link(array('grafics','questlab-logo.svg'))?>" />
</a>
</div>
</div>
<div id="promoText" class="promo">
<a href="http://www.questlab.zone">
<img src="<?=$linker->link(array('grafics','questlab-text.svg'))?>" />
</a>
</div>
</nav>
</header>
<article class="wrap">
<?php if(count($notifications) > 0) : ?>
<ul class="notify">
<?php foreach($notifications as &$notification) : ?>
<?php if($notification['type'] == \hhu\z\controllers\components\NotificationComponent::TYPE_ACHIEVEMENT) : ?>
<li class="cf">
<?php if(!is_null($notification['image'])) : ?>
<img src="<?=$notification['image']?>" />
<?php endif ?>
<p class="announce"><i class="fa fa-trophy fa-fw"></i><?=_('Achievement')?>:<i class="fa fa-times fa-fw"></i></p>
<?php if(!is_null($notification['link'])) : ?>
<p class="fwb"><a href="<?=$notification['link']?>"><?=$notification['message']?></a></p>
<?php else : ?>
<p class="fwb"><?=$notification['message']?></p>
<?php endif ?>
</li>
<?php else : ?>
<li class="cf">
<img src="<?=$linker->link(array('grafics','lvlup.jpg'))?>">
<p class="announce"><i class="fa fa-arrow-up fa-fw"></i><?=_('Level-up')?>:<i class="fa fa-times fa-fw"></i></p>
<?php if(!is_null($notification['link'])) : ?>
<p class="fwb"><a href="<?=$notification['link']?>"><?=sprintf(_('You have reached level %d'), $notification['message'])?></a></p>
<?php else : ?>
<p class="fwb"><?=sprintf(_('You have reached level %d'), $notification['message'])?></p>
<?php endif ?>
</li>
<?php endif ?>
<?php endforeach ?>
</ul>
<audio id="notify-sound" preload="auto" src="<?=$linker->link(array('sounds','notification.mp3'))?>"></audio>
<?php endif ?>
<?=$intermediate?>
</article>
<aside>
<?php if(!is_null($loggedCharacter) && count($loggedCharacter['characterroles']) > 0) : ?>
<?=$seminarybar?>
<?php endif ?>
</aside>
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://" + document.location.hostname + "/analytics/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', 1]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript';
g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="/analytics/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
</body>
</html>

View file

@ -0,0 +1,18 @@
<div class="moodpic">
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
</div>
<h1><?=\nre\configs\AppConfig::$app['name']?></h1>
<form method="post">
<fieldset>
<legend><?=_('Introduction text')?></legend>
<textarea id="text" name="text" placeholder="<?=_('Please enter an introduction text')?>"><?=$text?></textarea>
</fieldset>
<input type="submit" name="edit" value="<?=_('save')?>" />
<input type="submit" name="cancel" value="<?=_('cancel')?>" />
</form>
<script>
$(function() {
$("#text").markItUp(mySettings);
});
</script>

View file

@ -0,0 +1,38 @@
<div class="moodpic">
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
</div>
<?php if(is_null($userId)) : ?>
<form method="post" action="<?=$linker->link(array('users','login'))?>" class="logreg front">
<fieldset>
<p>
<label for="username"><?=_('Username')?>:</label>
<input id="username" name="username" type="text" placeholder="<?=_('Username')?>" title="<?=_('Username')?>" required="required" autofocus="autofocus" />
</p>
<p>
<label for="password"><?=_('Password')?>:</label>
<input id="password" name="password" type="password" placeholder="<?=_('Password')?>" title="<?=_('Password')?>" required="required" />
</p>
<input type="submit" name="login" class="cta" value="<?=_('Login')?>" />
</fieldset>
<p class="register"><?=_('or')?> <a href="<?=$linker->link(array('users','register'))?>"><?=_('register yourself')?></a></p>
</form>
<?php endif ?>
<?php if(!is_null(\hhu\z\controllers\IntermediateController::$user) && in_array('admin',\hhu\z\controllers\IntermediateController::$user['roles'])) : ?>
<nav class="admin">
<li><a href="<?=$linker->link('edit', 1)?>"><?=_('edit')?></a></li>
</nav>
<?php endif ?>
<h1><?=\nre\configs\AppConfig::$app['name']?></h1>
<?php if(!empty($text)) : ?>
<div class="text">
<?=$t->t($text)?>
</div>
<?php endif ?>
<hr />
<p><?=sprintf(
_('This application is powered by %s and is licensed under the %s'),
'<a href="http://www.questlab.zone">Questlab</a>',
'<a rel="license" href="http://www.gnu.org/licenses/gpl.html">GPL</a>'
)?>.</p>

View file

@ -0,0 +1,43 @@
<?=$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)?>"><?=_('Library')?></a></li>
</ul>
<h1><i class="fa fa-book fa-fw"></i><?=_('New Questtopic')?></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 '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">
<fieldset>
<label for="title"><?=_('Title')?>:</label>
<input id="title" type="text" name="title" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> />
</fieldset>
<input type="submit" name="create" value="<?=_('create')?>" />
</form>

View 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)?>"><?=_('Library')?></a></li>
</ul>
<h1><i class="fa fa-book fa-fw"></i><?=_('Delete Questtopic')?></h1>
<?=sprintf(_('Should the Questtopic “%s” really be deleted?'), $questtopic['title'])?>
<form method="post">
<input type="submit" name="delete" value="<?=_('delete')?>" />
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
</form>

121
views/html/library/edit.tpl Normal file
View file

@ -0,0 +1,121 @@
<?=$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)?>"><?=_('Library')?></a></li>
</ul>
<h1><i class="fa fa-book fa-fw"></i><?=_('Edit Questtopic')?></h1>
<?php if($validations['edit'] !== true) : ?>
<ul class="validation">
<?php foreach($validations['edit'] as $field => &$settings) : ?>
<li>
<ul>
<?php foreach($settings as $setting => $value) : ?>
<li>
<?php switch($field) {
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">
<fieldset>
<label for="title"><?=_('Title')?>:</label>
<input id="title" type="text" name="title" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$questtopicTitle?>" <?=($validations['edit'] !== true && array_key_exists('title', $validations['edit'])) ? 'class="invalid"' : null?> />
</fieldset>
<input type="submit" name="edit" value="<?=_('save')?>" />
</form>
<h2><?=_('Edit Questsubtopics')?></h2>
<form method="post">
<?php foreach($subtopicsTitles as $subtopicId => &$title) : ?>
<?php if($validations['edit-subtopics'] !== true && array_key_exists($subtopicId, $validations['edit-subtopics']) && $validations['edit-subtopics'][$subtopicId] !== true) : ?>
<ul class="validation">
<?php foreach($validations['edit-subtopics'][$subtopicId] as $field => &$settings) : ?>
<li>
<ul>
<?php foreach($settings as $setting => $value) : ?>
<li>
<?php switch($field) {
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 ?>
<input id="subtopic-<?=$subtopicId?>" type="text" name="subtopics[<?=$subtopicId?>]" placeholder="<?=$title?>" title="<?=$title?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=($validations['edit-subtopics'] !== true && array_key_exists($subtopicId, $validations['edit-subtopics']) && $validations['edit-subtopics'][$subtopicId] !== true && array_key_exists('title', $validations['edit-subtopics'][$subtopicId])) ? 'class="invalid"' : null?>/>
<input id="subtopic-<?=$subtopicId?>-delete" type="checkbox" name="delete-subtopics[<?=$subtopicId?>]" <?php if(!is_null($deleteSubtopics) && array_key_exists($subtopicId, $deleteSubtopics)) : ?>checked="checked"<?php endif ?> />
<label for="subtopic-<?=$subtopicId?>-delete"><?=_('delete')?></label><br />
<?php endforeach ?>
<input type="submit" name="edit-subtopics" value="<?=_('save')?>" />
</form>
<h2><?=_('Create new Questsubtopic')?></h2>
<?php if($validations['create-subtopic'] !== true) : ?>
<ul class="validation">
<?php foreach($validations['create-subtopic'] as $field => &$settings) : ?>
<li>
<ul>
<?php foreach($settings as $setting => $value) : ?>
<li>
<?php switch($field) {
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">
<fieldset>
<label for="subtopictitle"><?=_('Title')?>:</legend>
<input id="subtopictitle" type="text" name="title" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$subtopicTitle?>" <?=($validations['create-subtopic'] !== true && array_key_exists('title', $validations['create-subtopic'])) ? 'class="invalid"' : null?> />
</fieldset>
<input type="submit" name="create-subtopic" value="<?=_('create')?>" />
</form>

View file

@ -0,0 +1,29 @@
<?=$moodpic?>
<ul class="breadcrumbs">
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
</ul>
<h1><i class="fa fa-book fa-fw"></i><?=_('Library')?></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('create',$seminary['url']),1)?>"><?=_('Create new Questtopic')?></a></li>
</nav>
<?php endif ?>
<p><?=sprintf(_('Library description, %s, %s'), $seminary['course'], $seminary['title'])?></p>
<div class="libindxpr cf">
<p><small><?=sprintf(_('Total progress: %d%%'), ($totalQuestcount > 0) ? round($totalCharacterQuestcount/$totalQuestcount*100) : 0) ?></small></p>
<div class="xpbar">
<span style="width:<?=($totalQuestcount > 0) ? round($totalCharacterQuestcount/$totalQuestcount*100) : 0 ?>%"></span>
</div>
</div>
<ul class="libindx cf">
<?php foreach($questtopics as &$topic) : ?>
<li class="cf">
<i class="fa fa-file-o"></i>
<p class="ltopc"><a href="<?=$linker->link(array('library','topic',$seminary['url'],$topic['url']))?>"><?=$topic['title']?></a></p>
<p><small>Fortschritt: <?=$topic['characterQuestcount']?> / <?=$topic['questcount']?></small></p>
<div class="xpbar">
<span style="width:<?=($topic['questcount'] > 0) ? round($topic['characterQuestcount']/$topic['questcount']*100) : 0?>%"></span>
</div>
</li>
<?php endforeach ?>
</ul>

View file

@ -0,0 +1,36 @@
<?=$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)?>"><?=_('Library')?></a></li>
</ul>
<h1><i class="fa fa-book fa-fw"></i><?=$questtopic['title']?></h1>
<h2>Quests zu diesem Thema:</h2>
<form method="post">
<ul class="libtop">
<?php foreach($quests as &$quest) : ?>
<li>
<p><a href="<?=$linker->link(array('quests','quest',$seminary['url'],$quest['questgroup_url'],$quest['url']))?>"><?=$quest['title']?></a></p>
<?php foreach($questsubtopics as &$subtopic) : ?>
<input id="subtopic-<?=$quest['id']?>-<?=$subtopic['id']?>" type="checkbox" name="questsubtopics[<?=$quest['id']?>][<?=$subtopic['id']?>]" <?php if(in_array($subtopic['id'], $quest['subtopics'])) : ?>checked="checked"<?php endif ?> />
<label for="subtopic-<?=$quest['id']?>-<?=$subtopic['id']?>"><?=$subtopic['title']?></label><br />
<?php endforeach ?>
</li>
<?php endforeach ?>
<li>
<p>
<select name="addquest">
<option value=""><?=_('Add Quest')?></option>
<?php foreach($allQuests as &$quest) : ?>
<option value="<?=$quest['id']?>"><?=$quest['title']?></opiton>
<?php endforeach ?>
</select>
</p>
<?php foreach($questsubtopics as &$subtopic) : ?>
<input id="subtopic-new-<?=$subtopic['id']?>" type="checkbox" name="questsubtopics[addquest][<?=$subtopic['id']?>]" />
<label for="subtopic-new-<?=$subtopic['id']?>"><?=$subtopic['title']?></label><br />
<?php endforeach ?>
</li>
</ul>
<input type="submit" value="<?=_('Manage')?>" />
</form>

View 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)?>"><?=_('Library')?></a></li>
</ul>
<h1><i class="fa fa-book fa-fw"></i><?=$questtopic['title']?></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'],$questtopic['url']),1)?>"><?=_('Edit Questtopic')?></a></li>
<li><a href="<?=$linker->link(array('delete',$seminary['url'],$questtopic['url']),1)?>"><?=_('Delete Questtopic')?></a></li>
<li><a href="<?=$linker->link(array('manage',$seminary['url'],$questtopic['url']),1)?>"><?=_('Manage Questtopic')?></a></li>
</nav>
<?php endif ?>
<div class="libindxpr cf">
<p><small>Themenfortschritt: <?=$questtopic['characterQuestcount']?> / <?=$questtopic['questcount']?></small></p>
<div class="xpbar">
<span style="width:<?=($questtopic['questcount'] > 0) ? round($questtopic['characterQuestcount']/$questtopic['questcount']*100) : 0?>%"></span>
</div>
</div>
<h2>Quests zu diesem Thema:</h2>
<ul class="libtop">
<?php foreach($quests as &$quest) : ?>
<li>
<p><a href="<?=$linker->link(array('quests','quest',$seminary['url'],$quest['questgroup_url'],$quest['url']))?>"><?=$quest['title']?></a></p>
<ul class="addon">
<?php foreach($quest['subtopics'] as &$subtopic) : ?>
<li><?=$subtopic['title']?></li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>

47
views/html/map/edit.tpl Normal file
View file

@ -0,0 +1,47 @@
<?=$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)?>"><?=_('Map')?></a></li>
</ul>
<h1><i class="fa fa-map-marker fa-fw"></i><?=_('Edit 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>

46
views/html/map/index.tpl Normal file
View file

@ -0,0 +1,46 @@
<?=$moodpic?>
<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>
</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']?>];
var projection = new ol.proj.Projection({
code: 'pixel',
units: 'pixels',
extent: extent
});
var map;
$(document).ready(function() {
map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Image({
source: new ol.source.ImageStatic({
url: '<?=$linker->link(array('media','seminarymap',$seminary['url']))?>',
projection: projection,
imageExtent: extent
})
})
],
controls: ol.control.defaults().extend([
new ol.control.OverviewMap({
collapsed: true,
})
]),
view: new ol.View({
projection: projection,
center: ol.extent.getCenter(extent),
zoom: 1,
extent: extent
}),
});
});
</script>

21
views/html/menu/index.tpl Normal file
View file

@ -0,0 +1,21 @@
<li><a href="<?=$linker->link(array(), 0, true, array(), true)?>"><?=\nre\configs\AppConfig::$app['name']?></a></li>
<?php if(!is_null($loggedUser) && count(array_intersect(array('admin','moderator'),$loggedUser['roles'])) > 0) : ?>
<li><a href="<?=$linker->link('users')?>"><?=_('Users')?></a></li>
<?php endif ?>
<?php if(!is_null($loggedUser)) : ?>
<li><a href="<?=$linker->link('seminaries')?>"><?=_('Seminaries')?></a></li>
<?php endif ?>
<?php if(!is_null($loggedCharacter) && count($loggedCharacter['characterroles']) > 0) : ?>
<?=$seminarymenu?>
<?php endif ?>
<?php if(!is_null($loggedUser) && in_array('admin',$loggedUser['roles'])) : ?>
<li><a href="<?=$linker->link('pages')?>"><?=_('Pages')?></a></li>
<?php endif ?>
<?php foreach($pages as &$page) : ?>
<li><a href="<?=$linker->link(array('pages','page',$page['url']))?>"><?=$page['title']?></a></li>
<?php endforeach ?>
<?php if(is_null($loggedUser)) : ?>
<li><a href="<?=$linker->link(array('users','login'))?>"><?=_('Login')?></a></li>
<?php else : ?>
<li><a href="<?=$linker->link(array('users','logout'))?>"><?=_('Logout')?></a></li>
<?php endif ?>

View file

@ -0,0 +1,5 @@
<div class="moodpic">
<div>
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
</div>
</div>

View file

@ -0,0 +1,16 @@
<div class="moodpic">
<div>
<?php if(!is_null($medium)) : ?>
<img src="<?=$medium['url']?>" <?php if(!empty($medium['title'])) : ?>title="<?=$medium['title']?>"<?php endif ?> <?php if(!empty($medium['description'])) : ?>alt="<?=$medium['description']?>"<?php endif ?>/>
<?php if(!empty($medium['sourceurl'])) : ?>
<span class="source">
<a href="<?=$medium['sourceurl']?>" target="_blank" title="<?=_('Image source')?>" rel="nofollow">
<i class="fa fa-external-link"></i>
</a>
</span>
<?php endif ?>
<?php else : ?>
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
<?php endif ?>
</div>
</div>

View file

@ -0,0 +1,16 @@
<div class="moodpic">
<div>
<?php if(!is_null($medium)) : ?>
<img src="<?=$medium['url']?>" <?php if(!empty($medium['title'])) : ?>title="<?=$medium['title']?>"<?php endif ?> <?php if(!empty($medium['description'])) : ?>alt="<?=$medium['description']?>"<?php endif ?>/>
<?php if(!empty($medium['sourceurl'])) : ?>
<span class="source">
<a href="<?=$medium['sourceurl']?>" target="_blank" title="<?=_('Image source')?>" rel="nofollow">
<i class="fa fa-external-link"></i>
</a>
</span>
<?php endif ?>
<?php else : ?>
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
<?php endif ?>
</div>
</div>

View file

@ -0,0 +1,47 @@
<div class="moodpic">
<img src="<?=$linker->hardlink('/grafics/questlab.jpg')?>" />
</div>
<ul class="breadcrumbs">
<li><a href="<?=$linker->link('index',1)?>"><?=_('Pages')?></a></li>
</ul>
<h1><?=_('Create page')?></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 '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;
default:
echo $exception->getMessage();
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<form method="post" class="logreg">
<fieldset>
<label for="title"><?=_('Title')?>:</label>
<input id="title" name="title" type="text" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> /><br />
</fieldset>
<input type="submit" name="create" value="<?=_('create')?>" />
</form>

View file

@ -0,0 +1,13 @@
<div class="moodpic">
<img src="<?=$linker->hardlink('/grafics/questlab.jpg')?>" />
</div>
<ul class="breadcrumbs">
<li><a href="<?=$linker->link(null,3)?>"><?=$page['title']?></a></li>
</ul>
<h1><?=_('Delete page')?></h1>
<?=sprintf(_('Should the page “%s” really be deleted?'), $page['title'])?>
<form method="post">
<input type="submit" name="delete" value="<?=_('delete')?>" />
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
</form>

56
views/html/pages/edit.tpl Normal file
View file

@ -0,0 +1,56 @@
<div class="moodpic">
<img src="<?=$linker->hardlink('/grafics/questlab.jpg')?>" />
</div>
<ul class="breadcrumbs">
<li><a href="<?=$linker->link(null,3)?>"><?=$page['title']?></a></li>
</ul>
<h1><?=_('Edit page')?></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 '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;
default:
echo $exception->getMessage();
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<form method="post">
<fieldset>
<label for="title"><?=_('Title')?>:</label>
<input id="title" name="title" type="text" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> /><br />
</fieldset>
<fieldset>
<legend><?=_('Text')?></legend>
<textarea id="text" name="text"><?=$text?></textarea>
</fieldset>
<input type="submit" name="save" value="<?=_('save')?>" />
</form>
<script>
$(function() {
$("#text").markItUp(mySettings);
});
</script>

View file

@ -0,0 +1,20 @@
<div class="moodpic">
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
</div>
<h1><?=_('Pages')?></h1>
<ul>
<?php foreach($pages as &$page) : ?>
<li>
<a href="<?=$linker->link(array('page',$page['url']),1)?>">
<?=$page['title']?>
</a>
</li>
<?php endforeach ?>
<li>
<form method="post" action="<?=$linker->link('create',1)?>">
<input type="text" name="title" placeholder="<?=_('New page')?>" />
<input type="submit" name="create" value="<?=_('create')?>" />
</form>
</li>
</ul>

12
views/html/pages/page.tpl Normal file
View file

@ -0,0 +1,12 @@
<div class="moodpic">
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
</div>
<?php if(in_array('admin', \hhu\z\controllers\IntermediateController::$user['roles'])) : ?>
<nav class="admin">
<li><a href="<?=$linker->link(array('edit',$page['url']),1)?>"><?=_('Edit page')?></a></li>
<li><a href="<?=$linker->link(array('delete',$page['url']),1)?>"><?=_('Delete page')?></a></li>
</nav>
<?php endif ?>
<h1><?=$page['title']?></h1>
<?=$t->t($page['text'])?>

0
views/html/qr/cgqs.tpl Normal file
View file

View file

@ -0,0 +1,73 @@
<?=$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><?=_('Questgroups')?></li>
</ul>
<h1><?=_('Create Questgroup')?></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 'moodpic':
switch($setting) {
case 'error': printf(_('Error during moodpic upload: %s'), $value);
break;
case 'mimetype': printf(_('Moodpic has wrong type “%s”'), $value);
break;
case 'size': echo _('Moodpic exceeds size maximum');
break;
default: echo _('Moodpic 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><?=_('Context')?></legend>
<?=_('Questgroupshierarchy')?>: <?=$questgroupshierarchy['title_singular']?><br />
<input type="hidden" name="questgroupshierarchy" value="<?=$questgroupshierarchy['url']?>" />
<?php if(!is_null($questgroup)) : ?>
<?=_('Questgroup')?>: <?=$questgroup['title']?>
<input type="hidden" name="questgroup" value="<?=$questgroup['url']?>" />
<?php endif ?>
</fieldset>
<fieldset>
<legend><?=_('Moodpic')?></legend>
<input type="file" name="moodpic" 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>
<fieldset>
<label for="title"><?=_('Title')?>:</label>
<input type="text" name="title" placeholder="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> /><br />
</fieldset>
<input type="submit" name="create" value="<?=_('create')?>" />
</form>

View file

@ -0,0 +1,15 @@
<?=$moodpic?>
<?=$questgroupshierarchypath?>
<?php if(!is_null($questgroup['hierarchy'])) : ?>
<h1><?=$questgroup['hierarchy']['title_singular']?> <?=$questgroup['hierarchy']['questgroup_pos']?>: <?=$questgroup['title']?></h1>
<?php else : ?>
<h1><?=$questgroup['title']?></h1>
<?php endif ?>
<h1><?=_('Delete Questgroup')?></h1>
<?=sprintf(_('Should the Questgroup “%s” really be deleted?'), $questgroup['title'])?>
<form method="post">
<input type="submit" name="delete" value="<?=_('delete')?>" />
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
</form>

View file

@ -0,0 +1,61 @@
<?=$moodpic?>
<?=$questgroupshierarchypath?>
<h1><?=_('Edit Questgroup')?></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 'moodpic':
switch($setting) {
case 'error': printf(_('Error during moodpic upload: %s'), $value);
break;
case 'mimetype': printf(_('Moodpic has wrong type “%s”'), $value);
break;
case 'size': echo _('Moodpic exceeds size maximum');
break;
default: echo _('Moodpic 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><?=_('Moodpic')?></legend>
<input type="file" name="moodpic" 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>
<fieldset>
<label for="title"><?=_('Title')?>:</label>
<input type="text" name="title" placeholder="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> /><br />
</fieldset>
<input type="submit" name="edit" value="<?=_('edit')?>" />
</form>

View file

@ -0,0 +1,31 @@
<?=$moodpic?>
<?=$questgroupshierarchypath?>
<h1><?=_('Edit Questgroup texts')?></h1>
<form method="post">
<fieldset>
<ul class="admnql">
<?php foreach($questgrouptexts as &$text) : ?>
<li class="cf">
<textarea id="questgrouptexts-<?=$text['id']?>" name="questgrouptexts[<?=$text['id']?>]"><?=$text['text']?></textarea><br />
<input id="deletes[<?=$text['id']?>]" type="checkbox" name="deletes[<?=$text['id']?>]" />
<label for="deletes[<?=$text['id']?>]"><?=_('delete')?></label>
<script>
$(function() {
$("#questgrouptexts-<?=$text['id']?>").markItUp(mySettings);
});
</script>
</li>
<?php endforeach ?>
<li class="cf">
<textarea id="questgrouptexts-new" name="questgrouptexts[]" placeholder="<?=_('New Questgroup text')?>"></textarea>
</li>
</ul>
</fieldset>
<input type="submit" name="edit" value="<?=_('edit')?>" />
</form>
<script>
$(function() {
$("#questgrouptexts-new").markItUp(mySettings);
});
</script>

View file

@ -0,0 +1,15 @@
<?=$moodpic?>
<?=$questgroupshierarchypath?>
<?php if(!is_null($questgroup['hierarchy'])) : ?>
<h1><?=$questgroup['hierarchy']['title_singular']?> <?=$questgroup['hierarchy']['questgroup_pos']?>: <?=$questgroup['title']?></h1>
<?php else : ?>
<h1><?=$questgroup['title']?></h1>
<?php endif ?>
<h1><?=_('Move Questgroup')?></h1>
<?=sprintf(_('Should the Questgroup “%s” really be moved?'), $questgroup['title'])?>
<form method="post">
<input type="submit" name="move" value="<?=_('move')?>" />
<input type="submit" name="not-move" value="<?=_('cancel')?>" />
</form>

View file

@ -0,0 +1,15 @@
<?=$moodpic?>
<?=$questgroupshierarchypath?>
<?php if(!is_null($questgroup['hierarchy'])) : ?>
<h1><?=$questgroup['hierarchy']['title_singular']?> <?=$questgroup['hierarchy']['questgroup_pos']?>: <?=$questgroup['title']?></h1>
<?php else : ?>
<h1><?=$questgroup['title']?></h1>
<?php endif ?>
<h1><?=_('Move Questgroup')?></h1>
<?=sprintf(_('Should the Questgroup “%s” really be moved?'), $questgroup['title'])?>
<form method="post">
<input type="submit" name="move" value="<?=_('move')?>" />
<input type="submit" name="not-move" value="<?=_('cancel')?>" />
</form>

View file

@ -0,0 +1,119 @@
<?=$moodpic?>
<?=$questgroupshierarchypath?>
<?php if(!is_null($questgroup['hierarchy'])) : ?>
<h1><?=$questgroup['hierarchy']['title_singular']?> <?=$questgroup['hierarchy']['questgroup_pos']?>: <?=$questgroup['title']?></h1>
<?php else : ?>
<h1><?=$questgroup['title']?></h1>
<?php endif ?>
<?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'],$questgroup['url']),1)?>"><?=_('Edit Questgroup')?></a></li>
<li><a href="<?=$linker->link(array('edittexts',$seminary['url'],$questgroup['url']),1)?>"><?=_('Edit Questgroup texts')?></a></li>
<?php if(in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?>
<li><a href="<?=$linker->link(array('delete',$seminary['url'],$questgroup['url']),1)?>"><?=_('Delete Questgroup')?></a></li>
<?php endif ?>
</nav>
<nav class="admin">
<li><a href="<?=$linker->link(array('quests','create',$seminary['url'],$questgroup['url']))?>"><?=_('Create new Quest')?></a></li>
</nav>
<?php endif ?>
<?php if(count($texts) > 0): ?>
<div class="qtextbox">
<?php foreach($texts as &$text) : ?>
<p class="qtext"><?=$t->t($text['text'])?></p>
<?php endforeach ?>
</div>
<?php endif ?>
<?php if(!is_null($childquestgroupshierarchy)) : ?>
<?php foreach($childquestgroupshierarchy as $hierarchyIndex => &$hierarchy) : ?>
<?php if(count($hierarchy['questgroups']) > 0 || count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
<h3><?=$hierarchy['title_plural']?></h3>
<?php if(in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?>
<nav class="admin">
<li><a href="<?=$linker->link(array('questgroupshierarchy','edit',$seminary['url'],$hierarchy['url']))?>"><?=_('Edit Questgroupshierarchy')?></a></li>
<li><a href="<?=$linker->link(array('questgroupshierarchy','delete',$seminary['url'],$hierarchy['url']))?>"><?=_('Delete Questgroupshierarchy')?></a></li>
<?php if($hierarchyIndex > 0) : ?><li><a href="<?=$linker->link(array('questgroupshierarchy','moveup',$seminary['url'],$hierarchy['url']),0,true,array('referer'=>$questgroup['id']))?>">↑</a></li><?php endif ?>
<?php if($hierarchyIndex < count($childquestgroupshierarchy)-1) : ?><li><a href="<?=$linker->link(array('questgroupshierarchy','movedown',$seminary['url'],$hierarchy['url']),0,true,array('referer'=>$questgroup['id']))?>">↓</a></li><?php endif ?>
</nav>
<?php endif ?>
<ul class="qg">
<?php foreach($hierarchy['questgroups'] as $questgroupIndex => &$group) : ?>
<li class="cf">
<span class="qgicon">
<?php if($group['solved']) : ?>
<i class="fa fa-check-square-o"></i>
<?php else : ?>
<i class="fa fa-square-o"></i>
<?php endif ?>
</span>
<div class="qgorder">
<?php if($questgroupIndex > 0) : ?><a href="<?=$linker->link(array('questgroups','moveup',$seminary['url'],$group['url']),0,true,array('referer'=>$questgroup['id']))?>">↑</a><?php endif ?>
<?php if($questgroupIndex < count($hierarchy['questgroups'])-1) : ?><a href="<?=$linker->link(array('questgroups','movedown',$seminary['url'],$group['url']),0,true,array('referer'=>$questgroup['id']))?>">↓</a><?php endif ?>
</div>
<div class="qgtitle"><a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$group['url']))?>"><?=$group['title']?></a></div>
<div class="qgprogress cf">
<p class="xpinfo">Fortschritt:</p>
<div class="xpbar">
<span style="width:<?=($group['achievable_xps'] > 0) ? round($group['character_xps']/$group['achievable_xps']*100) : 0?>%"></span>
</div>
<p class="xpnumeric"><?=$group['character_xps']?> / <?=$group['achievable_xps']?> <?=_('XPs')?></p>
</div>
<?php foreach($group['relatedQuestgroups'] as &$relatedGroup) : ?>
<div class="qghidden">
<p><?=_('Found optional Questline')?>:</p>
<p><a href="<?=$linker->link(array($seminary['url'],$relatedGroup['url']),2)?>"><i class="fa fa-star-o fa-fw"></i><?=$relatedGroup['title']?></a></p>
</div>
<?php endforeach ?>
<?php if(in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?>
<?php endif ?>
</li>
<?php endforeach?>
<?php if(in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?>
<li class="cf">
<span class="qgicon">
<i class="fa fa-square-o"></i>
</span>
<form method="post" action="<?=$linker->link(array('questgroups','create',$seminary['url']))?>" enctype="multipart/form-data">
<input type="hidden" name="questgroupshierarchy" value="<?=$hierarchy['url']?>" />
<input type="hidden" name="questgroup" value="<?=$questgroup['url']?>" />
<input type="file" name="moodpic" /><br />
<?=$hierarchy['title_singular']?> <?=count($hierarchy['questgroups'])+1?>:
<input type="text" name="title" value="" placeholder="<?=_('Title')?>" /><br />
<input type="submit" name="create" value="<?=_('Add new Questgroup')?>" />
</form>
</li>
<?php endif ?>
</ul>
<?php endif ?>
<?php endforeach ?>
<?php if(in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?>
<form method="post" action="<?=$linker->link(array('questgroupshierarchy','create',$seminary['url']))?>">
<h2><?=_('New Questgroupshierarchy')?></h2>
<?=_('Title (singular)')?>: <input type="text" name="title_singular" placeholder="<?=_('Title (singular)')?>" />
<?=_('Title (plural)')?>: <input type="text" name="title_plural" placeholder="<?=_('Title (plural)')?>" />
<input type="hidden" name="parent" value="<?=$questgroup['hierarchy']['url']?>" />
<input type="submit" name="create" value="<?=_('Add new Questgroupshierarchy')?>" />
</form>
<?php endif ?>
<?php endif ?>
<?php if(isset($quests) && !is_null($quests) && count($quests) > 0) : ?>
<h3><?=_('Quests')?></h3>
<ul class="qglist">
<?php foreach($quests as &$quest) : ?>
<li class="qgtitle">
<a href="<?=$linker->link(array('quests','quest',$seminary['url'],$questgroup['url'],$quest['url']))?>" <?php if($quest['solved']) : ?>class="solved"<?php endif ?>><i class="fa <?=($quest['solved']) ? 'fa-check-square-o' : 'fa-square-o'?> fa-fw"></i><?=$quest['title']?></a>
</li>
<?php if(count($quest['relatedQuestgroups']) > 0) : ?>
<?php foreach($quest['relatedQuestgroups'] as &$relatedQuestgroup) : ?>
<li class="qgtitle">
<a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$relatedQuestgroup['url']))?>" class="bonus"><i class="fa fa-share-square-o fa-fw"></i><?=$relatedQuestgroup['title']?></a>
</li>
<?php endforeach ?>
<?php endif ?>
<?php endforeach ?>
</ul>
<?php endif ?>

View file

@ -0,0 +1,64 @@
<?php if(!is_null($seminary['seminarymedia_id'])) : ?>
<div class="moodpic">
<img src="<?=$linker->link(array('media','seminarymoodpic',$seminary['url']))?>" />
</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><?=_('Questgroupshierarchy')?></li>
</ul>
<h1><?=_('Create Questgroupshierarchy')?></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 'titleSingular':
switch($setting) {
case 'minlength': printf(_('Title (singular) is too short (min. %d chars)'), $value);
break;
case 'maxlength': printf(_('Title (singular) is too long (max. %d chars)'), $value);
break;
case 'exist': echo _('Title (singular) already exists');
break;
default: echo _('Title (singular) invalid');
}
break;
case 'titlePlural':
switch($setting) {
case 'minlength': printf(_('Title (plural) is too short (min. %d chars)'), $value);
break;
case 'maxlength': printf(_('Title (plural) is too long (max. %d chars)'), $value);
break;
case 'exist': echo _('Title (plural) already exists');
break;
default: echo _('Title (plural) invalid');
}
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<form method="post" class="logreg">
<fieldset>
<label for="title_singular"><?=_('Title (singular)')?>:</label>
<input type="text" name="title_singular" placeholder="<?=_('Title (singular)')?>" value="<?=$titleSingular?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" <?=(array_key_exists('titleSingular', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="title_plural"><?=_('Title (plural)')?>:</label>
<input type="text" name="title_plural" placeholder="<?=_('Title (plural)')?>" value="<?=$titlePlural?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" <?=(array_key_exists('titlePlural', $validation)) ? 'class="invalid"' : null?> /><br />
<select name="parent">
<option value="null"><?=$seminary['title']?></option>
<?php foreach($parentQuestgroupshierarchy as &$hierarchy) : ?>
<option value="<?=$hierarchy['url']?>" <?php if(array_key_exists('selected', $hierarchy) && $hierarchy['selected']) : ?>selected="selected"<?php endif ?>><?=$hierarchy['title_singular']?></option>
<?php endforeach ?>
</select>
</fieldset>
<input type="submit" name="create" value="<?=_('create')?>" />
</form>

View file

@ -0,0 +1,16 @@
<?php if(!is_null($seminary['seminarymedia_id'])) : ?>
<div class="moodpic">
<img src="<?=$linker->link(array('media','seminarymoodpic',$seminary['url']))?>">
</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><?=_('Questgroupshierarchy')?></li>
</ul>
<h1><?=_('Delete Questgroupshierarchy')?></h1>
<?=sprintf(_('Should the Questgroupshierarchy “%s” really be deleted?'), $questgroupshierarchy['title_singular'])?>
<form method="post">
<input type="submit" name="delete" value="<?=_('delete')?>" />
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
</form>

View file

@ -0,0 +1,58 @@
<?php if(!is_null($seminary['seminarymedia_id'])) : ?>
<div class="moodpic">
<img src="<?=$linker->link(array('media','seminarymoodpic',$seminary['url']))?>">
</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><?=_('Questgroupshierarchy')?></li>
</ul>
<h1><?=_('Edit Questgroupshierarchy')?></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 'titleSingular':
switch($setting) {
case 'minlength': printf(_('Title (singular) is too short (min. %d chars)'), $value);
break;
case 'maxlength': printf(_('Title (singular) is too long (max. %d chars)'), $value);
break;
case 'exist': echo _('Title (singular) already exists');
break;
default: echo _('Title (singular) invalid');
}
break;
case 'titlePlural':
switch($setting) {
case 'minlength': printf(_('Title (plural) is too short (min. %d chars)'), $value);
break;
case 'maxlength': printf(_('Title (plural) is too long (max. %d chars)'), $value);
break;
case 'exist': echo _('Title (plural) already exists');
break;
default: echo _('Title (plural) invalid');
}
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<form method="post" class="logreg">
<fieldset>
<label for="title_singular"><?=_('Title (singular)')?>:</label>
<input type="text" name="title_singular" placeholder="<?=_('Title (singular)')?>" value="<?=$titleSingular?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" <?=(array_key_exists('titleSingular', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="title_plural"><?=_('Title (plural)')?>:</label>
<input type="text" name="title_plural" placeholder="<?=_('Title (plural)')?>" value="<?=$titlePlural?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" <?=(array_key_exists('titlePlural', $validation)) ? 'class="invalid"' : null?> /><br />
</fieldset>
<input type="submit" name="edit" value="<?=_('edit')?>" />
</form>

View file

@ -0,0 +1,16 @@
<ul class="breadcrumbs">
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
<?php foreach($parentquestgroupshierarchy as &$hierarchy) : ?>
<li>
<i class="fa fa-chevron-right fa-fw"></i>
<?php if(array_key_exists('hierarchy', $hierarchy)) : ?>
<?php if(!is_null($hierarchy['hierarchy'])) : ?>
<?=$hierarchy['hierarchy']['title_singular']?><?php if(array_key_exists('questgroup_pos', $hierarchy['hierarchy'])) : ?> <?=$hierarchy['hierarchy']['questgroup_pos']?><?php endif ?>:
<?php endif ?>
<a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$hierarchy['url']))?>"><?=$hierarchy['title']?></a>
<?php else : ?>
<a href="<?=$linker->link(array('quests','quest',$seminary['url'],$hierarchy['questgroup']['url'],$hierarchy['url']))?>"><?=$hierarchy['title']?></a>
<?php endif ?>
</li>
<?php endforeach ?>
</ul>

View file

@ -0,0 +1,105 @@
<?=$moodpic?>
<?=$questgroupshierarchypath?>
<h1><?=_('Create Quest')?></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 picture upload: %s'), $value);
break;
case 'mimetype': printf(_('Picture has wrong type “%s”'), $value);
break;
case 'size': echo _('Picture exceeds size maximum');
break;
default: echo _('Picture 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;
case 'xps':
switch($setting) {
case 'minlength': printf(_('XPs not set'), $value);
break;
case 'regex': echo _('XPs contain illegal characters');
break;
default: echo _('XPs invalid');
}
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<form method="post" enctype="multipart/form-data">
<fieldset>
<legend><?=_('Picture')?></legend>
<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>
<fieldset>
<label for="title"><?=_('Title')?>:</label>
<input id="title" type="text" name="title" value="<?=$title?>" placeholder="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="xps"><?=_('XPs')?>:</label>
<input id="xps" type="number" name="xps" placeholder="<?=_('XPs')?>" title="<?=_('XPs')?>" pattern="<?=substr($validationSettings['xps']['regex'],1,strrpos($validationSettings['xps']['regex'],$validationSettings['xps']['regex'][0])-1)?>" value="<?=$xps?>" <?=(array_key_exists('xps', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="questtype"><?=('Questtype')?>:</label>
<select id="questtype" name="questtype">
<?php foreach($questtypes as &$questtype) : ?>
<option value="<?=$questtype['url']?>" <?php if($questtype['selected']) : ?>selected="selected"<?php endif ?>>
<?php switch($questtype['classname']) {
case null: echo _('Questtype Empty');
break;
case 'bossfight': echo _('Questtype bossfight');
break;
case 'choiceinput': echo _('Questtype choiceinput');
break;
case 'crossword': echo _('Questtype crossword');
break;
case 'dragndrop': echo _('Questtype dragndrop');
break;
case 'multiplechoice': echo _('Questtype multiplechoice');
break;
case 'submit': echo _('Questtype submit');
break;
case 'textinput': echo _('Questtype textinput');
break;
} ?>
</option>
<?php endforeach ?>
</select>
</fieldset>
<fieldset>
<label for="entrytext"><?=('Entry text')?>:</label><br />
<textarea name="entrytext" placeholder="<?=_('Entry text')?>" style="width:100%; height:10em;"><?=$entryText?></textarea><br />
<label for="task"><?=_('Task')?>:</label><br />
<textarea name="task" placeholder="<?=('Task')?>" style="width:100%; height:10em;"><?=$task?></textarea><br />
<label for="wrongtext"><?=('Wrong text')?>:</label><br />
<textarea name="wrongtext" placeholder="<?=_('Wrong text')?>" style="width:100%; height:10em;"><?=$wrongText?></textarea><br />
</fieldset>
<input type="submit" name="create" value="<?=_('create')?>" />
</form>

View file

@ -0,0 +1,9 @@
<?=$moodpic?>
<?=$questgroupshierarchypath?>
<h1><?=_('Delete Quest')?></h1>
<?=sprintf(_('Should the Quest “%s” really be deleted?'), $quest['title'])?>
<form method="post">
<input type="submit" name="delete" value="<?=_('delete')?>" />
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
</form>

118
views/html/quests/edit.tpl Normal file
View file

@ -0,0 +1,118 @@
<?=$moodpic?>
<?=$questgroupshierarchypath?>
<h1><?=_('Edit Quest')?></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 picture upload: %s'), $value);
break;
case 'mimetype': printf(_('Picture has wrong type “%s”'), $value);
break;
case 'size': echo _('Picture exceeds size maximum');
break;
default: echo _('Picture 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;
case 'xps':
switch($setting) {
case 'minlength': printf(_('XPs not set'), $value);
break;
case 'regex': echo _('XPs contain illegal characters');
break;
default: echo _('XPs invalid');
}
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<form method="post" enctype="multipart/form-data">
<fieldset>
<?php if(!is_null($media)) : ?>
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$media['url']))?>"><img style="width:10em; display:block;" src="<?=$linker->link(array('media','seminary',$seminary['url'],$media['url']))?>" /></a>
<?php endif ?>
<legend><?=_('Picture')?></legend>
<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>
<fieldset>
<label for="title"><?=_('Title')?>:</label>
<input id="title" type="text" name="title" value="<?=$title?>" placeholder="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" <?=(array_key_exists('title', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="xps"><?=_('XPs')?>:</label>
<input id="xps" type="number" name="xps" placeholder="<?=_('XPs')?>" title="<?=_('XPs')?>" pattern="<?=substr($validationSettings['xps']['regex'],1,strrpos($validationSettings['xps']['regex'],$validationSettings['xps']['regex'][0])-1)?>" value="<?=$xps?>" <?=(array_key_exists('xps', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="questtype"><?=('Questtype')?>:</label>
<select id="questtype" name="questtype">
<?php foreach($questtypes as &$questtype) : ?>
<option value="<?=$questtype['url']?>" <?php if($questtype['selected']) : ?>selected="selected"<?php endif ?>>
<?php switch($questtype['classname']) {
case null: echo _('Questtype Empty');
break;
case 'bossfight': echo _('Questtype bossfight');
break;
case 'choiceinput': echo _('Questtype choiceinput');
break;
case 'crossword': echo _('Questtype crossword');
break;
case 'dragndrop': echo _('Questtype dragndrop');
break;
case 'multiplechoice': echo _('Questtype multiplechoice');
break;
case 'submit': echo _('Questtype submit');
break;
case 'textinput': echo _('Questtype textinput');
break;
} ?>
</option>
<?php endforeach ?>
</select>
</fieldset>
<fieldset>
<label for="entrytext"><?=_('Entry text')?>:</label><br />
<textarea id="entrytext" name="entrytext" placeholder="<?=_('Entry text')?>"><?=$entryText?></textarea><br />
<label for="task"><?=_('Task')?>:</label><br />
<textarea id="task" name="task" placeholder="<?=('Task')?>"><?=$task?></textarea><br />
<label for="wrongtext"><?=_('Wrong text')?>:</label><br />
<textarea id="wrongtext" name="wrongtext" placeholder="<?=_('Wrong text')?>"><?=$wrongText?></textarea><br />
</fieldset>
<?php if(!is_null($quest['type']['classname'])) : ?>
<input type="submit" name="edit-task" value="<?=_('edit task')?>" />
<?php endif ?>
<input type="submit" name="edit" value="<?=_('save')?>" />
</form>
<script>
$(function() {
$("#entrytext").markItUp(mySettings);
$("#task").markItUp(mySettings);
$("#wrongtext").markItUp(mySettings);
});
</script>

View file

@ -0,0 +1,7 @@
<?=$moodpic?>
<?=$questgroupshierarchypath?>
<h1><?=_('Edit Quest task')?></h1>
<?php if(!is_null($task)) : ?>
<?=$task?>
<?php endif ?>

View file

@ -0,0 +1,73 @@
<?=$moodpic?>
<?=$questgroupshierarchypath?>
<h1><?=_('Edit Quest texts')?></h1>
<form method="post" enctype="multipart/form-data">
<?php foreach($questtexttypes as &$type) : ?>
<fieldset>
<legend><?=$type['type']?></legend>
<?php if(array_key_exists($type['url'], $validations) && $validations[$type['url']] !== true) : ?>
<ul class="validation">
<?php foreach($validations[$type['url']] as $textId => &$validation) : ?>
<?php if($validation !== true) : ?>
<?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 picture upload: %s'), $value);
break;
case 'mimetype': printf(_('Picture has wrong type “%s”'), $value);
break;
case 'size': echo _('Picture exceeds size maximum');
break;
default: echo _('Picture invalid');
}
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
<?php endif ?>
<?php endforeach ?>
</ul>
<?php endif ?>
<ul class="admnql">
<?php foreach($type['texts'] as &$text) : ?>
<li class="cf">
<?php if(array_key_exists('media', $text)) : ?>
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$text['media']['url']))?>"><img src="<?=$linker->link(array('media','seminary',$seminary['url'],$text['media']['url']))?>" /></a><br />
<?php else : ?>
<i class="placeholder fa fa-picture-o fa-4x"></i><br />
<?php endif ?>
<input type="file" name="media[<?=$type['url']?>][<?=$text['id']?>]" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" />
<textarea id="questtexts-<?=$type['url']?>-<?=$text['id']?>" name="questtexts[<?=$type['url']?>][<?=$text['id']?>]"><?=$text['text']?></textarea><br />
<input id="deletes[<?=$type['url']?>][<?=$text['id']?>]" type="checkbox" name="deletes[<?=$type['url']?>][<?=$text['id']?>]" />
<label for="deletes[<?=$type['url']?>][<?=$text['id']?>]"><?=_('delete text')?></label>
<script>
$(function() {
$("#questtexts-<?=$type['url']?>-<?=$text['id']?>").markItUp(mySettings);
});
</script>
</li>
<?php endforeach ?>
<li class="cf">
<i class="placeholder fa fa-picture-o fa-4x"></i><br />
<input type="file" name="media[<?=$type['url']?>][new]" accept="<?=implode(',', array_map(function($m) { return $m['mimetype']; }, $mimetypes))?>" /><br />
<textarea id="questtexts-<?=$type['url']?>-new" name="questtexts[<?=$type['url']?>][new]" placeholder="<?=_('New Questgroup text')?>"></textarea>
<script>
$(function() {
$("#questtexts-<?=$type['url']?>-new").markItUp(mySettings);
});
</script>
</li>
</ul>
</fieldset>
<?php endforeach ?>
<input type="submit" name="edit" value="<?=_('save')?>" />
</form>

131
views/html/quests/index.tpl Normal file
View file

@ -0,0 +1,131 @@
<?=$moodpic?>
<ul class="breadcrumbs">
<li><a href="<?=$linker->link(array('seminaries',$seminary['url']))?>"><?=$seminary['title']?></a></li>
</ul>
<h1><?=_('Quests')?></h1>
<form method="get" class="logreg admnqf">
<fieldset>
<legend><?=_('Filters')?></legend>
<label for="questgroup"><?=_('Questgroup')?>:</label>
<select id="questgroup" name="questgroup">
<option value=""><?=_('all')?></option>
<?php foreach($questgroups as &$questgroup) : ?>
<option value="<?=$questgroup['id']?>" <?php if($questgroup['id'] == $selectedQuestgroup) : ?>selected="selected"<?php endif ?>><?=$questgroup['title']?></option>
<?php endforeach ?>
</select><br />
<label for="questtype"><?=_('Questtype')?>:</label>
<select id="questtype" name="questtype">
<option value=""><?=_('all')?></option>
<?php foreach($questtypes as &$questtype) : ?>
<option value="<?=$questtype['id']?>" <?php if($questtype['id'] == $selectedQuesttype) : ?>selected="selected"<?php endif ?>>
<?php switch($questtype['classname']) {
case null: echo _('Questtype Empty');
break;
case 'bossfight': echo _('Questtype bossfight');
break;
case 'choiceinput': echo _('Questtype choiceinput');
break;
case 'crossword': echo _('Questtype crossword');
break;
case 'dragndrop': echo _('Questtype dragndrop');
break;
case 'multiplechoice': echo _('Questtype multiplechoice');
break;
case 'submit': echo _('Questtype submit');
break;
case 'textinput': echo _('Questtype textinput');
break;
} ?>
</option>
<?php endforeach ?>
</select>
<label for="title"><?=_('Title')?>:</label>
<input type="text" id="title" name="title" placeholder="<?=_('Title')?>" value="<?=$selectedTitle?>" />
</fieldset>
<input type="submit" value="<?=_('Apply filters')?>" />
</form>
<ul id="questlist" class="admnql">
<?php foreach($quests as &$quest) : ?>
<li>
<p class="fwb"><a href="<?=$linker->link(array('quest',$seminary['url'],$quest['questgroup_url'],$quest['url']),1)?>"><?=$quest['title']?></a><span><a href="<?=$linker->link(array('submissions',$seminary['url'],$quest['questgroup_url'],$quest['url']),1)?>"><?=$quest['opensubmissionscount']?> <?=_('open submissions')?></a></span></p>
<p><small>
<?php switch($quest['questtype']['classname']) {
case null: echo _('Questtype Empty');
break;
case 'bossfight': echo _('Questtype bossfight');
break;
case 'choiceinput': echo _('Questtype choiceinput');
break;
case 'crossword': echo _('Questtype crossword');
break;
case 'dragndrop': echo _('Questtype dragndrop');
break;
case 'multiplechoice': echo _('Questtype multiplechoice');
break;
case 'submit': echo _('Questtype submit');
break;
case 'textinput': echo _('Questtype textinput');
break;
} ?>, <?=sprintf(_('%dXPs'), $quest['xps'])?></small></p>
<p><small><a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$quest['questgroup_url']))?>"><?=$quest['questgroup_title']?></a></small></p>
</li>
<?php endforeach ?>
</ul>
<?php if(is_null($all) && ($page*$limit) < $questsCount) : ?>
<nav class="admin">
<li><a id="show-more" href="<?=$linker->link(null,3,true,array('page'=>$page+1,'questgroup'=>$selectedQuestgroup,'questtype'=>$selectedQuesttype,'title'=>$selectedTitle))?>"><?=_('Show more')?></a></li>
<li><a id="show-all" href="<?=$linker->link('all',3,true,array('questgroup'=>$selectedQuestgroup,'questtype'=>$selectedQuesttype,'title'=>$selectedTitle))?>"><?=_('Show all')?></a></li>
</nav>
<?php endif ?>
<script>
var page = 1;
var request;
var linkSubmissions = "<?=$linker->link(array('submissions','SEMINARY','QUESTGROUP','QUEST'),1)?>";
var linkQuestgroup = "<?=$linker->link(array('questgroups','questgroup','SEMINARY','QUESTGROUP'))?>";
var linkQuest = "<?=$linker->link(array('quest','SEMINARY','QUESTGROUP','QUEST'),1)?>";
var linkPage = "<?=$linker->link(null,3,true,array('page'=>'PAGE','questgroup'=>$selectedQuestgroup,'questtype'=>$selectedQuesttype,'title'=>$selectedTitle))?>";
$("#show-more").click(function(event) {
if(request) {
request.abort();
}
page++;
request = $.getJSON(linkPage.replace('PAGE', page), function(data) {
linkSubmissions = linkSubmissions.replace('SEMINARY', data['seminary']['url']);
linkQuestgroup = linkQuestgroup.replace('SEMINARY', data['seminary']['url']);
linkQuest = linkQuest.replace('SEMINARY', data['seminary']['url']);
$.each(data['quests'], function(key, val) {
var urlSubmissions = linkSubmissions.replace('QUESTGROUP', val['questgroup_url']).replace('QUEST', val['url']);
var urlQuestgroup = linkQuestgroup.replace('QUESTGROUP', val['questgroup_url']);
var urlQuest = linkQuest.replace('QUESTGROUP', val['questgroup_url']).replace('QUEST', val['url']);
$("#questlist").append(
"<li>" +
"<p class=\"fwb\"><a href=\"" + urlQuest + "\">" + val['title'] + "</a><span><a href=\"" + urlSubmissions + "\">" + val['opensubmissionscount'] + " <?=_('open submissions')?></a></span></p>" +
"<p><small>" + val['questtype']['title'] + ", " + val['xps'] + "</small></p>" +
"<p><small><a href=\"" + urlQuestgroup + "\">" + val['questgroup_title'] + "</a></small></p>" +
"</li>"
);
});
if(data['more']) {
$("#show-more").attr('href', linkPage.replace('PAGE', page+1));
}
else {
$("#show-more").remove();
$("#show-all").remove();
}
});
request.fail(function (jqXHR, textStatus, errorThrown) {
window.location.href = linkPage.replace('PAGE', page);
});
event.preventDefault();
return false;
});
</script>

175
views/html/quests/quest.tpl Normal file
View file

@ -0,0 +1,175 @@
<?=$moodpic?>
<?=$questgroupshierarchypath?>
<h1><?=$quest['title']?></h1>
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
<nav class="admin">
<li><a href="<?=$linker->link('edit', 5)?>"><?=_('Edit Quest')?></a></li>
<li><a href="<?=$linker->link('edittexts', 5)?>"><?=_('Edit Quest texts')?></a></li>
<?php if(in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?>
<li><a href="<?=$linker->link('delete', 5)?>"><?=_('Delete Quest')?></a></li>
<?php endif ?>
</nav>
<?php endif ?>
<?php if(array_key_exists('Prolog', $questtexts) && count($questtexts['Prolog']) > 0) : ?>
<section>
<h1 id="questtext"><?=_('Prolog')?></h1>
<div class="qtextbox">
<?php $mediaShown = false; ?>
<?php foreach($questtexts['Prolog'] as &$questtext) : ?>
<p class="qtext cf">
<?php if(array_key_exists('media', $questtext)) : ?>
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$questtext['media']['url']))?>">
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$questtext['media']['url'], 'quest'))?>" />
</a>
<?php if(!empty($questtext['media']['sourceurl'])) : ?>
<span class="source">
<a href="<?=$questtext['media']['sourceurl']?>" target="_blank" title="<?=_('Image source')?>" rel="nofollow">
<i class="fa fa-external-link"></i>
</a>
</span>
<?php endif ?>
<?php elseif(!is_null($media) && !$mediaShown) : ?>
<?php $mediaShown = true; ?>
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$media['url']))?>">
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$media['url'],'quest'))?>" />
</a>
<?php if(!empty($media['sourceurl'])) : ?>
<span class="source">
<a href="<?=$media['sourceurl']?>" target="_blank" title="<?=_('Image source')?>" rel="nofollow">
<i class="fa fa-external-link"></i>
</a>
</span>
<?php endif ?>
<?php endif ?>
<?=str_replace('<p>', '', str_replace('</p>', '', $t->t($questtext['text'])))?>
</p>
<?php if(count($questtext['relatedQuestsgroups']) > 0 || !empty($questtext['abort_text'])) : ?>
<ul>
<?php foreach($questtext['relatedQuestsgroups'] as &$relatedQuestgroup) : ?>
<li><a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$relatedQuestgroup['url']))?>"><?=$relatedQuestgroup['entry_text']?></a></li>
<?php endforeach ?>
<?php if(!empty($questtext['abort_text'])) : ?>
<li><a href="<?=$linker->link(array('quest',$seminary['url'],$relatedquesttext['quest']['questgroup_url'],$relatedquesttext['quest']['url'],$relatedquesttext['type_url']),1)?>"><?=$questtext['abort_text']?></a></li>
<?php endif ?>
</ul>
<?php endif ?>
<?php endforeach ?>
</div>
</section>
<?php endif ?>
<?php if(!is_null($task)) : ?>
<section class="task">
<h1 id="task"><?=_('Task')?></h1>
<?php if(!is_null($queststatus)) : ?>
<?php if($queststatus == 'solved') : ?>
<div class="success">
<p class="fwb"><i class="fa fa-check-circle fa-fw"></i><?=_('solved')?></p>
<p><small><?=_('Quest completed.')?> <?php if($quest['xps'] > 0): ?><?=sprintf(_('You have earned %d XPs.'), $quest['xps'])?><?php endif ?></small></p>
</div>
<?php elseif($queststatus == 'unsolved') : ?>
<div class="error">
<p class="fwb"><i class="fa fa-times-circle fa-fw"></i><?=_('unsolved')?></p>
<p><small><?=$t->t($quest['wrong_text'])?></small></p>
</div>
<?php endif ?>
<?php endif ?>
<?php if($queststatus != 'solved') : ?>
<div class="text">
<?=$t->t($quest['task'])?>
<?=$task?>
</div>
<?php if($solved && empty($queststatus)) : ?>
<div class="solvdmsg">
<p><?=_('Task already successfully solved')?>:
<nav class="admin">
<li><a href="<?=$linker->link(null,0,false,array('show-answer'=>'true'),true,'task')?>"><?=_('Show answer')?></a></li>
</nav>
</div>
<?php endif ?>
<?php endif ?>
</section>
<?php endif ?>
<?php if(array_key_exists('Epilog', $questtexts) && count($questtexts['Epilog']) > 0) : ?>
<section <?php if(count($nextquests) == 0 && is_null($nextquestgroup)) : ?>class="gameover"<?php endif ?>>
<?php if(count($nextquests) == 0 && is_null($nextquestgroup)) : ?>
<h1><?=_('Game over')?></h1>
<?php else : ?>
<h1 id="questtext"><?=_('Epilog')?></h1>
<?php endif ?>
<div class="qtextbox">
<?php foreach($questtexts['Epilog'] as &$questtext) : ?>
<p class="qtext cf">
<?php if(array_key_exists('media', $questtext)) : ?>
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$questtext['media']['url']))?>">
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$questtext['media']['url'],'quest'))?>" />
</a>
<?php if(!empty($questtext['media']['sourceurl'])) : ?>
<span class="source">
<a href="<?=$questtext['media']['sourceurl']?>" target="_blank" title="<?=_('Image source')?>" rel="nofollow">
<i class="fa fa-external-link"></i>
</a>
</span>
<?php endif ?>
<?php endif ?>
<?=str_replace('<p>', '', str_replace('</p>', '', $t->t($questtext['text'])))?>
</p>
<?php if(count($questtext['relatedQuestsgroups']) > 0 || !empty($questtext['abort_text'])) : ?>
<ul>
<?php foreach($questtext['relatedQuestsgroups'] as &$relatedQuestgroup) : ?>
<li><p><a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$relatedQuestgroup['url']))?>"><?=$relatedQuestgroup['entry_text']?></a></p></li>
<?php endforeach ?>
<?php if(!empty($questtext['abort_text'])) : ?>
<li><p><a href="<?=$linker->link(array('quest',$seminary['url'],$relatedquesttext['quest']['questgroup_url'],$relatedquesttext['quest']['url'],$relatedquesttext['type_url']),1)?>"><?=$questtext['abort_text']?></a></p></li>
<?php endif ?>
</ul>
<?php endif ?>
<?php endforeach ?>
</div>
</section>
<?php endif ?>
<section>
<?php if(count($nextquests) > 0 || !is_null($nextquestgroup)) : ?>
<h1><?=_('Continuation')?></h1>
<?php if(count($nextquests) > 0) : ?>
<ul>
<?php foreach($nextquests as &$nextquest) : ?>
<?php if($nextquest['id'] == $relatedquesttext['quest']['id']) : ?>
<li>
<p>
<?=_('Quest')?>:
<?php if($nextquest['entered'] || !$charactedHasChoosenNextQuest) : ?>
<a href="<?=$linker->link(array($nextquest['questgroup_url'],$nextquest['url'],$relatedquesttext['type_url']),3)?>"><?=$nextquest['title']?></a>
<?php else : ?>
<?=$nextquest['title']?>
<?php endif ?>
</p>
</li>
<?php else : ?>
<li>
<?php if(!empty($nextquest['entry_text'])) : ?>
<i><?=$nextquest['entry_text']?></i>
<?php if($nextquest['entered'] || !$charactedHasChoosenNextQuest) : ?>
<p><a class="cta orange" href="<?=$linker->link(array($nextquest['questgroup_url'],$nextquest['url']),3)?>"><?=_('Choose')?></a></p>
<?php endif ?>
<?php else : ?>
<p><?=_('Quest')?>: <a href="<?=$linker->link(array($nextquest['questgroup_url'],$nextquest['url']),3)?>"><?=$nextquest['title']?></a></p>
<?php if($nextquest['entered'] || !$charactedHasChoosenNextQuest) : ?>
<p><a class="cta orange" href="<?=$linker->link(array($nextquest['questgroup_url'],$nextquest['url']),3)?>"><?=_('Go on')?></a></p>
<?php endif ?>
<?php endif ?>
</li>
<?php endif ?>
<?php endforeach ?>
</ul>
<?php elseif(!is_null($nextquestgroup)) : ?>
<p><?=$nextquestgroup['hierarchy']['title_singular']?> <?=$nextquestgroup['hierarchy']['questgroup_pos']?>: <a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$nextquestgroup['url']))?>"><?=$nextquestgroup['title']?></a></p>
<p><a class="cta orange" href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$nextquestgroup['url']))?>"><?=_('Lets go')?></a></p>
<?php endif ?>
<?php endif ?>
</section>

View file

@ -0,0 +1,8 @@
<?=$moodpic?>
<?=$questgroupshierarchypath?>
<h1><?=$quest['title']?></h1>
<h3><?=sprintf(_('Submission of %s'),$character['name'])?></h3>
<section>
<?=$output?>
</section>

View file

@ -0,0 +1,35 @@
<?=$moodpic?>
<?=$questgroupshierarchypath?>
<h1><?=$quest['title']?> (<?=_('Submissions')?>)</h1>
<section>
<h1><?=_('submitted')?></h1>
<ol class="cglist">
<?php foreach($submittedSubmissionCharacters as &$character) : ?>
<li>
<a href="<?=$linker->link(array('submission',$seminary['url'],$questgroup['url'],$quest['url'],$character['url']),1)?>"><?=$character['name']?></a>
<span class="xp"><small><?=sprintf(_('submitted at %s on %sh'), $dateFormatter->format(new \DateTime($character['submission_created'])), $timeFormatter->format(new \DateTime($character['submission_created'])))?></small></span>
</li>
<?php endforeach?>
</ol>
<h1><?=_('unsolved')?></h1>
<ol class="cglist">
<?php foreach($unsolvedSubmissionCharacters as &$character) : ?>
<li>
<a href="<?=$linker->link(array('submission',$seminary['url'],$questgroup['url'],$quest['url'],$character['url']),1)?>"><?=$character['name']?></a>
<span class="xp"><small><?=sprintf(_('submitted at %s on %sh'), $dateFormatter->format(new \DateTime($character['submission_created'])), $timeFormatter->format(new \DateTime($character['submission_created'])))?></small></span>
</li>
<?php endforeach?>
</ol>
<h1><?=_('solved')?></h1>
<ol class="cglist">
<?php foreach($solvedSubmissionCharacters as &$character) : ?>
<li>
<a href="<?=$linker->link(array('submission',$seminary['url'],$questgroup['url'],$quest['url'],$character['url']),1)?>"><?=$character['name']?></a>
<span class="xp"><small><?=sprintf(_('submitted at %s on %sh'), $dateFormatter->format(new \DateTime($character['submission_created'])), $timeFormatter->format(new \DateTime($character['submission_created'])))?></small></span>
</li>
<?php endforeach?>
</ol>
</section>

View file

View file

@ -0,0 +1,118 @@
<?=$moodpic?>
<ul class="breadcrumbs">
<li><a href="<?=$linker->link('index',1)?>"><?=_('Seminaries')?></a></li>
</ul>
<h1><?=_('Copy seminary')?></h1>
<?php if(!is_null($exception)) : ?>
<p class="error">
<?php if($exception instanceof \hhu\z\exceptions\FileCopyException) : ?>
<?=sprintf(_('Copying of files failed: “%s”'), $exception->getNestedError()['message'])?>
<?php elseif($exception instanceof \Exception) : ?>
<?=sprintf(_('Copying of Seminary failed: “%s”'), $exception->getMessage())?>
<?php endif ?>
</p>
<?php endif ?>
<?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 'moodpic':
switch($setting) {
case 'error': printf(_('Error during moodpic upload: %s'), $value);
break;
case 'mimetype': printf(_('Moodpic has wrong type “%s”'), $value);
break;
case 'size': echo _('Moodpic exceeds size maximum');
break;
default: echo _('Moodpic 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;
case 'course':
switch($setting) {
case 'maxlength': printf(_('Course is too long (max. %d chars)'), $value);
break;
default: echo _('Course invalid');
}
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<form method="post" class="logreg" enctype="multipart/form-data">
<fieldset>
<label for="title"><?=_('Title')?>:</label>
<input type="text" id="title" name="title" placeholder="<?=_('Title')?>" required="required" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=($validation !== true && array_key_exists('title', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="course"><?=_('Course')?>:</label>
<input type="text" id="course" name="course" placeholder="<?=_('Course')?>" maxlength="<?=$validationSettings['course']['maxlength']?>" value="<?=$course?>" <?=($validation !== true && array_key_exists('course', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="description"><?=_('Description')?>:<br />
<textarea id="description" name="description" placeholder="<?=_('Description')?>"><?=$description?></textarea><br />
</fieldset>
<fieldset>
<legend><?=_('Elements')?></legend>
<input type="checkbox" id="elements_seminaryfields" name="elements[seminaryfields]" <?php if(array_key_exists('seminaryfields', $elements)) : ?>checked="checked"<?php endif ?> />
<label for="elements_seminaryfields"><?=_('Seminary fields')?></label>
<input type="checkbox" id="elements_media" name="elements[media]" <?php if(array_key_exists('media', $elements)) : ?>checked="checked"<?php endif ?> />
<label for="elements_media"><?=_('Media')?></label>
<input type="checkbox" id="elements_questgroupshierarchy" name="elements[questgroupshierarchy]" <?php if(array_key_exists('questgroupshierarchy', $elements)) : ?>checked="checked"<?php endif ?> />
<label for="elements_questgroupshierarchy"><?=_('Questgroupshierarchy')?></label>
<div class="cond">
<input type="checkbox" id="elements_questgroups" name="elements[questgroups]" <?php if(array_key_exists('questgroups', $elements)) : ?>checked="checked"<?php endif ?> />
<label for="elements_questgroups"><?=_('Questgroups')?></label>
<div class="cond">
<input type="checkbox" id="elements_quests" name="elements[quests]" <?php if(array_key_exists('quests', $elements)) : ?>checked="checked"<?php endif ?> />
<label for="elements_quests"><?=_('Quests')?></label>
<div class="cond">
<input type="checkbox" id="elements_questtopics" name="elements[questtopics]" <?php if(array_key_exists('questtopics', $elements)) : ?>checked="checked"<?php endif ?> />
<label for="elements_questtopics"><?=_('Library')?></label>
</div>
</div>
</div>
<input type="checkbox" id="elements_charactertypes" name="elements[charactertypes]" <?php if(array_key_exists('charactertypes', $elements)) : ?>checked="checked"<?php endif ?> />
<label for="elements_charactertypes"><?=_('Charactertypes')?></label>
<div class="cond">
<input type="checkbox" id="elements_xplevels" name="elements[xplevels]" <?php if(array_key_exists('xplevels', $elements)) : ?>checked="checked"<?php endif ?> />
<label for="elements_xplevels"><?=_('XP-Levels')?></label>
<div class="cond">
<input type="checkbox" id="elements_avatars" name="elements[avatars]" <?php if(array_key_exists('avatars', $elements)) : ?>checked="checked"<?php endif ?> />
<label for="elements_avatars"><?=_('Avatars')?></label>
</div>
</div>
<input type="checkbox" id="elements_achievements" name="elements[achievements]" <?php if(array_key_exists('achievements', $elements)) : ?>checked="checked"<?php endif ?> />
<label for="elements_achievements"><?=_('Achievements')?></label>
<input type="checkbox" id="elements_charactergroupsgroups" name="elements[charactergroupsgroups]" <?php if(array_key_exists('charactergroupsgroups', $elements)) : ?>checked="checked"<?php endif ?> />
<label for="elements_charactergroupsgroups"><?=_('Character Groups')?></label>
<div class="cond">
<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 class="cond">
<input type="checkbox" id="elements_charactergroupsqueststations" name="elements[charactergroupsqueststations]" <?php if(array_key_exists('charactergroupsqueststations', $elements)) : ?>checked="checked"<?php endif ?> />
<label for="elements_charactergroupsqueststations"><?=_('Character Groups Quest Stations')?></label>
</div>
</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>

View file

@ -0,0 +1,74 @@
<?=$moodpic?>
<ul class="breadcrumbs">
<li><a href="<?=$linker->link('index',1)?>"><?=_('Seminaries')?></a></li>
</ul>
<h1><?=_('New seminary')?></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 'moodpic':
switch($setting) {
case 'error': printf(_('Error during moodpic upload: %s'), $value);
break;
case 'mimetype': printf(_('Moodpic has wrong type “%s”'), $value);
break;
case 'size': echo _('Moodpic exceeds size maximum');
break;
default: echo _('Moodpic 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;
case 'course':
switch($setting) {
case 'maxlength': printf(_('Course is too long (max. %d chars)'), $value);
break;
default: echo _('Course invalid');
}
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<form method="post" class="logreg" enctype="multipart/form-data">
<fieldset>
<legend><?=_('Moodpic')?></legend>
<input type="file" name="moodpic" 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>
<fieldset>
<label for="title"><?=_('Title')?>:</label>
<input 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="course"><?=_('Course')?>:</label>
<input type="text" name="course" placeholder="<?=_('Course')?>" maxlength="<?=$validationSettings['course']['maxlength']?>" value="<?=$course?>" <?=(array_key_exists('course', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="description"><?=_('Description')?>:<br />
<textarea name="description" placeholder="<?=_('Description')?>"><?=$description?></textarea><br />
</fieldset>
<input type="submit" name="create" value="<?=_('create')?>" />
</form>

View file

@ -0,0 +1,11 @@
<?=$moodpic?>
<ul class="breadcrumbs">
<li><a href="<?=$linker->link('index',1)?>"><?=_('Seminaries')?></a></li>
</ul>
<h1><?=_('Delete seminary')?></h1>
<?=sprintf(_('Should the seminary “%s” really be deleted?'), $seminary['title'])?>
<form method="post">
<input type="submit" name="delete" value="<?=_('delete')?>" />
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
</form>

View file

@ -0,0 +1,74 @@
<?=$moodpic?>
<ul class="breadcrumbs">
<li><a href="<?=$linker->link('index',1)?>"><?=_('Seminaries')?></a></li>
</ul>
<h1><?=_('Edit seminary')?></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 'moodpic':
switch($setting) {
case 'error': printf(_('Error during moodpic upload: %s'), $value);
break;
case 'mimetype': printf(_('Moodpic has wrong type “%s”'), $value);
break;
case 'size': echo _('Moodpic exceeds size maximum');
break;
default: echo _('Moodpic 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;
case 'course':
switch($setting) {
case 'maxlength': printf(_('Course is too long (max. %d chars)'), $value);
break;
default: echo _('Course invalid');
}
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<form method="post" class="logreg" enctype="multipart/form-data">
<fieldset>
<legend><?=_('Moodpic')?></legend>
<input type="file" name="moodpic" 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>
<fieldset>
<label for="title"><?=_('Title')?>:</label>
<input 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="course"><?=_('Course')?>:</label>
<input type="text" name="course" placeholder="<?=_('Course')?>" maxlength="<?=$validationSettings['course']['maxlength']?>" value="<?=$course?>" <?=(array_key_exists('course', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="description"><?=_('Description')?>:<br />
<textarea name="description" placeholder="<?=_('Description')?>"><?=$description?></textarea><br />
</fieldset>
<input type="submit" name="edit" value="<?=_('edit')?>" />
</form>

View file

@ -0,0 +1,51 @@
<?=$moodpic?>
<h1><?=_('Seminaries')?></h1>
<?php if(count(array_intersect(array('admin','moderator'),\hhu\z\controllers\IntermediateController::$user['roles'])) > 0) : ?>
<nav class="admin">
<li><a href="<?=$linker->link('create', 1)?>"><?=_('Create new seminary')?></a></li>
</nav>
<?php endif ?>
<ul class="questgroups cf">
<?php foreach($seminaries as &$seminary) : ?>
<li>
<?php if(!is_null($seminary['seminarymedia_id'])) : ?>
<img src="<?=$linker->link(array('media','seminarymoodpic',$seminary['url']))?>" />
<?php endif ?>
<section>
<p class="fwb">
<?php if(array_key_exists('usercharacter', $seminary) && count($seminary['usercharacter']['characterroles']) > 0) : ?>
<a href="<?=$linker->link(array('seminary', $seminary['url']), 1)?>"><?=$seminary['title']?></a>
<?php else : ?>
<?=$seminary['title']?>
<?php endif ?>
</p>
<?php if(array_key_exists('usercharacter', $seminary)) : ?>
<div class="cf">
<div class="xpbar">
<span style="width:<?=($seminary['xps'] > 0) ? round($seminary['usercharacter']['xps'] * 100 / $seminary['xps']) : 0?>%"></span>
</div>
<p class="xpnumeric"><?=$seminary['usercharacter']['xps']?> / <?=sprintf(_('%dXPs'), $seminary['xps'])?></p>
</div>
<?php endif ?>
<p><?=\hhu\z\Utils::t($seminary['description'])?></p>
<p><small><?=sprintf(_('created by %s on %s'), $seminary['creator']['username'], $dateFormatter->format(new \DateTime($seminary['created'])))?></small></p>
<?php if(!array_key_exists('usercharacter', $seminary)) : ?>
<?php if($seminary['created_user_id'] == \hhu\z\controllers\IntermediateController::$user['id']) : ?>
<a class="cta orange" href="<?=$linker->link(array('xplevels','manage',$seminary['url']))?>"><?=_('Manage XP-levels')?></a>
<?php if(count($seminary['xplevels']) > 0) : ?>
<a class="cta orange" href="<?=$linker->link(array('charactertypes','index',$seminary['url']))?>"><?=_('Manage Charactertypes')?></a>
<?php endif ?>
<?php endif ?>
<?php if(count($seminary['charactertypes']) > 0) : ?>
<a class="cta orange" href="<?=$linker->link(array('characters','register',$seminary['url']))?>"><?=_('Create a Character')?></a>
<?php endif ?>
<?php elseif(count($seminary['usercharacter']['characterroles']) == 0) : ?>
<p><?=sprintf(_('Your Character “%s” has not been activated yet'), $seminary['usercharacter']['name'])?></p>
<?php endif ?>
</section>
</li>
<?php endforeach ?>
</ul>

View file

@ -0,0 +1,80 @@
<?=$moodpic?>
<h1><?=$seminary['title']?></h1>
<?php if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?>
<?php if(in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?>
<nav class="admin">
<li><a href="<?=$linker->link('edit', 3)?>"><?=_('Edit seminary')?></a></li>
<li><a href="<?=$linker->link('copy', 3)?>"><?=_('Copy seminary')?></a></li>
<li><a href="<?=$linker->link('delete', 3)?>"><?=_('Delete seminary')?></a></li>
</nav>
<?php endif ?>
<nav class="admin">
<li><a href="<?=$linker->link(array('quests','index',$seminary['url']))?>"><?=_('Show Quests')?></a></li>
<li><a href="<?=$linker->link(array('calculatexps',$seminary['url']),1)?>"><?=_('Recalculate XPs')?></a></li>
</nav>
<?php endif ?>
<p><?=\hhu\z\Utils::t($seminary['description'])?></p>
<?php foreach($questgroupshierarchy as $hierarchyIndex => &$hierarchy) : ?>
<h2 id="<?=$hierarchy['url']?>"><?=$hierarchy['title_plural']?></h2>
<?php if(in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?>
<nav class="admin">
<li><a href="<?=$linker->link(array('questgroupshierarchy','edit',$seminary['url'],$hierarchy['url']))?>"><?=_('Edit Questgroupshierarchy')?></a></li>
<li><a href="<?=$linker->link(array('questgroupshierarchy','delete',$seminary['url'],$hierarchy['url']))?>"><?=_('Delete Questgroupshierarchy')?></a></li>
<?php if($hierarchyIndex > 0) : ?><li><a href="<?=$linker->link(array('questgroupshierarchy','moveup',$seminary['url'],$hierarchy['url']))?>">↑</a></li><?php endif ?>
<?php if($hierarchyIndex < count($questgroupshierarchy)-1) : ?><li><a href="<?=$linker->link(array('questgroupshierarchy','movedown',$seminary['url'],$hierarchy['url']))?>">↓</a></li><?php endif ?>
</nav>
<?php endif ?>
<ul class="questgroups cf">
<?php foreach($hierarchy['questgroups'] as $questgroupIndex => &$group) : ?>
<li>
<?php if(!is_null($group['picture'])) : ?>
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$group['picture']['url']))?>">
<?php endif ?>
<section>
<div class="qgorder">
<?php if($questgroupIndex > 0) : ?><a href="<?=$linker->link(array('questgroups','moveup',$seminary['url'],$group['url']))?>">↑</a><?php endif ?>
<?php if($questgroupIndex < count($hierarchy['questgroups'])-1) : ?><a href="<?=$linker->link(array('questgroups','movedown',$seminary['url'],$group['url']))?>">↓</a><?php endif ?>
</div>
<div>
<p class="fwb"><?=$hierarchy['title_singular']?> <?=$group['pos']?>:
<a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$group['url']))?>"><?=$group['title']?></a></p>
</div>
<div class="cf">
<div class="xpbar">
<span style="width:<?=($group['achievable_xps'] > 0) ? round($group['character_xps']*100/$group['achievable_xps']) : 0?>%"></span>
</div>
<p class="xpnumeric"><?=$group['character_xps']?> / <?=$group['achievable_xps']?> XP</p>
</div>
<?php if(array_key_exists('text', $group)) : ?>
<p><?=$group['text']?></p>
<?php endif ?>
<a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$group['url']))?>" class="cta orange"><?=_('Lets go')?></a>
<?php if(in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?>
<?php endif ?>
</section>
</li>
<?php endforeach?>
<?php if(in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?>
<li>
<section>
<form method="post" action="<?=$linker->link(array('questgroups','create',$seminary['url']))?>" enctype="multipart/form-data">
<input type="hidden" name="questgroupshierarchy" value="<?=$hierarchy['url']?>" />
<input type="file" name="moodpic" />
<?=$hierarchy['title_singular']?> <?=count($hierarchy['questgroups'])+1?>:
<input type="text" name="title" value="" placeholder="<?=_('Title')?>" />
<input type="submit" name="create" value="<?=_('Add new Questgroup')?>" />
</form>
</section>
</li>
<?php endif ?>
</ul>
<?php endforeach ?>
<?php if(in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?>
<form method="post" action="<?=$linker->link(array('questgroupshierarchy','create',$seminary['url']))?>">
<h2><?=_('New Questgroupshierarchy')?></h2>
<?=_('Title (singular)')?>: <input type="text" name="title_singular" placeholder="<?=_('Title (singular)')?>" />
<?=_('Title (plural)')?>: <input type="text" name="title_plural" placeholder="<?=_('Title (plural)')?>" />
<input type="submit" name="create" value="<?=_('Add new Questgroupshierarchy')?>" />
</form>
<?php endif ?>

View file

@ -0,0 +1,60 @@
<?php if($render) : ?>
<section class="cf">
<h1><?=$character['name']?></h1>
<?php if(array_key_exists('avatar', $character) && !is_null($character['avatar']['avatarpicture_id'])) : ?>
<img src="<?=$linker->link(array('media','avatar',$seminary['url'],$character['charactertype_url'],$character['xplevel']['level']))?>" class="char">
<?php endif ?>
<ul class="charstats">
<?php if(!is_null($character['xplevel'])) : ?>
<li><i class="fa fa-caret-right fa-fw"></i><?=('Level')?> <?=$character['xplevel']['level']?></li>
<?php endif ?>
<li><i class="fa fa-caret-right fa-fw"></i><?=sprintf(_('%dXPs'), $character['xps'])?></li>
<li><i class="fa fa-caret-right fa-fw"></i><?=$character['rank']?>. <?=_('Rank')?></li>
<li><i class="fa fa-caret-right fa-fw"></i><a href="<?=$linker->link(array('characters','character',$seminary['url'],$character['url']))?>">Zum Profil</a></li>
</ul>
</section>
<?php if(!is_null($lastQuest)) : ?>
<section>
<h1><?=_('Last Quest')?></h1>
<p><i class="fa fa-pencil-square-o fa-fw"></i><a href="<?=$linker->link(array('quests','quest',$seminary['url'],$lastQuest['questgroup']['url'],$lastQuest['url']))?>"><?=$lastQuest['title']?></a></p>
</section>
<?php endif ?>
<?php if(!is_null($lastAchievement)) : ?>
<section>
<h1><?=_('Last Achievement')?></h1>
<ul class="cranks">
<li>
<?php if(!is_null($lastAchievement['achieved_achievementsmedia_id'])) : ?>
<a href="<?=$linker->link(array('achievements','index',$seminary['url']),0,true,null,true,$lastAchievement['url'])?>" title="Achievement-Titel"><img src="<?=$linker->link(array('media','achievement',$seminary['url'],$lastAchievement['url']))?>"></a>
<?php endif ?>
<p><a href="<?=$linker->link(array('achievements','index',$seminary['url']),0,true,null,true,$lastAchievement['url'])?>"><?=$lastAchievement['title']?></a></p>
<p><small><?=sprintf(_('achieved at: %s'), $dateFormatter->format(new \DateTime($lastAchievement['created'])))?></small></p>
</li>
</ul>
</section>
<?php endif ?>
<section>
<?php foreach($characterGroups as &$group) : ?>
<h1><?=$group['name']?></h1>
<ul class="cranks">
<?php foreach($group['members'] as &$member) : ?>
<li>
<a href="#" title="Achievement-Titel"><img src="<?=$linker->link(array('media','avatar',$seminary['url'],$member['charactertype_url'],$member['xplevel'],'portrait'))?>"></a>
<p><a href="<?=$linker->link(array('characters','character',$seminary['url'],$member['url']))?>"><?=$member['name']?></a></p>
<p><small>
<?php if(array_key_exists('xplevel', $member) && !is_null($member['xplevel'])) : ?>
<?=_('Level')?> <?=$member['xplevel']?> (<?=sprintf(_('%dXPs'), $member['xps'])?>)
<?php else : ?>
<?=sprintf(_('%dXPs'), $member['xps'])?>
<?php endif ?>
</small></p>
</li>
<?php endforeach ?>
</ul>
<p><i class="fa fa-users fa-fw"></i><a href="<?=$linker->link(array('charactergroups','group',$seminary['url'],$group['charactergroupsgroup_url'],$group['url']))?>"><?=sprintf(_('Show %s-Profile'),$group['charactergroupsgroup_name'])?></a></p>
<?php endforeach ?>
</section>
<?php endif ?>

View file

@ -0,0 +1,10 @@
<?php if(!is_null($loggedCharacter) && count($loggedCharacter['characterroles']) > 0) : ?>
<ul id="smnry">
<li><a href="<?=$linker->link(array('seminaries',$loggedSeminary['url']))?>"><i class="fa fa-home fa-fw"></i><?=$loggedSeminary['title']?></a></li>
<?php if(count(array_intersect(array('admin','moderator'),$loggedUser['roles'])) > 0 || count(array_intersect(array('admin','moderator'),$loggedCharacter['characterroles']))) : ?><li><a href="<?=$linker->link(array('characters',$loggedSeminary['url']))?>"><i class="fa fa-user fa-fw"></i><?=_('Characters')?></a></li><?php endif ?>
<li><a href="<?=$linker->link(array('charactergroups','index',$loggedSeminary['url']))?>"><i class="fa fa-users fa-fw"></i><?=_('Character Groups')?></a></li>
<li><a href="<?=$linker->link(array('achievements','index',$loggedSeminary['url']))?>"><i class="fa fa-trophy fa-fw"></i><?=_('Achievements')?></a></li>
<li><a href="<?=$linker->link(array('library','index',$loggedSeminary['url']))?>"><i class="fa fa-book fa-fw"></i><?=_('Library')?></a></li>
<?php if(!is_null($map) || count(array_intersect(array('admin','moderator'),$loggedCharacter['characterroles']))) : ?><li><a href="<?=$linker->link(array('map','index',$loggedSeminary['url']))?>"><i class="fa fa-map fa-fw"></i><?=_('Map')?></a></li><?php endif ?>
</ul>
<?php endif ?>

View file

@ -0,0 +1,15 @@
<ul>
<?php foreach($roles as &$role) : ?>
<li>
<?php switch($role['name']) {
case 'admin': echo _('Admin');
break;
case 'moderator': echo _('Moderator');
break;
case 'user': echo _('User');
break;
}
?>
</li>
<?php endforeach ?>
</ul>

View file

@ -0,0 +1,99 @@
<div class="moodpic">
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
</div>
<ul class="breadcrumbs">
<li><a href="<?=$linker->link('index',1)?>"><?=_('Users')?></a></li>
</ul>
<h1><?=_('New user')?></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 'username':
switch($setting) {
case 'minlength': printf(_('Username is too short (min. %d chars)'), $value);
break;
case 'maxlength': printf(_('Username is too long (max. %d chars)'), $value);
break;
case 'regex': echo _('Username contains illegal characters');
break;
case 'exist': echo _('Username already exists');
break;
default: echo _('Username invalid');
}
break;
case 'prename':
switch($setting) {
case 'minlength': printf(_('Prename is too short (min. %d chars)'), $value);
break;
case 'maxlength': printf(_('Prename is too long (max. %d chars)'), $value);
break;
case 'regex': printf(_('Prename contains illegal characters'));
break;
default: echo _('Prename invalid');
}
break;
case 'surname':
switch($setting) {
case 'minlength': printf(_('Surname is too short (min. %d chars)'), $value);
break;
case 'maxlength': printf(_('Surname is too long (max. %d chars)'), $value);
break;
case 'regex': printf(_('Surname contains illegal characters'));
break;
default: echo _('Surname invalid');
}
break;
case 'email':
switch($setting) {
case 'regex': echo _('Email address invalid');
break;
case 'exist': echo _('Email address already exists');
break;
default: echo _('Email address invalid');
}
break;
case 'password':
switch($setting) {
case 'minlength': printf(_('Password is too short (min. %d chars)'), $value);
break;
case 'maxlength': printf(_('Password is too long (max. %d chars)'), $value);
break;
case 'repeat': printf(_('Passwords does not match'));
break;
default: echo _('Password invalid');
}
break;
default:
echo $exception->getMessage();
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<form method="post" class="logreg">
<fieldset>
<label for="username"><?=_('Username')?>:</label>
<input name="username" type="text" placeholder="<?=_('Username')?>" title="<?=_('Username')?>" required="required" maxlength="<?=$validationSettings['username']['maxlength']?>" value="<?=$username?>" <?=(array_key_exists('username', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="prename"><?=_('Prename')?>:</label>
<input name="prename" type="text" placeholder="<?=_('Prename')?>" title="<?=_('Prename')?>" required="required" maxlength="<?=$validationSettings['prename']['maxlength']?>" value="<?=$prename?>" <?=(array_key_exists('prename', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="surname"><?=_('Surname')?>:</label>
<input name="surname" type="text" placeholder="<?=_('Surname')?>" title="<?=_('Surname')?>" required="required" maxlength="<?=$validationSettings['surname']['maxlength']?>" value="<?=$surname?>" <?=(array_key_exists('surname', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="email"><?=_('Email address')?>:</label>
<input name="email" type="email" placeholder="<?=_('Email address')?>" title="<?=_('Email address')?>" required="required" value="<?=$email?>" <?=(array_key_exists('email', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="password"><?=_('Password')?>:</label>
<input name="password" type="password" placeholder="<?=_('Password')?>" title="<?=_('Password')?>" required="required" maxlength="<?=$validationSettings['password']['maxlength']?>" <?=(array_key_exists('password', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="passwordrepeat"><?=_('Repeat password')?>:</label>
<input name="passwordrepeat" type="password" placeholder="<?=_('Password')?>" title="<?=_('Password')?>" required="required" maxlength="<?=$validationSettings['password']['maxlength']?>" <?=(array_key_exists('password', $validation)) ? 'class="invalid"' : null?> /><br />
</fieldset>
<input type="submit" name="create" value="<?=_('create')?>" />
</form>

View file

@ -0,0 +1,13 @@
<div class="moodpic">
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
</div>
<ul class="breadcrumbs">
<li><a href="<?=$linker->link('index',1)?>"><?=_('Users')?></a></li>
</ul>
<h1><?=_('Delete user')?></h1>
<?=sprintf(_('Should the user “%s” (%s) really be deleted?'), $user['username'], $user['email'])?>
<form method="post">
<input type="submit" name="delete" value="<?=_('delete')?>" />
<input type="submit" name="not-delete" value="<?=_('cancel')?>" />
</form>

110
views/html/users/edit.tpl Normal file
View file

@ -0,0 +1,110 @@
<div class="moodpic">
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
</div>
<ul class="breadcrumbs">
<?php if(count(array_intersect(array('admin','moderator'),\hhu\z\controllers\IntermediateController::$user['roles'])) > 0) : ?>
<li><a href="<?=$linker->link('index',1)?>"><?=_('Users')?></a></li>
<?php else : ?>
<li><?=_('Users')?></li>
<?php endif ?>
</ul>
<h1><?=_('Edit user')?></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 'username':
switch($setting) {
case 'minlength': printf(_('Username is too short (min. %d chars)'), $value);
break;
case 'maxlength': printf(_('Username is too long (max. %d chars)'), $value);
break;
case 'regex': echo _('Username contains illegal characters');
break;
case 'exist': echo _('Username already exists');
break;
default: echo _('Username invalid');
}
break;
case 'prename':
switch($setting) {
case 'minlength': printf(_('Prename is too short (min. %d chars)'), $value);
break;
case 'maxlength': printf(_('Prename is too long (max. %d chars)'), $value);
break;
case 'regex': printf(_('Prename contains illegal characters'));
break;
default: echo _('Prename invalid');
}
break;
case 'surname':
switch($setting) {
case 'minlength': printf(_('Surname is too short (min. %d chars)'), $value);
break;
case 'maxlength': printf(_('Surname is too long (max. %d chars)'), $value);
break;
case 'regex': printf(_('Surname contains illegal characters'));
break;
default: echo _('Surname invalid');
}
break;
case 'email':
switch($setting) {
case 'regex': echo _('Email address invalid');
break;
case 'exist': echo _('Email address already exists');
break;
default: echo _('Email address invalid');
}
break;
case 'password':
switch($setting) {
case 'minlength': printf(_('Password is too short (min. %d chars)'), $value);
break;
case 'maxlength': printf(_('Password is too long (max. %d chars)'), $value);
break;
case 'repeat': printf(_('Passwords does not match'));
break;
default: echo _('Password invalid');
}
break;
default:
echo $exception->getMessage();
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<form method="post" class="logreg">
<fieldset>
<label for="username"><?=_('Username')?>:</label>
<?php if(count(array_intersect(array('admin','moderator'),\hhu\z\controllers\IntermediateController::$user['roles'])) > 0) : ?>
<input name="username" type="text" placeholder="<?=_('Username')?>" title="<?=_('Username')?>" value="<?=$username?>" required="required" maxlength="<?=$validationSettings['username']['maxlength']?>" <?=(array_key_exists('username', $validation)) ? 'class="invalid"' : null ?> />
<?php else : ?>
<input name="username" type="text" placeholder="<?=_('Username')?>" title="<?=_('Username')?>" value="<?=$username?>" disabled="disabled" />
<input type="hidden" name="username" value="<?=$username?>" />
<?php endif ?><br />
<label for="prename"><?=_('Prename')?>:</label>
<input name="prename" type="text" placeholder="<?=_('Prename')?>" title="<?=_('Prename')?>" required="required" maxlength="<?=$validationSettings['prename']['maxlength']?>" value="<?=$prename?>" <?=(array_key_exists('prename', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="surname"><?=_('Surname')?>:</label>
<input name="surname" type="text" placeholder="<?=_('Surname')?>" title="<?=_('Surname')?>" required="required" maxlength="<?=$validationSettings['surname']['maxlength']?>" value="<?=$surname?>" <?=(array_key_exists('surname', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="email"><?=_('Email address')?>:</label>
<input name="email" type="email" placeholder="<?=_('Email address')?>" title="<?=_('Email address')?>" required="required" value="<?=$email?>" <?=(array_key_exists('email', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="password"><?=_('Password')?>:</label>
<input name="password" type="password" placeholder="<?=_('Password')?>" title="<?=_('Password')?>" maxlength="<?=$validationSettings['password']['maxlength']?>" <?=(array_key_exists('password', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="passwordrepeat"><?=_('Repeat password')?>:</label>
<input name="passwordrepeat" type="password" placeholder="<?=_('Password')?>" title="<?=_('Password')?>" required="required" maxlength="<?=$validationSettings['password']['maxlength']?>" <?=(array_key_exists('password', $validation)) ? 'class="invalid"' : null?> /><br />
<input id="mailing" type="checkbox" name="mailing" <?php if($mailing) : ?>checked="checked"<?php endif ?> />
<label for="mailing"><?=_('Mail notifications')?></label>
</fieldset>
<input type="submit" name="save" value="<?=_('save')?>" />
</form>

View file

@ -0,0 +1,95 @@
<div class="moodpic">
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
</div>
<h1><?=_('Users')?></h1>
<nav class="admin">
<li><a href="<?=$linker->link('create', 1)?>"><?=_('Create new user')?></a></li>
<li><a href="<?=$linker->link('manage',1)?>"><?=_('Manage')?></a></li>
</nav>
<form method="get" class="logreg admnqf">
<fieldset>
<legend><?=_('Filters')?></legend>
<small><?=_('Sortorder')?>:</small>
<select name="sortorder" onchange="this.form.submit();">
<option value="username" <?php if($sortorder == 'username') : ?>selected="selected"<?php endif ?>><?=_('Username')?></option>
<option value="role" <?php if($sortorder == 'role') : ?>selected="selected"<?php endif ?>><?=_('Role')?></option>
<option value="created" <?php if($sortorder == 'created') : ?>selected="selected"<?php endif ?>><?=_('Date of registration')?></option>
</select>
<label for="username"><?=_('Username')?>:</label>
<input id="username" type="text" name="username" placeholder="<?=_('Username')?>" value="<?=$username?>" />
<label for="name"><?=_('Name')?>:</label>
<input id="name" type="text" name="name" placeholder="<?=_('Name')?>" value="<?=$name?>" />
<label for="email"><?=_('Email address')?>:</label>
<input id="email" type="text" name="email" placeholder="<?=_('Email address')?>" value="<?=$email?>" />
</fieldset>
<input type="submit" value="<?=_('Apply filters')?>" />
</form>
<ol id="userlist" class="cglist">
<?php foreach($users as &$user) : ?>
<li>
<p>
<a href="<?=$linker->link(array('user', $user['username']), 1)?>"><?=$user['username']?></a><span class="xp"><small><?=sprintf(_('registered on %s'), $dateFormatter->format(new \DateTime($user['created'])))?></small></span>
<?php if(in_array('admin', $user['roles'])) : ?><small>(<?=_('Admin')?>)</small><?php endif ?>
<?php if(in_array('moderator', $user['roles'])) : ?><small>(<?=_('Moderator')?>)</small><?php endif ?>
<?php if(in_array('user', $user['roles'])) : ?><small>(<?=_('User')?>)</small><?php endif ?>
<br />
<small>
<?=$user['prename']?> <?=$user['surname']?>,
<a href="mailto:<?=$user['email']?>"><?=$user['email']?></a>
</small>
</p>
</li>
<?php endforeach ?>
</ol>
<?php if(is_null($all) && ($page*$limit) < $usersCount) : ?>
<nav class="admin">
<li><a id="show-more" href="<?=$linker->link(null,1,true,array('page'=>$page+1,'sortorder'=>$sortorder),false)?>"><?=_('Show more')?></a></li>
<li><a id="show-all" href="<?=$linker->link('all',1,true,array('sortorder'=>$sortorder))?>"><?=_('Show all')?></a></li>
</nav>
<?php endif ?>
<script>
var page = 1;
var request;
var linkUser = "<?=$linker->link(array('users','user','USER'))?>";
var linkPage = "<?=$linker->link(null,1,true,array('page'=>'PAGE','sortorder'=>$sortorder),false)?>";
$("#show-more").click(function(event) {
if(request) {
request.abort();
}
page++;
request = $.getJSON(linkPage.replace('PAGE', page), function(data) {
$.each(data['users'], function(key, user) {
var urlUser = linkUser.replace('USER', user['url']);
$("#userlist").append(
"<li><p>" +
"<a href=\"" + urlUser + "\">" + user['username'] + "</a><span class=\"xp\"><small>" + user['created'] + "</small></span>\n" +
(user['roles'].length > 0 ? "<small>(" + user['roles'].join(', ') + ")</small>" : '') +
"<br /><small>" + user['prename'] + " " + user['surname'] + ", " +
"<a href=\"mailto:" + user['email'] + "\">" + user['email'] + "</a></small>" +
"</p></li>"
);
});
if(data['more']) {
$("#show-more").attr('href', linkPage.replace('PAGE', page+1));
}
else {
$("#show-more").remove();
$("#show-all").remove();
}
});
request.fail(function (jqXHR, textStatus, errorThrown) {
window.location.href = linkPage.replace('PAGE', page);
});
event.preventDefault();
return false;
});
</script>

View file

@ -0,0 +1,21 @@
<div class="moodpic">
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
</div>
<h1><?=_('Users')?></h1>
<h2><?=_('Login')?></h2>
<?php if($failed) : ?>
<p class="invalid"><?=_('Login failed')?>.</p>
<?php endif ?>
<form method="post" class="logreg">
<fieldset>
<label for="username"><?=_('Username')?>:</label>
<input name="username" type="text" placeholder="<?=_('Username')?>" value="<?=$username?>" required="required" autofocus="autofocus" /><br />
<label for="password"><?=_('Password')?>:</label>
<input name="password" type="password" placeholder="<?=_('Password')?>" required="required" /><br />
</fieldset>
<?php if(!empty($referrer)) : ?>
<input type="hidden" name="referrer" value="<?=$referrer?>" />
<?php endif ?>
<input type="submit" name="login" value="<?=_('Login')?>" />
</form>

View file

View file

@ -0,0 +1,54 @@
<div class="moodpic">
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
</div>
<ul class="breadcrumbs">
<li><a href="<?=$linker->link('index',1)?>"><?=_('Users')?></a></li>
</ul>
<h1><?=_('Manage users')?></h1>
<form method="post">
<fieldset class="filter">
<p><small>Sortierung:</small></p>
<select name="sortorder" onchange="this.form.submit();">
<option value="username" <?php if($sortorder == 'username') : ?>selected="selected"<?php endif ?>><?=_('Username')?></option>
<option value="role" <?php if($sortorder == 'role') : ?>selected="selected"<?php endif ?>><?=_('Role')?></option>
<option value="created" <?php if($sortorder == 'created') : ?>selected="selected"<?php endif ?>><?=_('Date of registration')?></option>
</select>
<noscript><input type="submit" value="<?=_('Sort list')?>" /></noscript>
</fieldset>
<fieldset>
<ul class="admnql">
<?php foreach($users as &$user) : ?>
<li class="cf">
<input type="checkbox" id="users-<?=$user['id']?>" name="users[]" value="<?=$user['id']?>" <?php if(in_array($user['id'], $selectedUsers)) : ?>checked="checked"<?php endif ?> <?php if($user['id'] == \hhu\z\controllers\SeminaryController::$user['id']) : ?>disabled="disabled"<?php endif ?>/>
<label for="users-<?=$user['id']?>">
<p>
<a href="<?=$linker->link(array('users','user',$user['url']))?>"><?=$user['username']?></a>
<?php if(in_array('admin', $user['roles'])) : ?><small>(<?=_('Admin')?>)</small><?php endif ?>
<?php if(in_array('moderator', $user['roles'])) : ?><small>(<?=_('Moderator')?>)</small><?php endif ?>
<?php if(in_array('user', $user['roles'])) : ?><small>(<?=_('User')?>)</small><?php endif ?>
<span class="xp"><small><?=sprintf(_('registered on %s'), $dateFormatter->format(new \DateTime($user['created'])))?></small></span>
</p>
</label>
</li>
<?php endforeach ?>
</ul>
</fieldset>
<fieldset>
<legend><?=_('Add role')?></legend>
<?php if(in_array('admin', \hhu\z\controllers\IntermediateController::$user['roles'])) : ?>
<input type="submit" name="actions[addrole]" value="<?=_('Admin')?>" />
<input type="submit" name="actions[addrole]" value="<?=_('Moderator')?>" />
<?php endif ?>
<input type="submit" name="actions[addrole]" value="<?=_('User')?>" />
</fieldset>
<fieldset>
<legend><?=_('Remove role')?></legend>
<?php if(in_array('admin', \hhu\z\controllers\IntermediateController::$user['roles'])) : ?>
<input type="submit" name="actions[removerole]" value="<?=_('Admin')?>" />
<input type="submit" name="actions[removerole]" value="<?=_('Moderator')?>" />
<?php endif ?>
<input type="submit" name="actions[removerole]" value="<?=_('User')?>" />
</fieldset>
</form>

View file

@ -0,0 +1,101 @@
<div class="moodpic">
<img src="<?=$linker->link(array('grafics','questlab.jpg'))?>" />
</div>
<ul class="breadcrumbs">
<li><?=_('Users')?></li>
</ul>
<h1><?=_('Registration')?></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 'username':
switch($setting) {
case 'minlength': printf(_('Username is too short (min. %d chars)'), $value);
break;
case 'maxlength': printf(_('Username is too long (max. %d chars)'), $value);
break;
case 'regex': echo _('Username contains illegal characters');
break;
case 'exist': echo _('Username already exists');
break;
default: echo _('Username invalid');
}
break;
case 'prename':
switch($setting) {
case 'minlength': printf(_('Prename is too short (min. %d chars)'), $value);
break;
case 'maxlength': printf(_('Prename is too long (max. %d chars)'), $value);
break;
case 'regex': printf(_('Prename contains illegal characters'));
break;
default: echo _('Prename invalid');
}
break;
case 'surname':
switch($setting) {
case 'minlength': printf(_('Surname is too short (min. %d chars)'), $value);
break;
case 'maxlength': printf(_('Surname is too long (max. %d chars)'), $value);
break;
case 'regex': printf(_('Surname contains illegal characters'));
break;
default: echo _('Surname invalid');
}
break;
case 'email':
switch($setting) {
case 'regex': echo _('Email address invalid');
break;
case 'exist': echo _('Email address already exists');
break;
case 'host': printf(_('EMail address has to end with @%s'), $emailhost);
break;
default: echo _('Email address invalid');
}
break;
case 'password':
switch($setting) {
case 'minlength': printf(_('Password is too short (min. %d chars)'), $value);
break;
case 'maxlength': printf(_('Password is too long (max. %d chars)'), $value);
break;
case 'repeat': printf(_('Passwords does not match'));
break;
default: echo _('Password invalid');
}
break;
default:
echo $exception->getMessage();
break;
} ?>
</li>
<?php endforeach ?>
</ul>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<form method="post" class="logreg">
<fieldset>
<label for="username"><?=_('Username')?>:</label>
<input name="username" type="text" placeholder="<?=_('Username')?>" title="<?=_('Username')?>" required="required" maxlength="<?=$validationSettings['username']['maxlength']?>" value="<?=$username?>" <?=(array_key_exists('username', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="prename"><?=_('Prename')?>:</label>
<input name="prename" type="text" placeholder="<?=_('Prename')?>" title="<?=_('Prename')?>" required="required" maxlength="<?=$validationSettings['prename']['maxlength']?>" value="<?=$prename?>" <?=(array_key_exists('prename', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="surname"><?=_('Surname')?>:</label>
<input name="surname" type="text" placeholder="<?=_('Surname')?>" title="<?=_('Surname')?>" required="required" maxlength="<?=$validationSettings['surname']['maxlength']?>" value="<?=$surname?>" <?=(array_key_exists('surname', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="email"><?=_('Email address')?>:</label>
<input name="email" type="email" placeholder="<?=(!empty($emailhost)) ? '…@'.$emailhost : _('Email address')?>" title="<?=_('Email address')?>" required="required" value="<?=$email?>" <?=(array_key_exists('email', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="password"><?=_('Password')?>:</label>
<input name="password" type="password" placeholder="<?=_('Password')?>" title="<?=_('Password')?>" required="required" maxlength="<?=$validationSettings['password']['maxlength']?>" <?=(array_key_exists('password', $validation)) ? 'class="invalid"' : null?> /><br />
<label for="passwordrepeat"><?=_('Repeat password')?>:</label>
<input name="passwordrepeat" type="password" placeholder="<?=_('Password')?>" title="<?=_('Password')?>" required="required" maxlength="<?=$validationSettings['password']['maxlength']?>" <?=(array_key_exists('password', $validation)) ? 'class="invalid"' : null?> /><br />
</fieldset>
<input type="submit" name="register" value="<?=_('Register')?>" />
</form>

Some files were not shown because too many files have changed in this diff Show more