hide map for Character groups Quest Stations when there are no stations
This commit is contained in:
commit
df14dfafc3
4371 changed files with 1220224 additions and 0 deletions
173
views/html/characters/character.tpl
Normal file
173
views/html/characters/character.tpl
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
<?=$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>
|
||||
|
||||
<?php if(array_key_exists('title', $character)) : ?>
|
||||
<p class="ctitle"><?=$character['title']?></p>
|
||||
<?php endif ?>
|
||||
<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?>.
|
||||
<?php if(array_key_exists('title', $rankCharacter)) : ?>
|
||||
<span class="ctitle"><?=$rankCharacter['title']?></span>
|
||||
<?php endif ?>
|
||||
<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(_('%d XPs'), $rankCharacter['xps'])?>)
|
||||
<?php else : ?>
|
||||
<?=sprintf(_('%d XPs'), $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']?>.
|
||||
<?php if(array_key_exists('title', $character)) : ?>
|
||||
<span class="ctitle"><?=$character['title']?></span>
|
||||
<?php endif ?>
|
||||
<?=$character['name']?>
|
||||
</p>
|
||||
<p><small>
|
||||
<?php if(array_key_exists('xplevel', $character) && !is_null($character['xplevel'])) : ?>
|
||||
<?=_('Level')?> <?=$character['xplevel']['level']?> (<?=sprintf(_('%d XPs'), $character['xps'])?>)
|
||||
<?php else : ?>
|
||||
<?=sprintf(_('%d XPs'), $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?>.
|
||||
<?php if(array_key_exists('title', $rankCharacter)) : ?>
|
||||
<span class="ctitle"><?=$rankCharacter['title']?></span>
|
||||
<?php endif ?>
|
||||
<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(_('%d XPs'), $rankCharacter['xps'])?>)
|
||||
<?php else : ?>
|
||||
<?=sprintf(_('%d XPs'), $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(_('%d XPs'), $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>
|
||||
|
||||
15
views/html/characters/delete.tpl
Normal file
15
views/html/characters/delete.tpl
Normal 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>
|
||||
132
views/html/characters/edit.tpl
Normal file
132
views/html/characters/edit.tpl
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
<?=$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;
|
||||
case 'gender':
|
||||
switch($setting) {
|
||||
case 'correct': echo _('Please select a gender');
|
||||
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>
|
||||
<?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>
|
||||
<label for="gender"><?=_('Gender')?>:</label>
|
||||
<select id="gender" name="gender">
|
||||
<option value=""><?=_('Select gender')?></option>
|
||||
<option value="0" <?php if($gender === 0) : ?>selected="selected"<?php endif ?>><?=_('Female')?></option>
|
||||
<option value="1" <?php if($gender === 1) : ?>selected="selected"<?php endif ?>><?=_('Male')?></option>
|
||||
</select>
|
||||
</fieldset>
|
||||
|
||||
<?php if(count($titles) > 0) : ?>
|
||||
<fieldset>
|
||||
<legend><?=_('Display settings')?></legend>
|
||||
<?php if(count($titles) > 0) : ?>
|
||||
<label><?=_('Charactertitle')?></label>
|
||||
<select id="title" name="title">
|
||||
<option value="" <?php if(is_null($charactertitle)) : ?>selected="selected"<?php endif ?>><?=_('no title')?></option>
|
||||
<?php foreach($titles as &$title) : ?>
|
||||
<option value="<?=$title['id']?>" <?php if(!is_null($charactertitle) && $title['id'] == $charactertitle['id']) : ?>selected="selected"<?php endif ?>><?=($gender) ? $title['title_male'] : $title['title_female']?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<?php endif ?>
|
||||
</fieldset>
|
||||
<?php endif ?>
|
||||
|
||||
<?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>
|
||||
114
views/html/characters/index.tpl
Normal file
114
views/html/characters/index.tpl
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
<?=$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>
|
||||
<li><a href="<?=$linker->link(array('charactertitles','index',$seminary['url']))?>"><?=_('Manage Charactertitles')?></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>
|
||||
61
views/html/characters/manage.tpl
Normal file
61
views/html/characters/manage.tpl
Normal 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>
|
||||
105
views/html/characters/register.tpl
Normal file
105
views/html/characters/register.tpl
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
<?=$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;
|
||||
case 'gender':
|
||||
switch($setting) {
|
||||
case 'correct': echo _('Please select a gender');
|
||||
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>
|
||||
<label for="gender"><?=_('Gender')?>:</label>
|
||||
<select id="gender" name="gender">
|
||||
<option value=""><?=_('Select gender')?></option>
|
||||
<option value="0"><?=_('Female')?></option>
|
||||
<option value="1"><?=_('Male')?></option>
|
||||
</select>
|
||||
</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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue